C++

Convert totalOunces to pints, cups, and ounces, finding the maximum number of pints, then cups, then ounces.

Ex: If the input is 63, then the output is:

Pints: 3
Cups: 1
Ounces: 7
Note: A pint is 16 ounces. A cup is 8 ounces.

More:
First, the number of pints is found using integer division on the total ounces. Then, the remaining amount is found using modulo.

Next, the number of cups is found using integer division on the remaining ounces. The remaining amount is updated using modulo.

Finally, the number of ounces is assigned with the remaining ounces.

Answers

Answer 1

#include <iostream>

#include <cmath>

void totalOunches(int n) {

   

   int count[3];

   

   for(int i=0; i<3; i++) {

       int general_term = (std::pow(i+1,2) - (19*(i+1)) + 50) / 2;

       count[i] = n / general_term;

       n -= general_term * count[i];

   }

   

   std::cout << "\nPints: "   << count[0]

             << "\nCups: "    << count[1]

             << "\nOunches: " << count[2]

             << std::endl;

}

int main(int argc, char* argv[]) {

   

   int idx;

   std::cin >> idx;

   totalOunches(idx);

   

   return 0;

}

C++ Convert TotalOunces To Pints, Cups, And Ounces, Finding The Maximum Number Of Pints, Then Cups, Then

Related Questions

what does an attacker need to do to use acquired user and account details from a users smart card

Answers

What an attacker needs to do to acquire user and account details from a user's smart card is to clone it.

What is cloning?

Cloning is the technique of producing an identical replica of another application program or object. The phrase can refer to an object, programming, or application that has similar functionality and behavior to another item or application program but does not include the actual source code from the relevant object or program. Cloning is also used to describe the operation of creating an identical replica of a directory file or disk, including any subdirectories or files included inside the disk or directory.

Cloning is the process of creating a genetically identical copy of a cell or an organism, and it is not just used for cyber theft. Cloning occurs frequently in nature. The duplication of any type of biological material for scientific studies, such as a chunk of DNA or a single cell, is known as "cloning" in the field of biomedical research.

learn more about Cloning at:

https://brainly.com/question/16155328

#SPJ1

Discuss a series of steps needed to generate value and useful insights from data?​

Answers

The four main steps of the data value chain are collection, publication, uptake, and impact. Identify, gather, process, analyse, release, disseminate, connect, motivate, influence, utilise, alter, and reuse are the twelve phases that are further divided into these four stages.

what is data value?

The material that makes up a record's space is known as a data value. For instance, a database may have a number that denotes the weight of a certain number in one of its fields, which is one of the database's multiple data fields. Data is a priceless corporate asset. Enterprise data isn't like real company assets with a measurable market worth, however how valuable it is. On a budget, line items like real estate, technological equipment, and office furniture are all clearly visible. Even other intangible resources, like people and intellectual property, have set norms and procedures for valuing.

Know more motivate Visit:

https://brainly.com/question/972761

#SPJ1

How do I add an image to this JFrame
please show me using the java code below

Answers

To add an image to this JFrame, we will use the java code written below.

What is a JFrame?

A top-level container called JFrame offers a window on the screen. The Java AWT and Java Swing libraries are first imported into our code. Second, we create JFrame using the Java Swing library.

JFrame frame = new JFrame(); //JFrame Creation      

frame.setTitle("Add Image"); //Add the title to frame

frame.setLayout(null); //Terminates default flow layout

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Terminate program on close button

frame.setBounds(100, 200, 350, 300); //Sets the position of the frame

frame.setVisible(true); // Exhibit the frame

Therefore, the codes are written above.

To learn more about JFrame, refer to the link:

https://brainly.com/question/28810787

#SPJ1

2 * 5 =

4 ** 3 =

7 / 2 =

17 % 3 =

Answers

Answer:

2*5 = 10

4*4= 12

7/2= 3 ½

17% 3 = 51/100 = 0.51

Answer:

2 * 5 = 10

4 ** 3 = 64

7 / 2 = 3.5

17 % 3 = 2

Explanation:

Using python you get the following outputs

2 * 5 = 10

4 ** 3 = 64

7 / 2 = 3.5

17 % 3 = 2

You like the latest laptop, but you cannot afford it. The new laptop _____ as demand for you.

counts
does not count

Answers

You like the latest laptop, but you cannot afford it. The new laptop does not count as a demand for you.

What are demand and affordability?

Demand is what we want, and affordability is the amount of money you have to buy the things that you want.

Although you want the most recent laptop, you cannot afford it. Demand for you does not include the new laptop. Demand is important to you up until the point when you have the money to buy the laptop and the need exists.

Therefore, although you want the most recent laptop, you cannot afford it. You do not count the new laptop as a demand.

To learn more about demand and affordability, refer to the link:

https://brainly.com/question/1349521

#SPJ1

You develop and deploy an Azure App Service web app. The web app accesses Azure SQL Database data that is secured with an Azure Active Directory (Azure AD) conditional access policy. The applied policy controls access based on the network location of the user.

You need to update the web app code to respond to conditional access challenges.

What should you use?

Select only one answer.

the claims Azure AD response parameter

the realm Azure AD response parameter

the authorization_uri Azure AD response parameter

the error Azure AD response parameter

Answers

You should use the authorization_uri Azure AD response parameter.

When a conditional access policy is applied, the web app will receive a 401 Unauthorized response from Azure AD. The authorization_uri parameter in the response will contain the URL that the web app should redirect the user to in order to complete the conditional access challenge.

The claims, realm, and error parameters are also included in the response but they are not used for handling conditional access challenges.

Express the words in excel formula
The sum of sixty five plus one thousand fifty multiplied by three.

Answers

In Excel formula The sum of sixty five plus one thousand fifty multiplied by three. = (65 + 1050) * 3.

What is Excel formula?

Excel formulas are equations used to perform calculations on data entered into an Excel worksheet. They can be used to perform a variety of tasks, such as calculating the sum of a range of cells, calculating the average of a range of cells, counting the number of cells in a range that contain a specific value, and much more. Formulas can also be used to manipulate text strings, look up values in external databases, and perform conditional logic such as IF/THEN statements. Excel formulas are written using special syntax and can be combined with functions to perform more complex calculations.

To learn more about Excel formula
https://brainly.com/question/27927845
#SPJ1

What additional uses of technology can you see in the workplace?

Answers

The additional use of technology that can be seen in the workplace are:

CommunicationAnalysisCustomer Solutions.

Hows do Technology help in the workplace?

Technology in the workplace helps speed up the process of problem-solving. It also helps to ensure that problems are solved in the first place.

A digital workplace is essentially a network of connected office technology that work together to create one great, collaborative experience for employees online. Technology in the workplace has significantly advanced during the last decade. It has evolved into a crucial component of running a firm in every sector.

Learn more about technology:
https://brainly.com/question/15059972
#SPJ1

What does the acronym SMART stand for

Answers

Specific, Measurable, Achievable, Relevant, Time-bound

Use the drop-down menus to complete the steps for creating a conditional formatting rule.
1. Select the object.
2. On the Form Tools
tab, click the Control Formatting group, and then click Conditional Formatting.
V.
3. In the dialog box, click
4. Select a rule type, edit the rule description, and set the formatting to apply to values that meet the criteria.
5. Click OK, and then click OK again.

Answers

Note that the complete steps for creating a conditional formatting rule are:

Use the drop-down menus to complete the conditional formatting rule steps.

1. Select the object.

2. On the Form Tools tab, click the Control Formatting group, and then click Conditional Formatting.

3. In the dialog box, click ADD

4. Select a rule type, edit the rule description, and set the formatting to apply to values that meet the criteria.

5. Click OK, and then click OK again.

What is Conditional Formatting?

Conditional formatting makes it simple to highlight certain values or identify specific cells. Based on a condition, this alters the look of a cell range (or criteria). Conditional formatting can be used to highlight cells that contain values that fulfill a specific requirement.

Conditional formatting is used to alter the look of cells in a range based on the conditions you specify. The criteria are rules that are based on numerical numbers or matching language.

Learn more about Conditional Formatting:
https://brainly.com/question/16014701
#SPJ1

Good credit equals power.which statement best illustrates that power?

Answers

Good credit is the key to power sentence for instance. Which phrase most accurately represents that skill? Your credit score has an impact on your spending habits and employment prospects.

What exactly is a sentence, for instance?

A phrase is created by grouping several words to represent a single notion. A phrase, which is the basic unit of language, elucidates a whole idea. It does this by following the fundamental grammatical rules of the syntax. Describe Ali as walking, for example. A phrase, which is the basic unit of language, elucidates a whole idea. It does this by following the fundamental grammatical rules of the syntax. For instance, describe Ali as walking.

Know more employment Visit:

https://brainly.com/question/1361941

#SPJ1

Assume the declarations of Exercises 10 and 13. Write C++ statements that do the following. (2, 3, 6, 7, 8) Submit your answer to dropbox.

a. Store the following information in newEmployee:



b. In the array employees, initialize each performanceRating to 0.

c. Copy the information of the 20th component of the array employees into newEmployee.

d. Update the salary of the 50th employee in the array employees by adding 5735.87 to its previous value.

Answers

a. newEmployee.name = "Jane Doe";

newEmployee.title = "Accountant";

newEmployee.salary = 4500.75;

b. for (int i = 0; i < maxEmployees; i++)

   employees[i].performanceRating = 0;

c. newEmployee = employees[19];

d. employees[49].salary += 5735.87;

What is array ?

An array is a data structure that stores a collection of items of the same type. Each item in an array is identified by an index number. Arrays are commonly used in programming for storing lists of related items, such as the contents of a shopping cart or the results of a database query. Arrays in Python are powerful data structures that can store and manipulate large amounts of data with relative ease.

To know more about array
https://brainly.com/question/13107940
#SPJ1

Can't figure out the error in this code:

Answers

Using the knowledge of computational language in JAVA it is possible to write a code that he place in the coordinate hits the other player's ship, I will send a message saying this to the screen.

The correct code is:

public static int numRows = 10;

public static int numCols = 10;

public static int playerShips;

public static int computerShips;

public static String[][] grid = new String[numRows][numCols];

public static int[][] missedGuesses = new int[numRows][numCols];

public static void main(String[] args) {

   System.out.println("Welcome to Amiral Batti game");

   System.out.println("\nComputer: ");

   deployComputerShips();

   System.out.println("\n");

   System.out.println("\nHuman: ");

   deployPlayerShips();

   do {

       Battle();

   }

   while(players.playerShips != 0 && players.computerShips != 0);

   gameOver();

}

public static int FIELD_SIZE = 10;

public static void deployPlayerShips() {

   Random random = new Random();

   int[][] field = new int[FIELD_SIZE][FIELD_SIZE];

   for (int i = 5; i > 0; i--) {

       int x = random.nextInt(field.length);

       int y = random.nextInt(field.length);

       boolean vertical = random.nextBoolean();

       if (vertical) {

           if (y + i > FIELD_SIZE) {

               y -= i;

           }

       } else if (x + i > FIELD_SIZE) {

           x -= i;

       }

       boolean isFree = true;

       if (vertical) {

           for (int m = y; m < y + i; m++) {

               if (field[m][x] != 0) {

                   isFree = false;

                   break;

               }

           }

       } else {

           for (int n = x; n < x + i; n++) {

               if (field[y][n] != 0) {

                   isFree = false;

                   break;

               }

           }

       }

       if (!isFree) {

           i++;

           continue;

       }

       if (vertical) {

           for (int m = Math.max(0, x - 1); m < Math.min(FIELD_SIZE, x + 2); m++) {

               for (int n = Math.max(0, y - 1); n < Math.min(FIELD_SIZE, y + i + 1); n++) {

                   field[n][m] = 9;

               }

           }

       } else {

           for (int m = Math.max(0, y - 1); m < Math.min(FIELD_SIZE, y + 2); m++) {

               for (int n = Math.max(0, x - 1); n < Math.min(FIELD_SIZE, x + i + 1); n++) {

                   field[m][n] = 9;

               }

           }

       }

       for (int j = 0; j < i; j++) {

           field[y][x] = i;

           if (vertical) {

               y++;

           } else {

               x++;

           }

       }

   }

   System.out.print(" ");

   System.out.println("0 1 2 3 4 5 6 7 8 9");

   char[][] map = new char[FIELD_SIZE][FIELD_SIZE];

   for (int i = 0; i < FIELD_SIZE; i++) {

       for (int j = 0; j < FIELD_SIZE; j++) {

           map[i][j] = field[i][j] == 0 || field[i][j] == 9 ? '.' : 'o';

       }

   }

   Arrays.stream(map)

           .forEach(m -> System.out.println(Arrays.toString(m).replace(",", "")));

}

