2. b. a. A loop is a control structure that causes a statement or group of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. b. a. A loop is a control structure that causes a statement or group of statements to repeat. In C++ there are three looping control structures, the difference between each of these loops is how they control the repetition. i. ii. List each of the C++ loops and give ONE (1) ideal use case for each loop. Write a program that uses a loop to display the projected membership fees for the next six years of a country club. The membership fee is charged at RM 2500 per year and the country club announced it will increase its membership fee by 4% each year for the next six years. Convert the while loop in FIGURE Q2(b) into a for loop. int count = 0; while (count < 50) ( } [3 marks] count++; cout < < "count is " < < count < < endl; FIGURE Q2(b) [5 marks] [3 marks] 2. b. a. A loop is a control structure that causes a statement or group of statements to repeat. In C++ there are three looping control structures, the difference between each of these loops is how they control the repetition. i. ii. List each of the C++ loops and give ONE (1) ideal use case for each loop. Write a program that uses a loop to display the projected membership fees for the next six years of a country club. The membership fee is charged at RM 2500 per year and the country club announced it will increase its membership fee by 4% each year for the next six years. Convert the while loop in FIGURE Q2(b) into a for loop. int count = 0; while (count < 50) ( } [3 marks] count++; cout < < "count is " < < count < < endl; FIGURE Q2(b) [5 marks] [3 marks]
Expert Answer:
Answer rating: 100% (QA)
2 a i Three loops of C are For loop It is used when you know the loop should ... View the full answer
Related Book For
Business Statistics In Practice
ISBN: 9780073401836
6th Edition
Authors: Bruce Bowerman, Richard O'Connell
Posted Date:
Students also viewed these programming questions
-
Explain the difference between each of the following ledger accounts in the books of a partnership: 1. Capital account; 3. Current account; 3. Drawings account.
-
Write a program that uses nested loops to display the arrowhead pattern shown below. +++ +++++ +++ +++
-
Explain the difference between each of the following: a. A population parameter and its point estimate. b. A population mean and a corresponding sample mean.
-
What type of insurance policy insures against all risks of loss that are not specifically excluded by the policy? OA) Binder policy OB) Named peril policy OC) Specified peril policy OD) Open peril...
-
Washington Company had the following sales and purchases during 2009, its first year of business: January 8Purchased 125 units at $100 each February 20Sold 75 units at $150 each April 13Sold 35 units...
-
A mixture containing 50.0 wt% acetone and 50.0 wt% water is to be separated into two streams- one enriched in acetone, the other in water. The separation process consists of extraction of the acetone...
-
In general how have interest rates changed since the late 1980s according to Figure 11.1? FIGURE 11.1 Interest and Inflation Rates, 1988-2010 10p Rate (%) 8 6 10-Year Treasury Bonds 4 2 AAA Corporate...
-
England Productions performs London shows. The average show sells 1,300 tickets at $60 per ticket. There are 150 shows a year. No additional shows can be held as the theater is also used by other...
-
How would you import a relational model design and generate a logical model from a relational model?
-
Part I. Lernout & Hauspie (L& H) was the worlds leading provider of speech and language technology products, solutions, and services to businesses and individuals worldwide. Both Microsoft and Intel...
-
8. Given market risk premium of 8%, risk-free rate of 4%, beta of 1.5, and standard deviation of returns of 20%, estimate a reasonable range of possible values for realized returns that you can...
-
Ocean is a small but profitable shipping company. The company's net operating profit has averaged around $25 million. Ocean's assets value is close to 120 million. Suppose that the company's cost of...
-
Determine the left and the right end behavior of this function. F(x) = (2x-1)/(x - 1) 17. If an object is moved along a line so that it is at F(X)= 5X-2X Find: F'(X) = F'(3)= 18. For F(X)=8X-2X Find;...
-
How many different codons can be found in the RNA sequence if we use "four-letter", instead of "three-letter" genetic codes with still four bases (G, A, U, C)?
-
3. XTerra Adventures Enterprises plans to raise new financial capital by issuing a $100 par, 4%, convertible preferred stock. If a similar preferred stock is currently trading at $30 per share, what...
-
A mass weighing 36 pounds, attached to the end of a spring, lengthens it 5 inches. Initially, mass is released from rest at a point 2 inches above the equilibrium position. Find the equation of...
-
Briefly differentiate Free Cash present value discount and constant growth model Following information has been obtained from XY & Co, financial statement: Net Income = 400 Interest paid = 40 Tax...
-
Cable Corporation is 60% owned by Anna and 40% owned by Jim, who are unrelated. It has noncash assets, which it sells to an unrelated purchaser for $100,000 in cash and $900,000 in installment...
-
The customer service manager of a discount store monitors customer complaints. Each day a random sample of 100 customer transactions is selected. These transactions are monitored, and the number of...
-
National Motors has equipped the ZX-900 with a new disk brake system. We define the stopping distance for a ZX-900 to be the distance (in feet) required to bring the automobile to a complete stop...
-
A personnel manager is estimating the total number of person-days lost to unexcused absences by hourly workers in the last year. In a random sample of 50 employees drawn without replacement from the...
-
Consider the following cash flow profile, and assume MARR is 10 percent/year and the finance rate is 4 percent/year. a. Determine the MIRR for this project. b. Is this project economically...
-
Consider the following cash flow profile and assume MARR is 10 percent/year and the finance rate is 4 percent/year. a. Determine the MIRR for this project. b. Is this project economically attractive?...
-
A university pumps its water from wells located on campus. The falling water table has caused pumping costs to increase, the quantity of water available to decrease, and the quality of water to...
Study smarter with the SolutionInn App