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

Help pseudocode and raptor flowchart. You will ask the user for how many package

ID: 3851687 • Letter: H

Question

Help pseudocode and raptor flowchart. You will ask the user for how many packages and then determine what the discount percentage will be. Once you determine the discount percentage then calculate the total amount of the sale after the discount. Each item is priced at $99 dollars. So if I buy 30 items at $99 each, that qualifies me for a discount percentage of 30% ( or .30). My original sales amount is 30 * 99 or $ 2970 then I get a 30% discount or $ 891 (2970 * .30). then I subtract the discount from the original sales amount ( 2970 - 891 ) for a final total amount of $ 2079.

is pseudoecode okay ?

// Declaring variables
Declare Integer numberOfPackages
Declare discount
Declare total

//Display number of package purchased
Display “ Please enter the number of packages purchased.”
Input numberOfPackages

//Verify the discount of the purchase
If numberOfPackages >= 1 And numberOfpackages <= 9
Then

Set discount = ( numberOfpackages * 99) *0.1
Else If numberOfPackages >= 10 And numberOfpackages <=19
Then

Set discount = (numberOfPackages * 99) *0.2
Else If numberOfPackages >=20 And numberOfPackages<=30
Then

Set discount = (numberOfPackages*99)*0.3

Else
Set discount = 0
End If

//Calculate the total amount
Set total = ( numberOfPackages * 99) +discount

Display “Discount of purchase is $”, discount
Display “Grand total is $”, total

Explanation / Answer

The answer is as follows:

The given pseudocode is as follows:

// Declaring variables
Declare Integer numberOfPackages
Declare discount
Declare total
//Display number of package purchased
Display “ Please enter the number of packages purchased.”
Input numberOfPackages
//Verify the discount of the purchase
If numberOfPackages >= 1 And numberOfpackages <= 9
Then
Set discount = ( numberOfpackages * 99) *0.1
Else If numberOfPackages >= 10 And numberOfpackages <=19
Then
Set discount = (numberOfPackages * 99) *0.2
Else If numberOfPackages >=20 And numberOfPackages<=30
Then
Set discount = (numberOfPackages*99)*0.3

Else
Set discount = 0
End If
//Calculate the total amount
Set total = ( numberOfPackages * 99) +discount

Display “Discount of purchase is $”, discount
Display “Grand total is $”, total


The psedocode has some things to be looked into:

1.The way discounts have been defined for different amount of purchases is not very clearly deifined in the problem statement but the peudocode has assumed certain things. So the dicount calculations can not be verified completely.

2.Secondly the as per the problem statement, discount needs to be subtracted from the original sales amount to get the final total amount but in the pseudocode the final total amount is calculated with discount added to the original sales amount. So there is a bit confusion in that calculation.