Given a type Money that is a structured type with two int fields, dollars and cents. Assume that an array named monthlySales with 12 elements, each of type Money has been declared and initialized. Assume that a Money variable yearlySales has also been declared. Write the necessary code that traverses the monthlySales array and adds it all up and stores the resulting total in yearlySales. Be sure make sure that yearlySales ends up with a valid value, i.e. a value of cents that is less than 100.

Answers

Answer 1

Answer:

Attached below is the code

Explanation:

using namespace std;

struct Money

{

int dollars;

int cents;

};

int main()

{

struct Money monthlySales[12];

struct Money yearlySales = { 0,0};

for(inti=0; i<12; i++)

{

monthlySales[i].dollars = 0.0;

monthlySales[i].cents = 0.0;

}

for(int i=0; i<12; i++)

{

yearlySales.dollars = yearlySales.dollars + monthlySales[i].dollars;

yearlySales.cents = yearlySales.cents +monthlySales[i].cents;

}

return 0;

}


Related Questions

Write a program that will add the content of two counters every 45 seconds and place the result in an integer register.

Answers

Answer:

Explanation:

The following code is written in Java and runs a thread every 45 seconds that adds the two counters together and saves them in an integer variable called register. Then prints the variable. If this code runs 5 times it automatically breaks the loop. This can be changed or removed by removing the breakLoopCounter variable.

 public static void add_Counters(int counterOne, int counterTwo) {

       int register = 0;

       int breakLoopCounter = 0;

       try {

           while (true) {

               register += counterOne + counterTwo;

               System.out.println(register);

               Thread.sleep(45000);

               breakLoopCounter += 1;

               if (breakLoopCounter == 5) {

                   break;

               }

           }

       } catch (InterruptedException e) {

           e.printStackTrace();

       }

   }

Display all the lines in unixPasswd that contain at least 10 consecutive lowercase letters. How many names are there in total that meets this criteria?

Answers

Answer and Explanation:

To display 10 consecutive lower case letters in Unix, we make use of the commands below. The first command finds the letters in the file and the second command counts them line by line.

$ grep '[a-z]\{10,\}' /unixPasswd/passwd

# this command displays lines with at least 10 consecutive lowercase letters or more than 10 consecutive lowercase letters

$ grep '[a-z]\{10,\}' /unixPasswd/passwd | wc -l

# this command counts the number of lines that has at least 10 consecutive lower case letters or more than 10 consecutive lowercase letters

Note: the unixPasswd is a file in passwd file. The # is used when we want to add comments, is optional here. The $ is a prompt on the terminal that begins a new command.

Start making better decisions with the world's leading survey platform. Already have an account? Log in for faster support.

Answers

Answer: ummmm is that a question?!?

Explanation:

Answer:

Mark brainliest please

plsss help me
give two examples of problems that can occur when sytems do not work properly​

Answers

Answer:

Explanation:

1. There can be a run out of something ex. The water cycle we could run out of water if evaporation stops happening

2. Something wont happen ex. In a shoe factory if no one is boxing the shoes the shoes don’t get boxed.

Hope this helps

Iman manages a database for a website that reviews movies. If a new movie is going to be added to the database what else will need to be added.

Answers

Answer:

The answer would be a record.

Explanation: Took the test

Ms office suite comes with its own set of pictures in the​

Answers

Answer:

clipart ...........................

Explanation:

clipart is the correct answer for the above question.

Write a complete program that reads a string and displays the vowels. The vowels are A, E, I, O, U and a, e, i, o, u. Here are three sample runs:Sample Run 1Enter a string: Welcome to PythonThe vowels are eoeooSample Run 2Enter a string: Student UnionThe vowels are ueUioSample Run 3Enter a string: AREIOUaeiouRTEThe vowels are AEIOUaeiouENote: your program must match the sample run exactly.using python

Answers

text = input("Enter a string: ")

new_text = ""

vowels = "aeiou"

for x in text:

   if x.lower() in vowels:

       new_text += x

print(new_text)

I hope this helps!

(Printing Numbers in Various Field Widths) Write a program to test the results of printing the integer value 12345 and the floating-point value 1.2345 in various size fields. What happens when the values are printed in fields containing fewer digits than the values?

Answers

Answer:

sorry I didn't understand the question

differences between formula and function as used in spreadsheet​

Answers

I hope it is helpful for you ...

When we code an algorithm, we need to provide the commands in the order we want the
computer to carry them out.

Answers

Answer:

true                                                  q     it says it needs 20 characters so here you go

A ____________ monitor measures the usage of a cloud-based IT resource by a given cloud consumer for billing purposes.

Answers

Answer:

pay-per-use monitor

Explanation:

The pay-per-use monitor mechanism can be described as a measurement of cloud-based IT resource usage which are in line with already defined pricing parameters and which can generate usage logs which are used for the calculations of accumulated fees calculations and are also used for billing purposes. This service uses models that are subscription based and also consumption based.

100 points and brainlist....................................................................................................................................................................................................................... It Takes a Village! In every business, it takes more than one person to create success - whether you are talking about a berry farm, a historic theater, a popular amusement park, or an expanding coffee chain. While you watch the videos, notice how many different people work together to support and sustain these operations. Cogdell Berry Farm Fox Theatre Six Flags Jittery Joes Now, let's put it all together by creating a presentation entitled "It Takes a Village." Your presentation could either be a word document, a digital mind map, or a slideshow, but it must include a chart and research paragraph for each company. In your presentation, you should create a visual chart or slideshow featuring each company and highlighting at least two different jobs that are needed to keep each company running. Make it clear that each company is comprised of many different positions and discuss how people with different skills and interests work together to contribute to a successful enterprise. Finally, pick out one career from each video and do some additional research on it. Let's consult our handy reference, the Bureau of Labor Statistics' Occupational Outlook Handbook once again to find more information. This time check out the headings 'How to Become One,' 'Pay,' and 'Job Outlook' for each career you choose. Your presentation should include the following content: A chart/slideshow that describes each of the four companies with at least two jobs discussed in each company. In depth research on one job per company, including: How to Become One Pay Job Outlook However you choose to arrange your presentation, make sure to show clearly that the companies you learned about rely on more than one position to keep things running smoothly.

Answers

Answer:  what do i need to do Im confused I will edit my answer to answer correctly to help you Have a Nice day and that was a very nice trick

Explanation:

Answer:

give them brainliest :)

Explanation:

what's a website layout

Answers

Answer:

Explanation:

A website layout is a pattern (or framework) that defines a website's structure. It has the role of structuring the information present on a site both for the website's owner and for users. It provides clear paths for navigation within webpages and puts the most important elements of a website front and center.

Effective home page layout is all about making your website easy to use and navigate. It allows you to steer your visitors' focus to things you want them to pay extra attention to. Let's get started on what to include in an effective home page, and we'll dive into some specific examples and layouts!

What is the function of the operating system of a computer?

It allows the CPU to communicate with input and output devices.
It executes commands from other computer hardware.
It lets the user communicate with the mouse.
It processes information from the hard drive to allow programs to run.

Answers

Answer:

It allows the CPU to communicate with input and output devices.

Explanation:

Plzzzzzzzzzzzzz give me brainiest

the term technology is derived from the Chinese word. it is true or false​

Answers

Answer:

True

Explanation:

it's your perfect answers

Yes it is true
Its true

An inkjet printer’s output appears to have missing elements. What is the first thing a technician should try if the ink cartridge appears to be full?

Answers

Answer:

Check the printing properties or print test page.

Explanation:

In a situation whereby an inkjet printer’s output appears to have missing elements. The first thing a technician should try if the ink cartridge appears to be full to "Check the printing properties."

This helps to serve as a maintenance technique or solve the ink cartridge problems.

Depending on the windows or PC's Operating System. To check the printer's properties on Windows 7, a user will have to click on the “Start” button > Control panel > Devices and Printers. Followed by right-clicking the printer icon and open up “Printer Properties” and click “Print Test Page”

Memory compression is a useful alternative to paging:_______.
a. when the compression algorithm is can achieve the best possible compression ratio.
b. when the system has slow magnetic disks but not faster SSDs.
c. when the speed of the compression algorithm fastest.
d. even when the system has faster SSDs.

Answers

Answer:

d. even when the system has faster SSDs.

Explanation:

Given that Memory compression and Paging are both means of performing memory management in different ways.

However, Memory compression is a useful alternative to paging "even when the system has faster SSDs."

This is because Memory compression enhances the productivity of Radom Access Memory, RAM, which in turn increases the performance level of a computer.

Also, paging requires consistent writing on Disks, which has been found to degrade disks most especially solid-state drives, SSDs.

Please help. Will give brainliest

Answers

I don’t understand it sorry :(.

why is monitor called softcopy output device?​

Answers

Answer:

A display device is the most common form of output device it presents output visually on a computer screen.the output appears temporarily on the screen and can easily altered or erased,it is sometimes referred to as softcopy

How do I fix my mistake in the code, do not give me a bs answer like “I don’t know sorry” if you do not know just move on because I will report it like I have before.

Answers

The problem lies within your if statement. You're using a single equals sign when you should be using two.

if (operation == 1)

Two equal signs is a comparison operator. It checks to see if one value equals another value. In your case, its checking if operation equals 1. But, this only solves half the problem. Operation is a string and you need to compare it to a string.

if (operation == "1")

I hope this helps!

PLS HELP I WILL MARK BRAINLIEST

Answers

Answer:

C

Explanation:

Animal cells each have a centrosome and lysosomes, whereas plant cells do not. Plant cells have a cell wall, chloroplasts and other specialized plastids, and a large central vacuole, and animal cells do not.

Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any number of integers as input, and outputs the average and max. Ex: When the input is 15 20 0 5, the output is:

Answers

In Python 3.8:

nums = list(map(int, input("Enter your numbers space separated: ").split()))

print(f"The largest number is {max(nums)} and the average of all the numbers entered is {sum(nums)/len(nums)}")

Write code that creates a text area displaying 10 rows and 15 columns. The text area should be capable of displaying scroll bars, when necessary. It should also perform word style line wrapping.

Answers

Answer:

<textarea wrap="hard" cols="30" rows="5"></textarea>

Explanation:

A textarea element or tag is a form tag element of a HTML file. It is used to ask for input value from a user in a webpage. The textarea tag has an opening and a closing tag.

The 'cols' attribute is used to set the column length while the 'rows' attribute sets the row length of the textarea element. The 'wrap' attribute has three options namely; soft, hard, and off. 'soft' adds the textarea wrapping, 'hard' sets off the box wrapping but only wraps each line, while the 'off' option removes all wrapping in the tag.

Using a third-party package of your choice, write a program that reads the contents of a csv file and saves it to an Excel file. The program should take two arguments. The name of the input file and the name of the output file.

Answers

Answer:

import pandas as pd

df = pd.read_csv("file_csv")

df.to_excel("file.xlsx", sheet_name = "name_of_sheet")

# or use: with df.ExcelWriter("file.xlsx", mode='a') as file,

#df.to_excel(file, sheet_name= "sheet name")

Explanation:

This python source code uses the pandas package to read csv (comma separated values) file and converts it to an excel file (xlsx) using the read_csv and ExcelWriter methods respectively.

Assume a large shared LLC that is tiled and distributed on the chip. Assume that the OS page size is 16KB. The entire LLC has a size of 32 MB, uses 64-byte blocks, and is 32-way set-associative. What is the maximum number of tiles such that the OS has full flexibility in placing a page in a tile of its choosing?

Answers

Answer:

19 - 22 bits ( maximum number of tiles )

Explanation:

from the given data :

There is 60 k sets ( 6 blocks offset bits , 16 index bits and 18 tag bits )Address has 13-bit page offset and 27 page number bits14-22 bits are used for page number and index bits

therefore any tour of these bits can be used to designate/assign tile number

so the maximum number of tiles such that the OS has full flexibility in placing a page in a tile of its choosing can be between 19 -22 bits

hai ima guurl andd here r the lyricss to mah favorite song
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart
Yeah
Shotgun, aimed at my heart, you got one
Tear me apart in this song
How do we call this love
I tried, to run away but your eyes
Tell me to stay oh why
Why do we call this love
It seems like we've been losing control
So bad it don't mean I'm not alone
When I say
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart
Maybe some part of you just hates me
You pick me up and play me
How do we call this love
One time tell me you need me tonight
To make it easy, you lie
And say it's all for love
It seems like we've been losing control
So bad it don't mean I'm not alone
When I say
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart
Me and my broken heart
Me and my broken
Yeah, yeah, yeah
It's just me
It's just me
It's just me
Me and my broken heart
All I need is a little love in my life
All I need is a little love in the dark
A little but I'm hoping it might kick start
Me and my broken heart
I need a little loving tonight
Hold me so I'm not falling apart
A little but I'm hoping it might kick start
Me and my broken heart

Answers

Answer:wow that’s a lot of lyrics but intersting

Explanation:

Answer:

that's a cool song

Explanation:

have a great day:)

Which of the following is a real job title on The interactive media career pathway?

Answers

Answer:

The right answer is A

Explanation:

Plzzzzzzzzzzzzz give me brainiest

The answer to your question is B

The sensitivity range for an objective function coefficient is the range of values over which the current __________________ remains the same.

Answers

Answer:

Optimal solution point

Explanation:

The sensitivity range for an objective function coefficient is the range of values over which the current optimal solution point remains the same.

Additionally, the range of optimality can be defined as the optimality range with respect to an objective coefficient that comprises of the range of values over which a current optimal solution point will always remain optimal.

Hence, the managers supervising various production lines are saddled with the responsibility of focusing on the objective function coefficient for optimal level of output or productivity.

Write the function appendEvens() which, given two arrays, adds all of the even elements from the first to the second. You may assume the second has enough space.

Answers

Answer:

function appendEvens( arr1, arr2) {

   for (let i in arr1){

       if (i%2 == 0){

           arr2.push(i);

       }

   }

}

Explanation:

The defined javascript function "appendEvens" is a function that returns undefined. It accepts two arrays and pushes the even numbers from the first array to the second.

Please solve the ones you can. Solving Both will be appreciated. thank you

Answers

Answer:a=b+c=2ca

Im not sure about this answer

Explanation:

Other Questions
What are the arguments for defunding the police? the supreme court case worcester vs georgia was a small victory for the cherrokee nation becuase why 3. Repeat this process to find the width and height of a newer 48-inch television whosescreen has an aspect ratio of 16:9.Do not include units in your answer - write only the Mumber rounded to the nearest tenthWhat is the height? HOW MANY DAY IN 1 months CAN SOMEONE HELP IM SO CUNFUSED What is the missing number?Question 4 options: Write essay (hook, intro, thesis, middle arguments and conclusion) of a Definition of a Hero. (A ESSAY and i need a essay of a definition of a hero basically a essay explaining a hero) please and thanks. Describe what influenced such profound change in artworks from Medieval to Renaissance periods. is this very Important help me here pls (Mathematics Question) PLS HELP ME?? The blue dot is what value on the number line? A rectangle has a length that is 12 ft longerthan its width. If its perimeter is 84 ft, whatare the dimensions of the rectangle? Writea system of equations representing thesituation and then find the dimensions toobtain full credit. Identify one secondary pollutant that is a component of photochemical smog and describe the following. (i) How the secondary pollutant forms (ii) ONE human health effect of the pollutant (iii) ONE environmental effect of the pollutant 54^=(54)^=(34)^= Help!Which is not a characteristic of romanticismA) power of reason B) focus on the individualC) power of the ImaginationD) nature brings wisdom and inspiration Which part of the body manufactures erythrocytes, thrombocytes, and leukocytes?The within the bones has the important function of making three kinds of blood cells. Red blood cells, called erythrocytes, carry oxygen to body tissues. Platelets, called thrombocytes, are used for clotting to stop bleeding if there is a wound in the body. White blood cells, called leukocytes, are essential in fighting disease. helpp me with these questions pls (13 points ) A scientist has 400 grams of a radioactive substance with a half-life of one year. The amount of the substance that the scientist has after t years is represented by the expression 400(0.5)t.Which kind of expression is 400(0.5)t?linearquadraticexponential growthexponential decay Evaluate and Solve for the variable-2 = y + 5 Over the interval [0, 2), what are the solutions to sin(2x) = 2cos(x)? Check all that apply, French, Plz helpAnswer the following questions in the first person using dtester, aimer, or adorer. Your answers may begin with either oui or non. 1. Est-ce que tu aimes regarder la tl? 2. Est-ce que tu aimes jouer aux jeux vidos? 3. Est-ce que tu aimes parler franais? 4. Est-ce que tu aimes danser? 5. Est-ce que tu aimes manger du chocolat?