Study the algorithm and complete the question(s) that follow: ~Algorithim_to_BuyElectriciy Int units Float cost units =...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Study the algorithm and complete the question(s) that follow: ~Algorithim_to_BuyElectriciy Int units Float cost units = display "Enter Number of units you would like to buy if units < 20 then else cost units * 2.00 if units >= 50 then cost = units * 1.50 else display You have entered invalid number of units" endif endif display "The cost of ", units, "units is R", cost end Question 6 6.1 Trace the algorithm above using 55 as the number of units. (10 Marks) 6.2 Modify the algorithm so that the buyer is given a 15% discount if they buy their units on or before the 7th of the month. The algorithm should allow the user to enter any amount and calculate their change. (10 Marks) [Sub Total 20 Marks] Study the algorithm and complete the question(s) that follow: ~Algorithim_to_BuyElectriciy Int units Float cost units = display "Enter Number of units you would like to buy if units < 20 then else cost units * 2.00 if units >= 50 then cost = units * 1.50 else display You have entered invalid number of units" endif endif display "The cost of ", units, "units is R", cost end Question 6 6.1 Trace the algorithm above using 55 as the number of units. (10 Marks) 6.2 Modify the algorithm so that the buyer is given a 15% discount if they buy their units on or before the 7th of the month. The algorithm should allow the user to enter any amount and calculate their change. (10 Marks) [Sub Total 20 Marks]
Expert Answer:
Answer rating: 100% (QA)
61 Tracing the algorithm with 55 units The user enters 55 as the number of units they would li... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The endpoints of AB are A(-1, 1) and B(2, 3). Describe and correct the error in setting up the matrix multiplication for a 270 rotation about the origin. 270 rotation of AB -1 2 RX 1 3 1
-
a. List down the key elements of writing a business proposa.l (8 Marks) b. Briefly explain the types of business proposals with relevant examples. (8 Marks)
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
A population consists of the following N = 5 scores: 0, 6, 4, 3, and 12. a. Compute m and for the population. b. Find the z-score for each score in the population. c. Transform the original...
-
Determine the internal normal force, shear force, and moment at point C. Units Used: kip = 103 lb Given: a = 0.5 ft d = 8ft b = 2 ft e = 4 ft c = 3 ft w = 150lb/ft B
-
Amy invested $650,000 in real estate ($487,500 for an office building and $162,500 for its land). The property enjoys full occupancy; tenants include an assortment of businesses. Amy can deduct...
-
Analyze the housing price data in Table B. 4 for multicollinearity. Use the variance inflation factors and the condition number of \(\mathbf{X}^{\prime} \mathbf{X}\). y X1 X2 X3 X4 X5 X6 X7 Xg 25.9...
-
Foy Company has a welding activity and wants to develop a flexible budget formula for the activity. The following resources are used by the activity: Four welding units, with a lease cost of $12,000...
-
Mortgage companies usually charge interest semi-annually. What would be the effective rate of interest on a mortgage at 4.25 percent compounded semi-annually?
-
Submersibles with clear plastic hulls have the potential to revolutionize underwater leisure. One small submersible vehicle has a depth-control system as illustrated in Figure E4.9. (a) Determine the...
-
Different species use different strategies to determine sex of a new born individual. It can be environmental cues or genetically determined. Justify this statement giving reason/example.
-
Enter the following items in the appropriate debtors' accounts (i.e. your customers' accounts) only; do not write up other accounts. Then balance-off each of these personal accounts at the end of the...
-
Which of the following are correct? (i) Received commission by cheque (i) Paid rates by cash (iii) Paid motor expenses by cheque (iv) Received refund of insurance by cheque Account to be debited...
-
Write up a two-column cash book for a bedroom furniture shop from the following details, and balance it off as at the end of the month: 2016 July 1 Started in business with capital in cash 10,000. 2...
-
Which of the following statements is correct? Assets (A) We paid a creditor by cheque - Bank (B) A debtor paid us 90 in cash + Cash Effect upon Liabilities - Accounts payable + Accounts receivable
-
Which of the following are correct? (i) Bought office furniture for cash (ii) A debtor, P. Sangster, pays us by cheque (iii) Introduced capital by cheque (iv) Paid a creditor, B. Lee, by cash (A)...
-
Calculate the charge on the capacitor C3 shown in the figure inthe PDF? A. 10 micro-C B. 100 micro-C C. 50 micro-C D. 25 micro- C G=5MF 2=5MF V=10V C3=10uF
-
Establish identity. cos( + k) = (-1)k cos , k any integer
-
In this exercise, you will modify the program that you created in Chapter 6s Lab 6-2. If necessary, create a new project named Intermediate21 Project, and save it in the Cpp8\Chap09 folder. Copy the...
-
In this exercise, you will include a Boolean value in a switch statement. Follow the instructions for starting C++ and viewing the Advanced21.cpp file, which is contained in either the...
-
In this exercise, you will modify the program from Lab10-2. If necessary, create a new project named Intermediate20 Project, and save it in the Cpp8\Chap10 folder. Copy the instructions from the...
-
The distribution of the energy of the molecules is also of importance in the kinetics of chemical reactions. The fraction of molecules with energy in the range between \(E\) and \(E+d E\) is given...
-
Show the details leading to the equation (1.52) in the text, \[D_{\mathrm{AA}}=\frac{1}{3} \bar{c} \lambda\] where \(D_{\mathrm{AA}}\) is the self-diffusion coefficient.
-
The simple formula \(C_{p}=(5 / 2) R\) (molar units) is valid only for monatomic gases. A simple extension that has been suggested is \[C_{p}=\left(5+N_{\mathrm{r}} ight) \frac{1}{2} R\] where...
Study smarter with the SolutionInn App