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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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