You are on page 1of 1

Graded Lab 3

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.

Input Validation: Do not accept negative numbers for test scores.

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

Average Sales: $53

Hint:
void getArrayElements(double *, int );
int calculateAverage(double* , int );
void displayInformation(double*, int, int);

You might also like