Note: You've already written psuedocode of this problem in Homework 1: Question 2. You just need to convert it to C++ code to solve this question. You're planning a ski trip for later this semester! You want to know how much snow each Colorado resort will have by that time. Write a program to estimate the number of inches of snow Breckenridge, Vail, and Copper Mountain will have after a certain number of days (x) and display the output. X will be taken as a user input. Currently, there are 25 inches in Breckenridge, 28 inches at Vail, and 40 at Copper Mountain. The resorts have provided us with the snowfall and melt rate predictions per day (mentioned below) to come up with an accurate estimation. Assume these rates stay the same for all future days. The rates do not depend on the current number of inches at each resort. Hint: You will never end up with a negative snow depth. Resort Breckenridge Vail Snowfall rate (inches/day) --- Sample run ---: 10 14 Copper Mountain 5 Melt rate (inches/day) 5 2 3 How many days in the future would you like a prediction for? 5 Breckenridge will have 50 inches, Vail will have 88 inches, and Copper Mountain will have 50 inches.
Note: You've already written psuedocode of this problem in Homework 1: Question 2. You just need to convert it to C++ code to solve this question.
You’re planning a ski trip for later this semester! You want to know how much snow each Colorado resort will have by that time.
Write a program to estimate the number of inches of snow Breckenridge, Vail, and Copper Mountain will have after a certain number of days (X) and display the output. X will be taken as a user input. Currently, there are 25 inches in Breckenridge, 28 inches at Vail, and 40 at Copper Mountain.
The resorts have provided us with the snowfall and melt rate predictions per day (mentioned below) to come up with an accurate estimation. Assume these rates stay the same for all future days. The rates do not depend on the current number of inches at each resort.
Hint: You will never end up with a negative snow depth.
Resort | Snowfall rate (inches/day) | Melt rate (inches/day) |
---|---|---|
Breckenridge | 10 | 5 |
Vail | 14 | 2 |
Copper Mountain | 5 | 3 |
--- Sample run ---:
The file should be named as snowfall.cpp. Don’t forget to head over to the Homework 2 - Coderunner assignment on Canvas and paste your solution in the answer box!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images