Professional Documents
Culture Documents
Instructions:
1. You are strictly not allowed to use anything other than pointers and dynamic
memory.
2. One function should perform one functionality only.
3. If plagiarism found, zero marks will be awarded.
Task
Write a program that totals and averages the sales figures for any (user-defined) number of
days. The sales figures are stored in a dynamically allocated array. After that, the program
should display the information containing sales for all given days and their average. Use pointer
notation rather than array notation whenever possible.
Example
How many days of sales figures to process? 4
Enter the sales figures below.
Day 1: 65.7
Day 2: 43
Day 3: 90
Day 4: 16.4
Day 1 Sales: $ 65.7
Day 2 Sales: $ 43
Day 3 Sales: $ 90
Day 4 Sales: $ 16.4
Hint:
void getArrayElements(double *, int );
int calculateAverage(double* , int );
void displayInformation(double*, int, int);