Submit pseudocode and a flowchart for the following programming exercise:

Software Sales

A software company sells a package that retails for $99. Quantity discounts are given according to the following table:

Quantity Discount
10-19 20%
20-49 30%
50-99 40%
100 or more 50%

Design a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount.

Please post your attempt.

popp

Here's the pseudocode for the Software Sales program:

1. Prompt the user to enter the number of packages purchased.
2. Read and store the number of packages purchased in a variable called "quantity".
3. Set the discount rate for 10-19 packages to 0.20, for 20-49 packages to 0.30, for 50-99 packages to 0.40, and for 100 or more packages to 0.50.
4. If the quantity is between 10-19, calculate the discount amount by multiplying the retail price ($99) by the discount rate.
5. If the quantity is between 20-49, calculate the discount amount by multiplying the retail price by the discount rate.
6. If the quantity is between 50-99, calculate the discount amount by multiplying the retail price by the discount rate.
7. If the quantity is 100 or more, calculate the discount amount by multiplying the retail price by the discount rate.
8. Calculate the total amount of the purchase after the discount by subtracting the discount amount from the total retail price (quantity * $99).
9. Display the amount of the discount (if any) and the total amount of the purchase after the discount to the user.

And here's the flowchart representation:

```
Start
|
V
Enter the number of packages purchased
|
V
Read and store the quantity in a variable called "quantity"
|
V
Set the discount rate for 10-19 packages to 0.20
|
V
Set the discount rate for 20-49 packages to 0.30
|
V
Set the discount rate for 50-99 packages to 0.40
|
V
Set the discount rate for 100 or more packages to 0.50
|
V
If quantity is between 10-19
|
V
Calculate the discount amount: discount = quantity * $99 * 0.20
|
V
Calculate the total amount of purchase after discount: total_amount = (quantity * $99) - discount
|
V
Display the amount of the discount and the total amount of purchase after discount
|
V
Stop
```

Note: The flowchart should also include additional decision points and calculations for the other quantity ranges (20-49, 50-99, 100 or more) as mentioned in the pseudocode.

Sure! Here is the pseudocode for the given scenario:

1. Start
2. Declare the constant "retailPrice" as 99
3. Declare variables "quantity", "discount", and "totalAmount"
4. Input the value of "quantity" from the user
5. If the quantity is between 10 and 19 (inclusive), set "discount" to 20
6. If the quantity is between 20 and 49 (inclusive), set "discount" to 30
7. If the quantity is between 50 and 99 (inclusive), set "discount" to 40
8. If the quantity is 100 or more, set "discount" to 50
9. Calculate the "totalAmount" by subtracting the product of "quantity" and "retailPrice" multiplied by "discount" divided by 100 from the product of "quantity" and "retailPrice"
10. Output the value of "discount" and "totalAmount"
11. End

And here is the corresponding flowchart:

```
+--------------+
| Start |
+--------------+
| Declare |
| retailPrice |
| Declare |
| quantity |
| Declare |
| discount |
| Declare |
| totalAmount |
+--------------+
|
|
v
+--------------+
| Input |
| quantity |
+--------------+
|
|
v
+--------------+
| If |
| quantity |
| >= 10 and |
| quantity |
| <= 19 |
| then |
| discount |
| = 20 |
+--------------+
|
|
v
+--------------+
| If |
| quantity |
| >= 20 and |
| quantity |
| <= 49 |
| then |
| discount |
| = 30 |
+--------------+
|
|
v
+--------------+
| If |
| quantity |
| >= 50 and |
| quantity |
| <= 99 |
| then |
| discount |
| = 40 |
+--------------+
|
|
v
+--------------+
| If |
| quantity |
| >= 100 |
| then |
| discount |
| = 50 |
+--------------+
|
|
v
+---------------+
| Calculate |
| totalAmount|
+---------------+
|
|
v
+--------------+
| Output |
| discount |
| totalAmount |
+--------------+
|
|
v
+--------------+
| End |
+--------------+
```

This pseudocode and flowchart represent the logic and steps required to calculate the discount and total amount for the given quantity of packages purchased. However, please note that the actual implementation may vary depending on the programming language used.