54.4k views
4 votes
GST calculation program. The following program will ask the user to enter the cost before GST and then calculate the GST (5%) and the total cost including GST. Below is the sample output when you run the code. Fill in the missing code in the program.

Output after you debug and Run
How much does it cost? $ 45.80 GST is $2.29
Total is $48.09

1 Answer

2 votes

Final answer:

This program calculates the GST and the total cost including GST based on the user's input.

Step-by-step explanation:

This program calculates the GST (Goods and Services Tax) and the total cost including GST based on the cost before GST entered by the user.

To calculate the GST, we need to multiply the cost before GST by the GST rate, which is 5% (0.05). This will give us the amount of GST. To calculate the total cost including GST, we add the amount of GST to the cost before GST.

Here is an example of how the program would work:

How much does it cost? $45.80
GST is $2.29
Total is $48.09

User Rdowell
by
7.6k points