English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How do I write a C++ program that reads in a list of prices, And the program should output the average price and total price. The price should be properly formatted with a $ and only 2 points past the decimal.

2007-09-22 15:54:44 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Show us what you've done so far.

How did you do the input?
How did you store the data internally?
How did you do the calculations?
How did you do the output?

If you haven't even started, you need your own teacher, not us.

2007-09-22 17:13:57 · answer #1 · answered by Kasey C 7 · 0 0

its easy
assign a array and take prices of diffrnt things
add them its total
count no of items
find average
for formatting use ctype.h header with setwidth and setprecision functions

2007-09-22 18:55:17 · answer #2 · answered by i_am_the_next_best_one 5 · 0 0

fedest.com, questions and answers