CMPSC homework1 - // Calculate the total sales. total =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // This program asks for sales figures for 3 days. The total // sales are calculated and displayed in a table. #include <iostream> #include <iomanip> using namespace std int main() { double day1, day2, day3, total // Get the sales for each day. cout << "Enter the sales for day 1: " cin >> day1 cout << "Enter the sales for day 2: " cin >> day2 cout << "Enter the sales for day 3: " cin >> day3
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: // Calculate the total sales. total = day1 + day2 + day3 // Display the sales figures. cout << "\nSales Figures\n" cout << "-------------\n" cout << setprecision(5) cout << "Day 1: " << setw(8) << day1 << endl cout << "Day 2: " << setw(8) << day2 << endl cout << "Day 3: " << setw(8) << day3 << endl cout << "Total: " << setw(8) << total << endl return 0 }...
View Full Document

This note was uploaded on 03/19/2008 for the course CSC 121 taught by Professor Deng during the Fall '08 term at Pennsylvania State University, University Park.

Ask a homework question - tutors are online