saleslab

saleslab - / This program gets five days of sales data from...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// This program gets five days of sales data from the user // and displays the total, average, highest, and lowest amounts. #include <iostream> #include <iomanip> #include <string> #include<fstream> using namespace std; // Function prototypes void inputSales(double[],int); double sumArray(double[], int); double getHighest(double[], int); double getLowest(double[], int); double getAverageSales(double[],int); ifstream infile; ofstream outfile; string dates[10]; int main() { const int NUM_DAYS = 5; // Number of days double sales[NUM_DAYS], // To hold sales amounts totalSales, // To hold the total sales average, // To hold the average highest, // To hold the highest sales lowest; // To hold the lowest sales infile.open("inputsales.dat"); outfile.open("outputsales.dat"); // Get the sales data. inputSales(sales, NUM_DAYS); // Get the total sales. totalSales = sumArray(sales, NUM_DAYS); // Calculate the average. average = getAverageSales(sales, NUM_DAYS);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

saleslab - / This program gets five days of sales data from...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online