Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in c + + Programming Assignment 3 Deliveries 2 . cpp Program Description: The objective of this programming assignment is to practice using pointer syntax.
in c
Programming Assignment
Deliveriescpp
Program Description:
The objective of this programming assignment is to practice using pointer syntax.
This assignment is very similar to assignment but in this assignment you are
required to use functions.
This is Program Assignment for COSC and is named Deliveriescpp Please
use this name. You may append your name to it if desired. This program collects
information on deliveries by Webster Delivery Service WDS and determines
some related statistics such as the total number of packages delivered, the
average number of packages delivered, the minimum and the maximum delivery
days and the number of packages delivered for those days.
You are trying to calculate statistics related to the packages delivered previously
mentioned for days of deliveries, and this program will provide that
information.
Again use the following variables in the main function.
const int SIZE ;
int deliveriesSIZE;
int ptr deliveries;
Use a loop to access the array. You are required to use the pointer ptr as
pointer syntax to manipulate the array not deliveries i
You are also required to use pointer syntax in all manipulations of the
array ie not deliveriesi
Your program should ask user to enter all data, calculate and display an
average, display all values with the same format as sample output and
sort all values from smallest to biggest using bubble sort all
functionalities must be implemented with pointer syntax onlyie not
deliveries i Note you may want to use a swap function in the bubble
sort function. Use the sorted data to determine the minimum and
maximum delivery values.
The following functions are needed:
Use the function headers provided below, you may not change the
function headers.
Function header Explanation
void getAllDataint
pArray, int size
This function should ask the user to
enter all values into the array using
pArray as manipulator.
All values are between and
both and are acceptable.
double getAverageconst int
pArray, int size
This function should calculate and
return the average of all values to the
array using pArray as manipulator.
No display messages.
void displayAllValueconst
int pArray, int SIZE
This function should display all
values of the array using pArray as
manipulator.
Display all values entered with same
output format as shown in the
sample output. I used left justified
setw for display and values after
decimal point for all floating point
values.
void bubbleSortint const
pArray, const int SIZE
This function should sort the array
using bubble sort. Sort all values
from smallest to largest.
Notice the pointer is a constant
pointer. Do not use any display
messages in this function.
Other Specifications:
Use fixed setprecision to display two decimal values for the average
Bushels should be between and inclusive both and are
acceptable
Follow program style guidelines very carefully.
a Points will be taken off for all violations.
b Listed below are some common mistakes, please verify.
i There should be no global constant variables at all.
ii All functions must have prototypes.
iii. Store all values as variables, do not hardcode any values, use
named constants instead. For example
const int MIN ;
const int MAX ;
iv Use a line separator to separate blocks of programs.
stars line separator comes with a blank line
before and after.
Use it between each function definition.
Separate function prototypes and main function
definitions
Between using namespace std; and function
prototypes and main
All assignments must be submitted and run as specified to pass the course
see syllabus
Your output format must match with my output format, including the blank
lines.
Submit your assignment cpp only on Canvas before the due date.
See an example of the output below.
Sample Output:
This is programming assignment for COSC OADeliveriescpp
Webster Delivery Service Week Report
Please enter the number of deliveries on each day
Day :
Invalid value, please reenter:
Invalid value, please reenter:
Please enter the number of deliveries on each day
Day :
Please enter the number of deliveries on each day
Day :
Please enter the number of deliveries on each day
Day :
Please enter the number of deliveries on each day
Day :
Please enter the number of deliveries on each day
Day :
Please enter the number of deliveries on each day
Day :
The numbers of packages delivered were:
The total number of packages delivered was deliveries
The average daily number of packages was deliveries
The sorted deliveries are:
The total number of packages delivered was deliveries
The minimum deliver
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started