Prompts the user for the prices of 10 automobiles

Assignment Help Basic Computer Science
Reference no: EM13166370

Write a program that prompts the user for the prices of 10 automobiles (use looping to do this and store the prices in an array). The automobiles may be priced from less than $1 up to $99,999. No negative numbers are allowed. Perform error checking to ensure that only valid numbers are entered ($1 - $99,999). Using a function, calculate and display the number of cars in all 10 price categories, i.e., $1 - $9999, $10,000 - $19,999, $20-000 - $29,999, ... $90,000 - $99,999. Call a function that loops through the array, and displays the highest and lowest priced cars only. Call a separate function which calculates the average of all of the cars, and passes the average amount back to the main() function, where it is printed out.

Sample Session:

Please enter the price of Automobile #1: 25999
Please enter the price of Automobile #2: 15000
Please enter the price of Automobile #3: 45000
Please enter the price of Automobile #4: 65000
Please enter the price of Automobile #5: 2999
Please enter the price of Automobile #6: 33000
Please enter the price of Automobile #7: 82000
Please enter the price of Automobile #8: 41000
Please enter the price of Automobile #9: 24000
Please enter the price of Automobile #10: 19999

The number of cars in the $1 - $9999 range is: 1
The number of cars in the $10000 - $19999 range is: 2
The number of cars in the $20000 - $29999 range is: 2
The number of cars in the $30000 - $39999 range is: 1
The number of cars in the $40000 - $49999 range is: 2
The number of cars in the $50000 - $59999 range is: 0
The number of cars in the $60000 - $69999 range is: 1
The number of cars in the $70000 - $79999 range is: 0
The number of cars in the $80000 - $89999 range is: 1
The number of cars in the $90000 - $99999 range is: 0
The highest priced car is: $82000
The lowest priced car is: $2999
The average price of all the cars is: $35400 (round to the nearest dollar)

Reference no: EM13166370

Questions Cloud

Write a program that will define the f string manipulation : 1.) Write a program that will define the following string manipulation functions. Each is analogous to thecorresponding C++ string function.
Analyzing activity in inventory accounts : Analyzing Activity in Inventory Accounts and select data concerning operations of Cascade Manufacturing Company for the past fiscal year follow:
Frequent format of music in the romantic era : Which phrase best describes program music, a frequent format of music in  the romantic era?
What is the atomic weight of m : The element M forms the chloride MCl4 containing 75.0% Cl by mass. What is the atomic weight of M?
Prompts the user for the prices of 10 automobiles : Write a program that prompts the user for the prices of 10 automobiles (use looping to do this and store the prices in an array). The automobiles may be priced from less than $1 up to $99,999. No negative numbers are allowed. Perform error checkin..
What is ea for the reverse reaction : For the reaction A --> B, the activation energy is Ea = 125 kJ/mol and the heat of reaction, H = 50 kJ/mol. What is Ea for the reverse reaction in kJ/mol?
Stores a logically related database over two or more : A distributed database management system (DDBMS) stores a logically related database over two or more physically distinct locations connected by a computer network.
Four techniques for analyzing : Briefly compare and contrast the four techniques for analyzing the costs and benefits of a proposed system. What do you see as particular strengths and weakness of each method?
What would be the resulting molarity : If you added 75ml of a 0.555M solution of NaCl to enough water to produce 950 ml of solution, what would be the resulting molarity?

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  Explaining open-source software products like linux

Intellectual property as well as increase its support of open-source software products like Linux be a successful growth strategy in the "brutally competitive marketplace" in which it operates? Why or why not?

  Explain cyberspace arena for human social interaction

Do you believe cyberspace is a whole new arena for human social interaction, or is it simply one more tool which humans put to remarkable range of uses without actually changing in any fundamental way?

  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.

  Provide permission to get financial amounts

System to have employees register and provide permission to get financial amounts from dental insurance and retirement companies.

  Create worksheet using excel having different columns

Create a worksheet using excel having different columns depicting the Serial Number, Name of the Student, Marks obtained in various subjects i.e. English, Maths, and Science.

  Explaining accuracy when using training set data

Explain what can you say about accuracy when using training set data and when using separate percentage to train?

  Rsa protocol to encrypt and decrypt messages

In this problem you are enquired to hand-turn RSA protocol to encrypt and decrypt messages by using rather smaller numbers than are used in practice, so that calculations can be done by hand.

  Different methods that freedom of expression is limited

Describe three different methods that freedom of expression is limited in spite of unequivocal language of First Amendment.

  Investigate project management body of knowledge

Investigate Project Management Body of Knowledge (PMBoK). Write a report on one of knowledge areas. Describe the task of understanding potential threats

  Explain different kinds of feasibility studies

When deciding whether to buy and implement digital dashboard or management cockpit sometimes a feasibility study is conducted.  Explain the different kinds of feasibility studies.

  Part of a surgical admitting process

Part of a surgical admitting process orderlies are available to escort patients to the pre-surgery preparation area. Patients are not allowed to go by themselves as a matter of policy.

  Sodium sulfate is slowly added to a solution

Sodium sulfate is slowly added to a solution containing 0.0500 M Ca2 (aq) and 0.0390 M Ag (aq). What will be the concentration of Ca2 (aq) when Ag2SO4(s) begins to precipitate?

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