subject

For this project you have been asked to write a program for a local store owner. The store owner wants to keep a record of the name of his customers as well as the money they spend at each visit. Your program will dynamically allocate two arrays one to store the names and another one to store the amount of the purchase. The size of both arrays will be dynamically determined from the value entered by the user. Your program should allow the user to enter name-purchase pairs. For each customer entered to the store, the user types the customer’s name followed by the customer’s purchase amount. After the user enters all the customers, your program should display the list of all customers with their purchase amount. You will also need to create a function to calculate the average of the purchases by all the customers. Note: Use pointer notation rather than array notation. Also make use of the newoperator to dynamically allocate memory. Input validation: don’t accept negative amount and empty strings (e. g., "", " ").Both display and calculate should be functions. To help you out, here are their prototypes:void display(string*, double*, int); double calculate(double*, int); void sort(string*, double*, int);Check the PA4_Demo video to see a sample runof the program

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:00, ozzy55
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
image
Computers and Technology, 22.06.2019 18:00, abbygriffin2009
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
image
Computers and Technology, 22.06.2019 18:30, Akkenson17871
The "instance" relationship shows that something is an object of a
Answers: 1
image
Computers and Technology, 23.06.2019 07:10, anika420
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
You know the right answer?
For this project you have been asked to write a program for a local store owner. The store owner wan...

Questions in other subjects:

Konu
Mathematics, 25.10.2021 14:00
Konu
Mathematics, 25.10.2021 14:00
Konu
Mathematics, 25.10.2021 14:00
Konu
Social Studies, 25.10.2021 14:00