Question: Exercise 2: Write a program in a class FlowerCount that computes the cost of flowers sold at a flower stand. Five kinds of flowers-petunia, pansy,

 Exercise 2: Write a program in a class FlowerCount that computes

Exercise 2: Write a program in a class FlowerCount that computes the cost of flowers sold at a flower stand. Five kinds of flowers-petunia, pansy, rose, violet, and carnation- are stocked and cost, respectively, 50 cents, 75 cents, 1.50 dollars, 50 cents, and 80 cents per flower. Create an array of strings that holds the names of these flowers. Create another array that holds the cost of each corresponding flower. Your program should read the name of a flower and the quantity desired by a customer. Locate the flower in the name array and use that index to find the cost per flower in the cost array. Compute and print the total cost of the sale

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!