Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Students in Norfolk Gardens Academy are very excited about the end of year school party. Victoria is playing piano. She is practicing for the

 

Students in Norfolk Gardens Academy are very excited about the end of year school party. Victoria is playing piano. She is practicing for the end of the school year party every day for a certain amount of time depending on her schedule. It takes her N minutes to practice the first song, and each of following songs takes M minutes longer than the previous song. She has T minutes to practice for all the songs. For example, if the first song takes N = 15 minutes and M = 10, then the second song will take 25 minutes, the third song will take 35 minutes, and so on. If she has 150 minutes to practice the songs, then she can practice four songs because 15 + 25 +35+45 = 120. Design an algorithm and write a C++ program that prompts the user to enter the values of N, M, and T, and outputs the number of songs Victoria can practice. Sample Run 1: Enter the number of minutes to practice first song: -5 Enter the number of minutes to practice first song: 5 Enter how many more minutes to practice the next song: 10 Enter the total time (in minutes) to practice all the songs: 90 In 90 minutes Victoria can practice 4 songs. Sample Run 2: Enter the number of minutes to practice first song: 10 Enter how many more minutes to practice the next song: -5 Enter how many more minutes to practice the next song: 5 Enter the total time (in minutes) to practice all the songs: 100 In 100 minutes Victoria can practice 5 songs. Sample Run 3: Enter the number of minutes to practice first song: 12 Enter how many more minutes to practice the next song: 4 Enter the total time (in minutes) to practice all the songs: 150 In 150 minutes Victoria can practice 6 songs.

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

Fundamentals of Advanced Accounting

Authors: Joe Ben Hoyle, Thomas Schaefer, Timothy Doupnik

6th edition

0-07-786223-6, 101259095592, 13: 978-0-07-7, 13978125909559, 978-0077862237

More Books

Students also viewed these Programming questions

Question

Can you write down a Open VPN project conclusion. At least one page

Answered: 1 week ago

Question

Solve each equation or inequality. |6x8-4 = 0

Answered: 1 week ago

Question

What is a business combination?

Answered: 1 week ago