Statistics about the numbers read

Assignment Help Basic Computer Science
Reference no: EM13159747

Write a function whose job is to input #'s, non-# to quit, recover from the input failure by calling recover(), and tell main some statistics about the numbers read.

. unsigned readA();

Read unsigned #'s, non-# to quit, recover, return the sum of all #'s read.

For example, if main says

            cout <<"The total is " <<readA() <<endl;

and if the user types

            2 4 6 8 blah

then readA will read the numbers 2, 4, 6, 8, keeping track of the total of the numbers read, readA will then choke on the "blah", readA will then, call recover() so that cin recovers from the input failure and moves past the "blah", readA will then return the 20, then main will resume the cout statement so that it outputs

            The total is 20

Reference no: EM13159747

Questions Cloud

Explain how the joint venture can take advantage : Explain how the joint venture can take advantage of the Polish cultural differences to build a stronger organization.
Explain hypochlorous acid or hypochlorite buffer solution : What is the PH of .0750L of hypochlorous acid/hypochlorite buffer solution, originally .300M in HCLO and .400M in CLO-. after 7.5E-3 moles of NAOH have been added to the buffer
How could a tax cut achieve the same result : How could a tax cut achieve the same result? Would the tax cut have to be larger than the increase in government purchases? Why or why not?
What are potential reasons for income inequality across : What are potential reasons for income inequality across the economy. In some of our efforts to improve income inequality can we negatively impact productivity?
Statistics about the numbers read : Write a function whose job is to input #'s, non-# to quit, recover from the input failure by calling recover(), and tell main some statistics about the numbers read. . unsigned readA();
What is the final temperature of water-iron mixture : A 25.0 g sample of pure iron at 85.0°C is dropped into 75 g of water at 40.0°C. What is the final temperature of water-iron mixture?
Determine the breakeven output and total sales revenues : determine the breakeven output and total sales revenues. determine the output that would generate a total profit of $60,000 and the total sales revenues at the output level (Do not draw chart)
Statement of cash flows displaying operating and investing : Assuming that the cash balance at the beginning of the month was $7,450, prepare a statement of cash flows that displays operating, investing, and financing activities and that reconciles the beginning and ending cash balances.
What would the volume of the gas be : A certain quantity of a gas occupies 61.3 mL at 68C. If the pressure remains constant, what would the volume of the gas be at 17C?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Which industrialization essentially made us less independent

Many experts assert which industrialization has essentially made us less independent and more closely related to other people than ever before.

  Nonlinear regression equation converted in linear regression

Illustrtae how nonlinear regression equation Y = AX**B can be converted into linear regression equation solvable by method of Least Squares.

  Explain copyright implications for web site development

Study and explain copyright implications associated to Web site development. Write down the minimum of 350 words expalining the implications of copyrights on usage of content on Web site.

  Distinguish online learning with classroom learning

Write the exploratory essay in which you distinguish online learning with classroom (on-ground) learning. Your estimation may incorporate preparation time.

  Explaining quasi-legal activities over internet

Online gambling and buying of pharmaceutical drugs over the Internet are quasi-legal activities which can only take place as Internet allows the parties offering gambling.

  Interface perating system with uninterruptible power supply

Windows XP Professional can interface through the operating system with an Uninterruptible Power Supply (UPS).

  Derive expression for the effective mips rate

Derive an expression for the effective MIPS rate when using this system for the execution of this program in terms of x, n and α.

  Enforcing mandatory access control environment

Users dont seem to understand that they need to handle certain documents with more care and control than others. Which of the following will improve this situation?

  Explain d-s access control list gives p full rights

Suppose that d's access control list gives p full (read, write, append, and execute) rights to d. In which ring(s) should p execute for following to occur?

  What is average seek time

Tracks traversed Disk receives a request to access a random sector on a random track. Assume the head starts at track 0. What is the average seek time?

  Operating system machine level identical to isa language

Some instruction at operating system machine level are identical to ISA language instruction. These instruction are performed by micro program rather than by operation system.

  Distinguish web pages or web servers use for task

Suppose the role of the IT consultant to new nonprofit organization, Free Flu, to provides flu shots to the elderly. The organization requires the domain name. Distinguish between any Web pages or Web servers you would use for task.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd