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
A) Suppose a computer has an instruction pipeline with 4 phases. How many cycles (if there are no delays) would it take to compl
Reika [66]

Answer:

Explanation:

(a) Given data:

Instruction pipeline with 4 phases.

80 instruction

The number of cycles if the processor were pipelined :

80-1 = (79) instruction takes only 1 extra cycle to complete.

So, cycles counts = 4 + (79) = 83 cycles.

The number of cycles if the processor were not pipelined.  

Each instruction takes 4 cycles to complete.  

So, cycle counts = 80 * 4 = 320 cycles.

(b) One of the main problems of conditional branching in pipelines is the delay it gives even after the branch target buffer.

In pipeline, conditional branches depend on the codes which are still in estimation.

(c) Two ways to deal with problem arising due to conditional branching are as follows :

1. Delayed Branching    

2. Multiple Condition Codes

3 0
4 years ago
Which is a good guideline to follow when looking for research material on the Internet?
labwork [276]
Hello,

The answer is option A p<span>ay attention to URL endings, such as .gov and .com.

Reason:

Its A because its a very important guideline to make sure you look for the root words .gov and .com to make sure its professional. Its not option B because using search engines can cause viruses. Its also not option C because anything can look professional just by how the website looks and says.

If you need anymore help feel free to ask me!

Hope this helps!

~Nonportrit</span>
5 0
4 years ago
Read 2 more answers
Easy Bib and Cite This For Me are examples of online
motikmotik
The answer is:  [A]:  "bibliographic generators" .
____________________________________________________
5 0
3 years ago
What two functions does tcp/ip perform?
svetlana [45]

The two functions does tcp/ip are:

  • Reassemble data packets at the destination.
  • Request servers for data the user wants.

<h3>What are the functions of TCP IP?</h3>

The role of the Transmission Control Protocol is known to be the one that helps to take in and put together the Data Packets while that of IP is to send the Data Packets to the right location or destination.

Therefore, The two functions does tcp/ip are:

  • Reassemble data packets at the destination.
  • Request servers for data the user wants.

Learn more about tcp/ip from

brainly.com/question/17387945

#SPJ1

4 0
2 years ago
The Business Cycle rises and falls. The highest point of the Business Cycle is known as the __________.
Mrac [35]
<span>The highest point of the Business Cycle is known as the boom</span>
3 0
4 years ago
Other questions:
  • Which are examples of intrapersonal goals? Check all that apply. Lea plans to finish her next project before the due date. Erick
    12·2 answers
  • If you have a rubric, “your teacher can prove you knew what you were supposed to do.” T/F
    10·2 answers
  • Cheryl has several concepts for mobile apps for smartphones. A friend suggests that she develop her apps for an open-source oper
    13·1 answer
  • What Intel socket recommends the use of a liquid cooling system?
    12·1 answer
  • What the heck is a motherboard and why is my computer not working when i take it out
    14·1 answer
  • Write an application that inputs three numbers (integer) from a user. (10 pts) UPLOAD Numbers.java a. display user inputs b. det
    10·1 answer
  • I'm using assembly language. This is my assignment. I kinda confused about how to write code for this assignment. Can anyone exp
    11·1 answer
  • Select the first ICMP Echo Request message sent by your computer, and expand the Internet Protocol part of the packet in the pac
    10·1 answer
  • Positive use of the technology before the pandemic.
    8·1 answer
  • 1. What are the main uses for Protein in the body?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!