// This pseudocode is based on the pseudocode from project #2. It is possible your logic, variables names from project may be different from 2 //below. That is ok. You just need to adjust your project #4 to match the logic below. Recall,, you should no t have to create new variables 3 //since your project #2 is already working. You are just converting the logic to using functions. No assumptions. Ask me questions 9/2022 4 Import welcome message Module 5 Import retail price Module 6 7 Function main() 8 Declare Variables (see project #2) 9 Call quantity =Input_Packages() 10 Call discountrate=Determine_Discount(quantity) 11 Call fullprice=Calculate_Fullprice(quantity) 12 Call discountamount=Calculate_Discount(fullprice, discountrate) 13 Call totalamount=Calculate_totalamount(fullprice, discountamount) 14 Call Print_Amounts(discountamount, totalamount) 15 //End of function main() 16 17 Function Input_Packages() 18 Input quantity 19 return quantity 20 // End of function Input_Packages() 21 22 Function Determine_Discount(quantity) 23 discountrate=0.0 24 if quantity> 99 then 25 Set discountrate = 0.50 26 elseif quantity > 49 then 27 Set discountrate = 0.40 28 elseif quantity > 19 then 29 Set discountrate=0.30 30 elseif quantity> 9 then 31 Set discountrate=0.20 32 else 33 discountrate=0.0 34 return discountrate 35 //End of function Determine_Discount() 36 37 Function Calculate_Fullprice(quantity) 38 Set fullprice=quantity*RETAIL_PRICE(get from Module) 39 return fullprice 40 // End of unction Calculate_Fullprice() 41 42 Function Calculate_Discount(fullprice, discountrate) 43 // calculate the discount amount 44 Set discountamount = fullPrice * discountrate 45 return discountamount 46 47 Function Calculate_totalamount(fullprice, discountamount) 48 // calculate the total amount 49 Set totalAmount = fullPrice -discountamount 50 return totalamount 51 // End of function Calculate_totalamount() 52 53 Function Print_Amounts(discountamount, totalamount) 54 // Print results 55 Print "Discount Amount is", discountAmount Print ""Total Amount is: ", totalamount 56 Print ""Total Amount is: ", totalamount 57 // end of function Print_Amounts() 58 59 Call main() 60 Print(“program over”)
1 // This pseudocode is based on the pseudocode from project #2. It is possible your logic, variables names from project may be different from
2 //below. That is ok. You just need to adjust your project #4 to match the logic below. Recall,, you should no t have to create new variables
3 //since your project #2 is already working. You are just converting the logic to using functions. No assumptions. Ask me questions 9/2022
4 Import welcome message Module
5 Import retail price Module
6
7 Function main()
8 Declare Variables (see project #2)
9 Call quantity =Input_Packages()
10 Call discountrate=Determine_Discount(quantity)
11 Call fullprice=Calculate_Fullprice(quantity)
12 Call discountamount=Calculate_Discount(fullprice, discountrate)
13 Call totalamount=Calculate_totalamount(fullprice, discountamount)
14 Call Print_Amounts(discountamount, totalamount)
15 //End of function main()
16
17 Function Input_Packages()
18 Input quantity
19 return quantity
20 // End of function Input_Packages()
21
22 Function Determine_Discount(quantity)
23 discountrate=0.0
24 if quantity> 99 then
25 Set discountrate = 0.50
26 elseif quantity > 49 then
27 Set discountrate = 0.40
28 elseif quantity > 19 then
29 Set discountrate=0.30
30 elseif quantity> 9 then
31 Set discountrate=0.20
32 else
33 discountrate=0.0
34 return discountrate
35 //End of function Determine_Discount()
36
37 Function Calculate_Fullprice(quantity)
38 Set fullprice=quantity*RETAIL_PRICE(get from Module)
39 return fullprice
40 // End of unction Calculate_Fullprice()
41
42 Function Calculate_Discount(fullprice, discountrate)
43 // calculate the discount amount
44 Set discountamount = fullPrice * discountrate
45 return discountamount
46
47 Function Calculate_totalamount(fullprice, discountamount)
48 // calculate the total amount
49 Set totalAmount = fullPrice -discountamount
50 return totalamount
51 // End of function Calculate_totalamount()
52
53 Function Print_Amounts(discountamount, totalamount)
54 // Print results
55 Print "Discount Amount is", discountAmount Print ""Total Amount is: ", totalamount
56 Print ""Total Amount is: ", totalamount
57 // end of function Print_Amounts()
58
59 Call main()
60 Print(“program over”)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![New Perspectives on HTML5, CSS3, and JavaScript](https://www.bartleby.com/isbn_cover_images/9781305503922/9781305503922_smallCoverImage.gif)
![New Perspectives on HTML5, CSS3, and JavaScript](https://www.bartleby.com/isbn_cover_images/9781305503922/9781305503922_smallCoverImage.gif)