Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Maps R The number of plants purchased at a store is related to the number of available plants and the temperature outdoors. The relationship of

image text in transcribed
image text in transcribed
Maps R The number of plants purchased at a store is related to the number of available plants and the temperature outdoors. The relationship of outdoor temperature to sales is: Outdoor Temperature Percentage of Plants sold Colder than 40 degrees. i.e. temp 80 40% Write a program in C++ that will take the input from the user. The first input is the number of available plants in the store. Then your program will take 7 inputs (outdoor temperature for the week). Your program will calculate the estimated number of plants which will be sold in a week (7 days) using the user input. Carli Sample Input Sample Output 100 40 89 162 The estimated total sale is 96 plants. 32 42 53 66 Explanation for the above output: On the first day the store had 100 available plants to sale. Temperature on Day 1 is 40 deg -> 30% sold => 70 available plants for the next day. Temperature on Day 2 is 89 deg -> 40% sold -> 42 available plants for the next day. Temperature on Day 3 is 62 deg -> 50% sold => 21 available plants for the next day. Temperature on Day 4 is 32 deg => 10% sold -> 19 available plants for the next day. Temperature on Day 5 is 42 deg -> 30% sold -> 13 available plants for the next day. Temperature on Day 6 is 53 deg -> 30% sold -> 9 available plants for the next day. Temperature on Day 7 is 66 deg -> 50% sold => 4 available plants for the next day. Therefore, it is estimated that 96 plants to be sold this week. Approximated sold plant has to be returned as an integer value. So, use round() function from math library to find the approximated sold plants. One sample input file (in.txt) has been attached with the assignment. We may check your program with other input data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

Students also viewed these Databases questions

Question

8. Providing support during instruction.

Answered: 1 week ago