Question
Write a program named moonpie.cpp. All your code will be in this one file. Create a vector named moonPieArray. Ask how many days Jane stole
Write a program named moonpie.cpp. All your code will be in this one file. Create a vector named moonPieArray. Ask how many days Jane stole moon pies. Create a function called enterStolenMoonPies and call this function from your main function. You will send the vector & number of days to this function. You will populate the vector by asking the user how many moon pies Jane stole on each day. NOTE: Are Vector ADTs passed by VALUE or REFERENCE? Then, create a function called totalMoonPies and call this function from your main function. You will send the vector & number of days to this function. In this function, you will figure out how many moon pies in total has been stolen by Jane then return this value back to main.
Then, create a function called averageMoonPies and call this function rom your main function. You will send the number of days, and the total # moon pies stolen to this function. In this function, you will figure out the average number of moon pies that were stolen per day then return this value back to main. Then, create a function called highestMoonPies and call this function from your main function. You will send the vector & number of days to this function. In this function, you will figure out the most moon pies Jane stole in a single day and then return this value back to main. Then, create a function called lowestMoonPies and call this function from your main function. You will send the vector & number of days to this function. In the function, you will figure out the least number of moon pies Jane stole in a single day and then return this value back to main. Last, print out the total, average, highest & lowest in an easy-to-read way in the main function. Refer to sample output for formatting.
SAMPLE OUTPUT Windows System32Vcmdexe :VUserslacrockett\Desktop\CSCCSC Fal1 2018\CSC1310-001\LABS LAB 4g++ moonpie.cpp :Users\acrockett\Desktop\CSC\CSC Fall 2018\CSC1310-901\LABS\LAB 4>a low many days did Jane steal moon pies? nter the number of moon pies stolen each day. DAY 1: 3 DAY 2: 6 DAY 3: 1 DAY 4: 7 DAY 5: 2 ..RESULTS.. TOTAL # MOON PIES STOLEN: 19 AVERAGE # MOON PIES STOLEN PER DAY: 3.8 OST # MOON PIES STOLEN IN ONE DAY: 7 LEAST # MOON PIES STOLEN IN ONE DAY: \Usersacrockett\Desktop\CSCICSC Fall 2018\CSC1310-001 \LABSLAB 4 WHAT TO TURN IN Zip all the following files and upload to ilearn. moonpie.cpp RUN Makefile TEST CASE.txtStep 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