public static void deployComputerShips() {

   Random random = new Random();

   int[][] field = new int[FIELD_SIZE][FIELD_SIZE];

   for (int i = 5; i > 0; i--) {

       int x = random.nextInt(field.length);

       int y = random.nextInt(field.length);

       boolean vertical = random.nextBoolean();

       if (vertical) {

           if (y + i > FIELD_SIZE) {

               y -= i;

           }

       } else if (x + i > FIELD_SIZE) {

           x -= i;

       }

       boolean isFree = true;

       if (vertical) {

           for (int m = y; m < y + i; m++) {

               if (field[m][x] != 0) {

                   isFree = false;

                   break;

               }

           }

       } else {

           for (int n = x; n < x + i; n++) {

               if (field[y][n] != 0) {

                   isFree = false;

                   break;

               }

           }

       }

       if (!isFree) {

           i++;

           continue;

       }

   Arrays.stream(map)

           .forEach(m -> System.out.println(Arrays.toString(m).replace(",", "")));

}

public static void Battle(){

   playerTurn();

   computerTurn();

   printBoard();

   System.out.println();

   System.out.println("Your ships: " + players.playerShips + " | Computer ships: " + players.computerShips);

   System.out.println();

}

public static void playerTurn(){

   Scanner scn = new Scanner(System.in);

   System.out.println("\nHuman's turn: ");

   int x = -1, y = -1;

   do {

       Scanner input = new Scanner(System.in);

       System.out.print("Enter row number: ");

       x = scn.nextInt();

       System.out.print("Enter column number: ");

       y = scn.nextInt();

       if ((x >= 0 && x < numRows) && (y >= 0 && y < numCols)){

           if (grid[x][y].equals("o")){

               System.out.println("You sunk the ship!");

               grid[x][y] = "s";

               --players.computerShips;

           }

           else if (grid[x][y].equals(".")) {

               System.out.println("You missed");

               grid[x][y] = "x";

           }

       }

       else if ((x < 0 || x >= numRows) || (y < 0 || y >= numCols))

           System.out.println("You can't place ships outside the " + numRows + " by " + numCols + " grid");

   }

   while((x < 0 || x >= numRows) || (y < 0 || y >= numCols));

}

public static void computerTurn(){

   System.out.println("\nComputer's turn: ");

   int x = -1, y = -1;

   do {

       x = (int)(Math.random()*10);

       y = (int)(Math.random()*10);

       System.out.println("Enter row number: "+x);

       System.out.println("Enter column number: "+y);

See more about JAVA at brainly.com/question/29897053

#SPJ1

what is one commonality among all consumer services jobs

Answers

One commonality among all consumer services jobs is that they involve interacting with customers or clients in some way and providing them with assistance or support. This can include answering questions, addressing complaints, and helping customers navigate a product or service.

Indemnify the correct solution to the problem8x2/3
8 2/3 5 2/3. 5 1/3. 3 1/5

Answers

The answer is 51/3 because you have to multiply 8 like a fraction (8/1*2/3). Then, you have simply 16/3 =5 1/3

What is the difference between an expression and a statement in Python? Explain
your answer

Answers

Answer:

Explanation:

Operators and Expressions in Python

Most lines of code are expressions. For example: 1 + 2 is an expression. The expression has 2 parts:

The (+) operator is a functional represented as symbols (for example, + ==) or reserved words (for example, and not).

Operands (1 and 2) are the data to be operated on.

An expression in Python consists of an operator and operands.

An expression in Python consists of an operator and operands.

After the Python interpreter evaluates the expression, we can, as in the example above, assign the result to the sum variable. Or, for example, immediately display the result on the screen:

>>> print(1 + 2)

3

Comparison Operators

Consider a simple example - 1 + 2 == 3.

To test the truth of a given condition, a boolean type is used. When we execute this expression, the result will be True (true) or False (false).

>>> 1 + 2 == 3

True

write the pros and the cons of AI​

Answers

AI can increase efficiency and accuracy in decision making.

What is AI?

AI (Artificial Intelligence) is the simulation of human intelligence processes by machines, especially computer systems. These processes include learning (the acquisition of information and rules for using the information), reasoning (using the rules to reach approximate or definite conclusions) and self-correction.

Pros:1.AI can increase efficiency and accuracy in decision making.
2.It can reduce human error and increase safety.
3.AI can help automate mundane and repetitive tasks.
4.AI can help with predictive analytics, helping businesses to anticipate customer needs and demands.
5.AI can be used to better understand customer behavior, allowing businesses to provide better service.

Cons: 1.AI can result in job loss due to automation.
2.AI systems are susceptible to bias and manipulation.
3.AI can cause privacy concerns due to its ability to collect and store large amounts of data.
4.AI can be expensive to implement and maintain.
5.AI can be difficult to test and validate.

To learn more about AI
https://brainly.com/question/25523571
#SPJ1

Ken is creating a website with different web pages, each page with its own theme, color, fonts, and so on. His teammate, John, advises him to
maintain the same elements on every page. What is the importance of maintaining consistency between pages?
Consistency helps to make navigation easy. It also helps in structuring each web page. It allows users to understand where they are in a website.
makes it easier for users to locate new navigational elements. It ensures that users only have to learn to use an interface once.

Answers

It also helps build a recognizable brand identity and creates a sense of trust between the website and its visitors. Consistency helps to make a website look professional. It helps the website stand out from competitors and gives it a unique look and feel.

What is website?

A website is a collection of related webpages and other content, such as text, images, videos, and audio files, typically identified with a common domain name, and published on at least one web server. Websites are accessed via a network, such as the Internet or a local area network, and viewed in an Internet browser. Websites are created using HTML coding. Websites can provide a variety of information and services, including online forums, shopping, news, and entertainment. They can also be used to conduct business activities, such as online banking, ordering products, and researching products and services. Websites are often maintained by individuals and organizations to provide information on topics of interest, to advertise products and services, and to offer customer service.


To learn more about website
https://brainly.com/question/28431103
#SPJ1

Alicia is a network administrator and is setting up her company's network. Which of the following should she use to display the ethernet interfaces within Linux?

Answers

Alicia should use the following command to display the ethernet interfaces within Linux:

root at the rate kali2:-#config.

What do you mean by Ethernet interface?

An Ethernet interface may be defined as a type of interface that involves a circuit board or card installed in a personal computer or workstation, as a network client.

A networking interface allows a computer or mobile device to connect to a local area network (LAN) using Ethernet as the transmission mechanism.

A network interface is the point of interconnection between a computer and a private or public network. A network interface is generally a network interface card (NIC) but does not have to have a physical form. Instead, the network interface can be implemented in software.

Therefore, the command that Alicia is used to displaying the ethernet interfaces within Linux is mentioned above.

To learn more about Ethernet interface, refer to the link;

https://brainly.com/question/28930681

#SPJ1

The CNT Books network described in Case Project 8-1 is expanding. There are 200 more user stations in the building, and a total of five floors are in use by the network. You have kept up with the design so far with a network of five subnets, each with its own router. The company leased a building across the street. You expect at least four subnets to be added to the design. The owner is concerned about how to connect to the building across the street, as he thinks the cost of contracting with a communications provider is too expensive for such a short distance. What solution can you suggest for connecting the building across the street with the existing building

Answers

Computers won't connect to the internet, which is most likely what layers are worried about. You will then realise, after more study, that the patch cable is not correctly terminated.

What is networking?

Computer networking is the term for a network of connected computers that may communicate and share resources.

On the local LAN, a computer can access resources, but not on a different subnet. You discover that the default gateway on the machine is incorrectly configured.

You cannot converse via FTP, but you can ping the machine you are using to transfer files to.

Knowing that they can employ fewer IP addresses than the entire number of their clients, dynamic addresses are well-liked by ISPs.

For each customer who is active at any given time, they only require the address.

Globally routable IP addresses are expensive, and certain businesses that focus on providing addresses are particularly rigorous about how IP addresses should be used by ISPs.

Thus, these can be the solution one can suggest for connecting the building across the street with the existing building.

For more details regarding networking, visit:

https://brainly.com/question/29350844

#SPJ1

Draw the resulting image

Answers

Explanation:

I cannot draw here, but I can tell you, which cells are getting marked black :

1. all cells, where row number = column number.

e.g. (0, 0), (1, 1), (2, 2) ... (8, 8)

2. all cells, where (row number + column number) = 8

e.g. (0, 8), (8, 0), (1, 7), (7, 1) ... (4, 4)

in other words, it makes a giant X through the grid, from (0, 0) to (8, 8), and from (0, 8) to (8, 0) with the central intersection point at (4, 4).

which of the following protocols would secure a tunnel for credential exchange using port 636.
A. FTPES
B. SFTP
C. LDAPS
D. DNSSEC

Answers

The protocols would secure a tunnel for credential exchange using port 636 is LDAPS. The correct option is C.

What is LDAPS?

In order to secure LDAP connections across the network, the Lightweight Directory Access Protocol Secure (LDAPS) protocol is known to employ a PKI certificate and frequently uses TCP port 636.

TCP 3269 is used for LDAPS connection with a global catalog server. SSL/TLS is negotiated when connecting to ports 636 or 3269 before any LDAP traffic is transmitted.

Therefore, the correct option is C. LDAPS protocols would protect a tunnel for the exchange of credentials utilizing port 636.

To learn more about LDAPS, refer to the link:

https://brainly.com/question/17119741

#SPJ1

Sandra bought a house 20 years ago for $200,000, paid local property taxes for 20 years and just sold it for $350,00. Which is true

Answers

Profit from selling buildings held one year or less is taxed as ordinary income at your regular tax rate.

What is Tax rate?To help build and maintain the infrastructure, the government commonly taxes its residents. The tax collected is used for the betterment of the nation, society, and all living in it. In the U.S. and many other countries around the world, a tax rate is applied to money received by a taxpayer.Whether earned from wages or salary, investment income like dividends and interest, capital gains from investments, or profits made from goods or services, a percentage of the taxpayer’s earnings or money is taken and remitted to the government.When it comes to income tax, the tax rate is the percentage of an individual's taxable income or a corporation's earnings that is owed to state, federal, and, in some cases, municipal governments. In certain municipalities, city or regional income taxes are also imposed.

To learn more about taxable income refer to:

https://brainly.com/question/1160723

#SPJ1

Answer:

B.  She will owe capital gains taxes on the sale earnings.

Explanation:

In a series circuit, if there is more than one resistance in the circuit, those resistances are connected one after the other; thus, the resistances add up.

Answers

A series circuit's overall resistance rises as the number of resistors in the circuit grows, but the circuit's current falls off.

What occurs when additional resistance is introduced to a series circuit?A series circuit's overall resistance rises as the number of resistors in the circuit grows, but the circuit's current falls off.When an identical amount of current passes through each resistor, two or more resistors are said to be linked in series. Different voltages are present across the resistors in these circuits. If one resistor breaks or there is a failure in a series connection, the circuit as a whole is shut off.When an identical amount of current passes through each resistor, two or more resistors are said to be linked in series. Different voltages are present across the resistors in these circuits.A series circuit's overall resistance rises as the number of resistors in the circuit grows, but the circuit's current falls off.        

To learn more about series circuit's refer to:

https://brainly.com/question/19865219

#SPJ1

On the planet Mongo, each year has 15 months and each month has 26 days.

Write a function
$$\verb#compute_mongo_age(birthYear, birthMonth, birthDay, currentYear, currentMonth, currentDay)#$$that residents of Mongo can use to compute their age. It should take 6 positive integers as input: the person's birthdate (year, month from 1 to 15, and day from 1 to 26) and the current date (year, month from 1 to 15, and day from 1 to 26), and return a float of the age of the person in years.

For example, $\verb#print(compute_mongo_age(2879,8,11,2892,2,21))#$ should print $\verb#12.6256410256#$, the age (in Mongo years) on the 21st day of the 2nd month of the year 2892, of a person who was born on the 11th day of the 8th month of the year 2879.

Reminder: your assignment will be graded on the following:
The text box or code describes your planning, such as pseudocode of your algorithm or programming decisions like what datatypes to use.
The code runs without error and solves the specified problem.
The text box explains how the code was tested, such as the test cases used or your debugging process.
Clarity of the code, including inline comments and descriptive variable names.

Answers

The code is given below

from datetime import datetime

def compute_mongo_age(birthYear, birthMonth, birthDay, currentYear, currentMonth, currentDay):

   """

   This function calculates the age of a person in Mongo years.

   It takes 6 positive integers as input: the person's birthdate (year, month from 1 to 15, and day from 1 to 26)

   and the current date (year, month from 1 to 15, and day from 1 to 26),

   and returns a float of the age of the person in years.

   """

   # Convert the input integers to datetime objects

   birthdate = datetime(birthYear, birthMonth, birthDay)

   current_date = datetime(currentYear, currentMonth, currentDay)

   

   # Calculate the difference between the birthdate and current date

   age_in_days = (current_date - birthdate).days

   

   # Mongo year has 365.24 days

   age_in_mongo_years = age_in_days / 365.24

   

   return age_in_mongo_years

# Test the function

print(compute_mongo_age(2879,8,11,2892,2,21)) # Expected output: 12.6256410256

What is the code about?

The code imports the datetime module to convert the input integers to datetime objects.

The function takes 6 integers as input: the person's birthdate (year, month, and day) and the current date (year, month, and day).The function converts the birthdate and current date integers to datetime objects using the datetime() function.Then, it calculates the difference between the birthdate and current date in days using the timedelta object.Next, it calculates the age in Mongo years by dividing the age in days by 365.24 (the number of days in a Mongo year)Finally, the function returns the age in Mongo years as a float.

Test:

I have test the function with one test case, It will print the age (in Mongo years) on the 21st day of the 2nd month of the year 2892, of a person who was born on the 11th day of the 8th month of the year 2879.The output will be 12.6256410256, which is the expected output.

Learn more about  coding  from

https://brainly.com/question/22654163

#SPJ1

Hi!
i want to ask how to create this matrix A=[-4 2 1;2 -4 1;1 2 -4] using only eye ones and zeros .Thanks in advance!!

Answers

The matrix A=[-4 2 1;2 -4 1;1 2 -4] can be created by using the following code in Matlab/Octave:

A = -4*eye(3) + 2*(eye(3,3) - eye(3)) + (eye(3,3) - 2*eye(3))

Here, eye(3) creates an identity matrix of size 3x3 with ones on the diagonal and zeros elsewhere.

eye(3,3) - eye(3) creates a matrix of size 3x3 with ones on the off-diagonal and zeros on the diagonal.

eye(3,3) - 2*eye(3) creates a matrix of size 3x3 with -1 on the off-diagonal and zeros on the diagonal.

The code above uses the properties of the identity matrix and the properties of matrix addition and scalar multiplication to create the desired matrix A.

You can also create the matrix A by using following code:

A = [-4 2 1; 2 -4 1; 1 2 -4]

It is not necessary to create the matrix A using only ones and zeroes but this is one of the way to create this matrix.

Questions and Answers the OJT and answer the following:
Please do not copy search and your idea.

1. TELL ME ABOUT YOURSELF.

2. WHAT IS YOUR GREATEST STRENGTH?

3.) WHAT IS YOUR GREATEST WEAKNESS?

4.) HOW MANY HOURS DO YOU NORMALLY WORK PER WEEK?

5.) WHAT IS YOUR AMBITION?

6.) WHAT ARE YOUR SALARY EXPECTATIONS?

7.) WHEN WAS THE LAST TIME YOU WERE ANGRY? WHAT HAPPENED?

8.) WHY DO YOU WANT THIS JOB?

9.) TELL ME ABOUT A TIME YOU MADE A MISTAKE?

10.) ARE YOU WILLING TO RELOCATE OR TRANSFER TO OTHER PLACE FOR WORK?

11.) WHY WE SHOULD HIRE YOU?

Answers

These are YOUR personal info. Imagine, you’re on a date and your date asked you these questions, What would you say? You have to respond since these are kinda similar questions you’d ask your date otherwise she will leave right there.
No one can answer this question because you are the only one who can answer this, these questions are about you

. You are an electrician on the job. It is decided that the speed of a large DC motor is to be reduced by connecting a resistor in series with its armature. The DC voltage applied to the motor is 250 V, and the motor has a full-load armature current of 50 A. Your job is to reduce the armature current to 40 A at full load by connecting the resistor in series with the armature. What value of resistance should be used, and what is the power rating of the resistor?

Answers

Answer:

The value of resistance that should be used is 12.5 ohms. The power rating of the resistor should be 2,500 watts.

Explanation:

Which type of data is used to form images in MakeCode Arcade?

