Assignment 7b: 12 points
Create a program: Easter Candy Sales
Your goal is to write a program that records the sales for 5 different types of Easter candies, the
total sales, and the names of the highest and lowest selling products. You will need parallel arrays
for this program.
Your program should have the following:
• 3 comment lines (description of the program, author, and date).
• Create a string array that stores five different types of candies: Peeps, Chocolate Bunnies,
Jellybeans, Cadbury Eggs, and Lollipops. The candy names should be stored using an
initialization list at the time the name array is created. (1 point)
• Have the program prompt the user to enter the number of items sold for each type of
candy using an array. Do not accept negative values for the number of items. (2 points)
• Write a function to calculate the total sales. It should accept your array holding the
number of sales for each type of candy and return the total amount of sales. (2 points)
• Write a function to determine the highest selling candy. It should accept your array
holding the number of sales for each type of candy and return the location in the array of
the highest selling candy. (2 points)
• Write a function to determine the lowest selling candy. It should accept your array holding
the number of sales for each type of candy and return the location in the array of the
lowest selling candy. (2 points)
• Produce a table that displays the sales for each type of candy (1 point), the total sales (1
point), and the names of the highest selling and lowest selling products (1 point).
Turn in a .txt file to Canvas with your name, section number, all output, and source code.
Example Output:
Enter the sales for Peeps: 10
Enter the sales for Chocolate Bunnies: 20
Enter the sales for Jellybeans: 30
Enter the sales for Cadbury Eggs: 40
Enter the sales for Lollipops: 5
Candy Name Candy Sales
Peeps 10
Chocolate Bunnies 20
Jellybeans 30
Cadbury Eggs 40
Lollipops 5
Total sales: 105
Highest selling candy: Cadbury Eggs
Lowest selling candy: Lollipops