Program to compute Tip percentage
The program to calculate the 15 percent tip on the price of the meal is given below:
Pseudocode:
In the program, we first declare the variables MealPrice and Tip of Float type. We prompt the user to enter the price of the meal using Write statement.
// declare variables
Declare MealPrice, Tip As Float
The value is read and stored in variable MealPrice using Input statement.
// prompt the user to enter price of the meal
Write "Enter the price of the meal: "
// read and store the input in variable MealPrice
Input MealPrice
We compute the value of tip on the price by multiplying the value stored in MealPrice by 0.15 and assign the computed value to variable Tip.
// compute the value of tip and store in variable Tip
Set Tip = MealPrice * 0.15
Lastly, the computed value of tip is displayed using Write statement.
// display the calculated value of tip
Write "The 15 percent tip of the meal is: " + Tip