Question: Write a program in C++ that will calculate the estimated number of plants which will be sold in a week (7 days) using the user

Write a program in C++ that will calculate the estimated number of plants which will be sold in a week (7 days) using the user input for the number of available plants in the store, and then the average outdoor temperatures for the week of interest.

Sample Input

100 40 89 62 32 42 53 66

Sample Output

Estimated total sale is 95 plants.

Explanation for the above input case:

(Please note: you are not required to print explanations :)

On the first day the store had 100 available plants to sale.

Temperature on Day 1 is 40deg => 30% sold => 70 available plants for the next day.

Temperature on Day 2 is 89deg => 40% sold => 42 available plants for the next day.

Temperature on Day 3 is 62deg => 50% sold => 21 available plants for the next day.

Temperature on Day 4 is 32deg => 10% sold => 19 available plants for the next day.

Temperature on Day 5 is 42deg => 30% sold => 14 available plants for the next day.

Temperature on Day 6 is 53deg => 30% sold => 10 available plants for the next day.

Temperature on Day 7 is 66deg => 50% sold => 5 available plants for the next day.

Therefore, it is estimated that 95 plants to be sold this week.

Is there someone to help me on this problem?

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!