Professional Documents
Culture Documents
• Input:
• Item name
• Process:
• Determine the discount based on the item name using a SWITCH CASE statement.
• Output:
• Display the item name, original price, discount percentage, and the new price.
Algorithm:
3. Calculate the discount amount: Discount Amount = Original Price * Discount Percentage
4. Calculate the new price: New Price = Original Price - Discount Amount.
5. Display the item name, original price, discount percentage, and the new price.
START
Input item_name;
Input original_price;
SWITCH (item_name);
discount_percentage = 0.06;
discount_percentage = 0.12;
discount_percentage = 0.05;
DEFAULT:
ENDSWITCH
Display item_name;
Display original_price;
Display discount_percentage;
Display new_price;
END
IPO (Input, Process, Output):
• Input:
• Process:
• Use a WHILE statement to input the number of patients for each month and accumulate
the total.
• Output:
• Display the average number of patients registered in Dr. Ruz's clinic in 2022.
Algorithm:
• Increment month by 1.
5. Display average_patients.
START
Enter patients_registered;
Display average_patients;
counter++;
ENDWHILE
END