O A. Variable data
OB. Boolean data
C. String data
OD. Array data

Answers

Answer:

string data i think

Explanation:

Which two statements accurately describe interactions among layers of
hardware?
A. Printers receive data from a few transistors to deliver to the logic
gates.
B. Headphones and speakers are connected to a computing device
and deliver data processed by the device's CPU.
C. The motherboard moves all data from memory to transistors
before it is displayed on a monitor.
D. Monitors use data processed by the CPU and GPU to deliver data.

Answers

The two statements describe interactions among layers of hardware :

The motherboard moves all data from memory to transistorsbefore it is displayed on a monitor.Monitors use data processed by the CPU and GPU to deliver data.

What is hardware?The physical components of a computer, such as its chassis, CPU, RAM, monitor, mouse, keyboard, computer data storage, graphics card, sound card, speakers, and motherboard, are referred to as computer hardware. Software, on the other hand, is a collection of instructions that may be stored and executed by hardware.Hardware describes the physical parts of the computer or its delivery mechanisms for the software's written instructions to be stored and executed. The device's intangible component, the software, enables the user to communicate with the hardware and give commands for particular actions to be taken.The physical components of the computer known as hardware are what actually process data. Software is a collection of directives that specify to a machine what to perform. 2. Construction. It's fabricated.

Learn more about hardware refer to :

https://brainly.com/question/24370161

#SPJ1

Other Questions
CEPEDA CORPORATION Income Statement (Partial) choose the accounting period select an income statement item $enter a dollar amount 88900 select an opening name for section two select an income statement item $enter a dollar amount 5460 select an income statement item enter a dollar amount 77770 select an income statement item enter a subtotal of the two previous amounts 83230 select between addition and deduction: select an income statement item enter a dollar amount (7860) select a closing name for section two enter a subtotal of the two previous amounts 75370 select a closing name for this statement $enter a total net income or loss amount 13530 What is the measurement of angle y?? Henry has worked for a factor for 31 years and will be retiring. He earned salaries over the past 4 years of $38433, $37776, $39125, and $38782. His employer calculates pension by finding the average of his last 4 years salaries and will give him 1. 9% of that average for each year he worked. Calculate his pension Animal Name : ___________________________Draw organism below:List and describe three characteristics:1)2)3) In a physics lab experiment, a spring clamped to the table shoots a 19 g ball horizontally. When the spring is compressed 20 cm, the ball travels horizontally 5.2 m and lands on the floor 1.6 m below the point at which it left the spring. What is the spring constant? The work done in lifting a forty-pound crate three feet is ? 1. one hundred twenty foot-pounds2. thirteen foot-pounds3.thirty-seven foot-pounds4.forty-three foot-pounds A bedroom door in the house has the same dimensions length and all at the front door. The length is 30 in rather than 63 how much is the value of the front doors in the bedroom door sunny is interested in a career that involves designing systems, managing employees, and planning security for an organization. what career would be a good fit for sunny? (5 points) cybersecurity engineer security analyst cybersecurity consultant security architect a corporation must write that set out the purpose of the business and how it is to be governed. multiple choice question. an indenture agreement articles of incorporation a partnership agreement a legal will rank the magnitude of each objects acceleration from greatest to least. disregard the direction of the accelerations. What factors influence the opportunity cost of decisions? DIRECTIONS: The following passages have a similar topic but different diction, tone andpurpose. Read the passages, and then complete the chart.Passage 1: Those with an epicurean bent need not trouble themselves with Central Grillon Main Street. Despite the cackling of fawning food critics, the offerings at thiscramped, noisy eatery are, in fact, uninspired, and the service is lamentable. Blaring,ear-shattering rock music and inattentive servers greet you, and when your inexpertlyprepared, lukewarm, bland meal arrives after what seems an interminable wait, you findyourself wondering why you bothered. Avoid Central Grill, or visit at your own peril.Passage 2: Central Grill on Main Street is awesome! When you go in, cool music isplaying, and the vibe is perfect. The servers are totally chill, and you have plenty of timeto check out the menu, talk with friends, and listen to the music before your food comesout. And let me say, it is super-yummy. Foodies take note: You'll be snapping andposting lots of pics. Your friends will be super-jealous. Definitely check this place out!. Topic of the passages:What is the diction of eachpassage?List three words or phrasesfrom the passage thatcontribute to the diction ineach one.one.What is the tone of eachpassage?List three words or phrasesfrom the passage thatcontribute to the tone in eachWhat is the purpose of eachpassage?Passage 1Passage 2 A pizzeria sells three sizes of pizza: small, medium, and large. The pizzas sell for $6, $9, and $10, respectively. One evening they sold 37 pizzas and received $321. If they sold 9 more large than medium pizzas, how many of each size did they sell?Use the Gaussian elimination method with back substitution to solve the given word problem. What rhythm pattern is mostly used by poets? Who is God's third child? Aurora is planning to participate in an event at her school's field day that requires her to complete tasks at various stations in the fastest time possible. To prepare for the event, she is practicing and keeping track of her time to complete each station.The x-coordinate is the station number, and the y-coordinate is the time in minutes since the start of the race that she completed the task.(1, 2), (2, 4), (3, 8), (4, 16)Part A: Is this data modeling a linear function or an exponential function? Explain your answer.Part B: Write a function to represent the data. Show your work. Part C: Determine the average rate of change between station 2 and station 4. Show your work. Five (5) years ago, when the relevant cost index was 120, a nuclear centrifuge cost $40,000. The centrifuge had a capacity of separating 1500 gallons of ionized solution per hour. Today, it is desired to build a nuclear centrifuge with the capacity of 4500 gallons per hour, but the cost index is now 300. Assuming a power-sizing exponent (x) of 0. 75, estimate the approximate cost of the new reactor today. Choose the closest value which graph represents the solutions to this system of inequalities? x=5y10 Why is the sun's gold complexion dimmed often Sonnet 18? This table displays information about position and time. What was the average speed of the baseball from the time it left the pitcher's hand to the time it was 7. 2 m from the pitcher's hand?.