Students in Norfolk Gardens Academy are very excited about the end of year school party. Victoria...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Fundamentals of Advanced Accounting
ISBN: 978-0077862237
6th edition
Authors: Joe Ben Hoyle, Thomas Schaefer, Timothy Doupnik
Posted Date:
Students also viewed these programming questions
-
Using the results from Exercise 11.27, show that the stresses in a rotating solid circular polar-orthotropic disk of radius a with boundary condition r (a) = 0 are given by: Data from exercise 11.27...
-
Common structural steel can be represented on drawings using a letter, immediately followed by a number, then another number (for example, S14x30). The two numbers for a steel member W16x60 designate...
-
In preparation for an MRI scan, why are patients advised to remove eyeglasses, watches, jewelry, and other metal objects?
-
On January 1, 2021, Labtech Circuits borrowed $100,000 from First Bank by issuing a three-year, 8% note, payable on December 31, 2023. Labtech wanted to hedge the risk that general interest rates...
-
In a gas turbine, air at a temperature of \(15^{\circ} \mathrm{C}\) and 1 bar pressure enters the compressor, where it is compressed to 5 bar. Air enters the turbine at a temperature of \(815^{\circ}...
-
Mels Male Accessories sells wallets and money clips. Historically, the firms sales have averaged three wallets for every money clip. Each wallet has an $8 contribution margin , and each money clip...
-
Gnosis is an international freight software company, based in Charleston, South Carolina, USA. Their specialty is shipping "visibility," which enables firms to determine where their shipping...
-
Survey two relatives or friends and ask about their decision-making process when they most recently bought a vehicle. Find out if they thought about the opportunity costs when making the purchase....
-
Journalize the following merchandise transactions: a. Sold merchandise on account, $92,500 with terms 1/10, n/30. The cost of the merchandise sold was $55,500. b. Received payment less the discount....
-
What, in your view, are the fundamental similarities between Kenneth Burke's dramatism and Walter Fisher's narrative paradigm?What distinguishes the two theories? What are the weaknesses of each?
-
Suppose parametric equations for the line segment between (8, 9) and (-2,-5) have the form: (x(t) = a+bt y(t) = c + dt If the parametric curve starts at (8, 9) when t =0 and ends at (2,5) at t = 1,...
-
MyCarCorp produces car parts and is considering opening a new factory in Russia (assume now is beginning of 2002 and the factory would open in 2003). Factory will re- quire an initial investment of...
-
which is effective for engaging national debates and dialogues, traditional media or new media?
-
What is the difference between actual results and budgeted? Explain in details.
-
Choose an emerging and interesting technology and develop an analysis summary related to the selected EDT.
-
For the data in Exercise 17-19, use the FIFO method to summarize total costs to account for, and assign these costs to units completed and transferred out, and to units in ending work in process....
-
On January 1, 2014, QuickPort Company acquired 90 percent of the outstanding voting stock of NetSpeed, Inc., for $810,000 in cash and stock options. At the acquisition date, NetSpeed had common stock...
-
What is a business combination?
-
Ahorita Company manufactures wireless transponders for satellite applications. Ahorita has recently acquired Zelltech Company, which is primarily known for its software communications development but...
-
While the BohrSommerfeld condition sometimes gets the energy eigenvalues exactly correct, it can also be used for systems where the exact solution is not known. In this example, we will estimate the...
-
It's useful to see how our quantum perturbation theory works in a case that we can solve exactly. Let's consider a two-state system in which the Hamiltonian is...
-
Let's see how the variational method works in another application. Let's assume we didn't know the ground-state energy of the quantum harmonic oscillator and use the variational method to determine...
Study smarter with the SolutionInn App