Write a program that has two parts to demonstrate different types of loops in this language....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that has two parts to demonstrate different types of loops in this language. The first part should ask for an unlimited number of quantities from the user one at a time. Use a while loop or do while loop [your choice] to ask the user for the next number over and over until they give you -1 as value to stop the loop. This loops should add all the numbers the user entered in this indefinite loop together and print out the total to the user afterwards. The second part should have a counter controlled loop (while loop or for loop it is up to you) that cycles 10 times. It should ask the user for a starting value in a bank account. It should then print a table of the balance of that bank account for each year by printing the value on a line. Have the bank account apply interest of 3% per year. Finally, show the bank account on each line to two decimal places of formatting (so 150.5555 shows as 150.56) to demonstrate formatting in this language [Heads up - It doesn't matter if you apply the interest before or afterwards each year for the grade on the second part. This assignment is on loops and formatting. That's what's being graded here not the compounding interest day of the year which isn't given.] Write a program that has two parts to demonstrate different types of loops in this language. The first part should ask for an unlimited number of quantities from the user one at a time. Use a while loop or do while loop [your choice] to ask the user for the next number over and over until they give you -1 as value to stop the loop. This loops should add all the numbers the user entered in this indefinite loop together and print out the total to the user afterwards. The second part should have a counter controlled loop (while loop or for loop it is up to you) that cycles 10 times. It should ask the user for a starting value in a bank account. It should then print a table of the balance of that bank account for each year by printing the value on a line. Have the bank account apply interest of 3% per year. Finally, show the bank account on each line to two decimal places of formatting (so 150.5555 shows as 150.56) to demonstrate formatting in this language [Heads up - It doesn't matter if you apply the interest before or afterwards each year for the grade on the second part. This assignment is on loops and formatting. That's what's being graded here not the compounding interest day of the year which isn't given.]
Expert Answer:
Answer rating: 100% (QA)
Sure Below is a program written in Python to demonstrate different types of loops python Part 1 ... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these computer network questions
-
Suppose Sally O'Neal's pizza restaurant raises the price of a large cheese pizza from $8 to $10. As a result, the quantity demanded of pizzas decreases from 50 to 40. Using the midpoint method, what...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
In this project, we will write a program that controls a quiz show, much like the many popular TV shows. The program will read in a group of questions and their multiple choice answers, storing them...
-
Explain how each of the following illustrates one of the four principles of interaction. a. At a college tutoring co-op, students can arrange to provide tutoring in subjects they are good in (like...
-
A put option and call option with an exercise price of $60 expire in four months and sell for $1.35 and $5.30, respectively. If the stock is currently priced at $63.38, what is the annual...
-
In the cash payments journal, each amount in the General Debit column is posted (a) daily. (c) at the end of the month. (b) weekly. (d) at the end of the year.
-
What is the cost of net debt of a company that has no more shareholders equity equal to? And the cost of capital?
-
Diekmann Company, a U.S.-based company, acquired a 100 percent interest in Rakona A.S. in the Czech Republic on January 1, 2016, when the exchange rate for the Czech koruna (Ks) was $0.05. Rakona's...
-
Daphne, Inc. is currently in the process of bankruptcy. Below balance sheet represents Daphne's position at the time it filed for bankruptcy. All the numbers are expressed in thousands of dollars....
-
Values for the NASDAQ composite index during the 1,500 days preceding March 10, 2006, can be downloaded from the authors web site. Calculate the one-day 99% VaR and the one-day 99% ES on March 10,...
-
You have a shiny salad bowl with a spherical shape. If you hold the bowl at arms length with the inside of the bowl facing you, the image of your face that you see will be: A. upside down and smaller...
-
knowledge management systems have become a tool or facility to support the learning process." Analyse the SECI model and determine how the dimensions of the SECI model is applied for knowledge...
-
Part 1: Explain what fact analysis is and why it is important to an investigator Part 2 : Explain why an investigator should not rely on a physician's estimate of the time of death of a victim or the...
-
0.20 m 0.10 m -100 V +100 V Two thin, concentric, conducting spherical shells, insulated from each other, have radii of 0.10 m and 0.20 m, as shown above. The inner shell is set at an electric...
-
Thermal Rising, Incorporated, makes paragliders for sale through specialty sporting goods stores. The company has a standard paraglider model, but also makes custom-designed paragliders. Management...
-
It is the first week of December and Christmas break is right around the corner when a close colleague of yours approaches you in confidence. Kelley Garcia is also a second year teacher and you were...
-
2.31 LAB: Warm up: Variables, input, and casting (1) Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output those four values on...
-
After graduating from college and working a few years at a small technology firm. Preet scored a high-level job in the logistics department at Amex Corporation. Amex sells high-quality electronic...
-
Frank Berryessa stole funds from his employer, the Eccles Hotel Company. His father, W. S. Berryessa, learned of his sons trouble and, thinking the amount involved was about $2,000, gave the hotel a...
-
A farmer made a contract in April to sell to a grain dealer forty thousand bushels of corn to be delivered in October. On June 3, the farmer unequivocally informed the grain dealer that he was not...
-
Debra Agis was a waitress in a restaurant owned by the Howard Johnson Company. On May 23, Roger Dionne, manager of the restaurant, called a meeting of all waitresses at which he informed them that...
-
When is the cost of capital equal to the cost of equity? Can the cost of capital be equal to the cost of debt?
-
How do you explain the fact that rates of return required by investors may be identical for two groups of totally different activities (oil and IT services for example) as long as they have the same .
-
Will liquidity premiums tend to rise or fall during a crash? Why?
Study smarter with the SolutionInn App