Answer to Question #255549 in Algorithms for Israel

Question #255549

Algorithm for a solution that prints the amount of profit an organisation receives based on its sales. The more sales documented, the larger the profit ratio. Allow the user to input the total sales figure for the organisation. Compute the profit based on the following table. Display the sales and profit formatted with commas, decimals, and a rand symbol. Display the profit ratio formatted with a percent symbol. 0 – R1000: 3.0% / R1000.01 – R5000: 3.5% / R5000.01 – R10000: 4.0% / over R10000: 4.5%

 



1
Expert's answer
2021-10-23T08:05:42-0400
Start
   Declare variable double totalSales
   Declare variable double profit=0
   Declare variable double profitPerc=0
   Read totalSales
   if totalSales > 0 and totalSales <= 1000 then
       Set profitPerc = 0.03
       Set profit = totalSales *profitPerc
   end if
   if totalSales > 1000 and totalSales <= 5000 then
       Set profitPerc = 0.035
       Set profit = totalSales * profitPerc
  end if
  if totalSales > 5000 and totalSales <= 10000 then
       Set profitPerc = 0.04
       Set profit = totalSales * profitPerc
  if totalSales > 10000 then 
       Set profitPerc = 0.045
       Set profit = totalSales * profitPerc
  end if
  Display totalSales
  Display profit 
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS