1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yuri [45]
3 years ago
11

Given a type Money that is a structured type with two int fields, dollars and cents. Assume that an array named monthlySales wit

h 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.
Computers and Technology
1 answer:
ra1l [238]3 years ago
7 0

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;

}

You might be interested in
John typed 545 words in 35 minutes, what is his typing speed
Katarina [22]

Answer: 545 words per 35 mins

Explanation:

4 0
3 years ago
Read 2 more answers
When resizing images or objects in a presentation, why should a user not utilize the sizing handles in the middle of the sides
Shalnov [3]

When resizing an image or an object in a presentation, a user should not utilize the sizing handles in the middle of the sides or the bottom of the image. There's nothing wrong with resizing this way.

There's nothing wrong with resizing this way

<u>Explanation:</u>

When the sizing handles in the middle of the sides are used, the image stretches out reflecting an increase in the width maintaining There's nothing wrong with resizing this way.

On the other hand, while using the sizing handles at the bottom, the image increases in height whilst maintaining the same width again disturbing the aspect ratio.

5 0
3 years ago
Read 2 more answers
What tasks do data entry macros commonly perform? Check all that apply.
Paha777 [63]

Answer:

test whether a user entered a value

3 0
3 years ago
The aim of this activity is to implement an algorithm that returns the union of elements in a collection. Although working with
shusha [124]

Answer:

The function in Python is as follows:

def unite_lists(A, B):

   union = []

   for elem in A:

       if elem in B:

           union.append(elem)

   return union

Explanation:

This defines the function

def unite_lists(A, B):

This initializes an empty list for the union list

   union = []

This iterates through list A

   for elem in A:

This checks if the item in list A is in list B

       if elem in B:

If it is present, the item is appended to the union list

           union.append(elem)

This returns the union of the two lists

   return union

3 0
3 years ago
Quincy wants to use color to spark an emotional response in his audience. Which of the following deals with how colors produce e
jolli1 [7]
I believe that the answer is vibrancy
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which line of code will generate a random integer between 7 and 77?
    10·1 answer
  • Which protocol is often used to publish web pages to a web server?
    5·1 answer
  • You use an escape sequence to include ___________________ in a string.
    15·1 answer
  • Why is it uncommon for users to perform searches directly in database tables?
    15·1 answer
  • A browser is an example of a. :
    7·1 answer
  • Which type of information could be displayed using this line graph?
    12·2 answers
  • Image editors edit images consisting of thousands of pixels that form this type of image.
    13·2 answers
  • The following pieces are known as (image shown above)
    15·2 answers
  • Give an example of an occasion when you used logic to solve a problem
    7·1 answer
  • Why do you want to work for Rev?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!