Question
Write the pseudocode that will produce a receipt in the format specified above.
Your solution should satisfy the following requirements:
•Declare and initialise variables. Numeric variables must be initialised to zero.
•The shop keeper must be asked the following and answer with a 1 (Yes) or 0 (No)
Do you want to purchase tomatoes?
Do you want to purchase green beans? Do you want to purchase spinach?
•If the shop keeper answers 1 for any of the questions above, then input the kilos the shop keeper wants to buy for each of the items purchased•Calculate the cost for each vegetable (price x kilos)
•Calculate the total cost (before discount) •Determine if a discount must be applied to a vegetable
•Calculate the discount if required
•Calculate the final total due after the discount has been subtracted
•Output the slip in the format specified above
Your solution should satisfy the following requirements:
•Declare and initialise variables. Numeric variables must be initialised to zero.
•The shop keeper must be asked the following and answer with a 1 (Yes) or 0 (No)
Do you want to purchase tomatoes?
Do you want to purchase green beans? Do you want to purchase spinach?
•If the shop keeper answers 1 for any of the questions above, then input the kilos the shop keeper wants to buy for each of the items purchased•Calculate the cost for each vegetable (price x kilos)
•Calculate the total cost (before discount) •Determine if a discount must be applied to a vegetable
•Calculate the discount if required
•Calculate the final total due after the discount has been subtracted
•Output the slip in the format specified above
Answers
Related Questions
write a program in java for a grocery (fruit shop calculate the prize of bananas @ $.89/kg declaring...
Declare and initialize variables and two arrays in pseudocode
how to write algorithm and pseudocode and how to draw flowchart swap contents of two variables using...
Now that you know how to use numeric data types and variables, let's study the use of text values li...