Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What is the basic pseudocode for this with b and c included all in one? example

ID: 3860890 • Letter: W

Question

What is the basic pseudocode for this with b and c included all in one?

example of the pseudocode im looking for is.

start

     Declarations

          num itemPrice

          num salespersonCommission

          num customerDiscount

finalPrice= calculatePrice()

output “The total price after Commission, $”

salespersonCommission, “and customer discount,”

“ customerDiscount “%, is”, finalPrice

stop

calculatePrice(num itemPrice, num salespersonCommission, num customerDiscount)

     Declarations

          num totalPrice

totalPrice = (itemPrice-salespersonCommission-customerDicount)

     return

a. Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percent simple interest for one year. Create a separate method to do the calculation and return the result to be displayed.

b. modify the program in excerxise 3a so that the main program prompts the user for the amount of money and passes it to the interest-calculation method.

c. Modify the program in Exercise 3b so that the main program also prompts the user for the interest rate and passes both the amount of money and the interest rate to the interest-calculating method

Explanation / Answer

Answer(a.)

start

Declarations

num principalAmount

num rate

num time

set principalAmount=5000

set rate =2

set time=1

simpleInterest = calculateInterest()

output "The simple interest of invested amount $" principalAmount, "and at rate" rate, ", for " time "year is," simpleInterest

stop

calculateInterest(num principalAmount, num rate, num time)

Declarations

num sInterest

sInterest = (principalAmount *rate *time)/100

return

Answer (b.)and(c.)

start

Declarations

num principalAmount

num rate

num time

Read: principalAmount /* reading principal amount from the user*/

Read: rate /*reading rate value from the user*/

set time=1

simpleInterest = calculateInterest()

output "The simple interest of invested amount $" principalAmount, "and at rate" rate, ", for " time "year is," simpleInterest

stop

calculateInterest(num principalAmount, num rate, num time)

Declarations

num sInterest

sInterest = (principalAmount *rate *time)/100

return

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote