Prompt
Answer
Pseudocode for Admission Charge System
Objective
To create a system that determines and displays the ticket price for three audiences based on their ages.
Input Specification
- Accept age inputs for three individuals.
Ticket Price Structure
- Age 18 and above: RM24.99
- Age 7 to 17: RM19.99
- Age 6 and below: Free
Pseudocode
BEGIN Program
// Initialize an array to hold ticket prices
DECLARE ticketPrices AS ARRAY[3]
// Loop to input ages and calculate ticket prices
FOR i FROM 1 TO 3 DO
// Prompt user for age input
DISPLAY "Enter age of audience " + i + ": "
INPUT age
// Determine ticket price based on age
IF age >= 18 THEN
ticketPrices[i] = 24.99
ELSE IF age >= 7 AND age <= 17 THEN
ticketPrices[i] = 19.99
ELSE IF age <= 6 THEN
ticketPrices[i] = 0 // Free ticket
ELSE
DISPLAY "Invalid age input"
END IF
END FOR
// Display ticket prices for each audience
DISPLAY "Ticket Prices:"
FOR i FROM 1 TO 3 DO
IF ticketPrices[i] = 0 THEN
DISPLAY "Audience " + i + ": Free"
ELSE
DISPLAY "Audience " + i + ": RM" + ticketPrices[i]
END IF
END FOR
END Program
Key Points
- Uses a loop to collect age inputs for three audiences.
- Determines ticket prices based on predefined age categories.
- Displays the calculated prices, indicating a free ticket appropriately.
Description
This pseudocode outlines a ticket pricing system that calculates and displays admission charges for three individuals based on their ages, categorizing them into free, discounted, or full-priced tickets.
More Pseudo Code Generators
Apache Flink Pseudo Code Generator Apache Pig Pseudo Code Generator Azure Data Factory Pseudo Code Generator C/C++ Pseudo Code Generator CouchDB Pseudo Code Generator DAX Pseudo Code Generator Excel Pseudo Code Generator Firebase Pseudo Code Generator Google BigQuery Pseudo Code Generator Google Sheets Pseudo Code Generator GraphQL Pseudo Code Generator Hive Pseudo Code Generator Java Pseudo Code Generator JavaScript Pseudo Code Generator Julia Pseudo Code Generator Lua Pseudo Code Generator M (Power Query) Pseudo Code Generator MATLAB Pseudo Code Generator MongoDB Pseudo Code Generator Oracle Pseudo Code Generator PostgreSQL Pseudo Code Generator Power BI Pseudo Code Generator Python Pseudo Code Generator R Pseudo Code Generator Redis Pseudo Code Generator Regex Pseudo Code Generator Ruby Pseudo Code Generator SAS Pseudo Code Generator Scala Pseudo Code Generator Shell Pseudo Code Generator SPSS Pseudo Code Generator SQL Pseudo Code Generator SQLite Pseudo Code Generator Stata Pseudo Code Generator Tableau Pseudo Code Generator VBA Pseudo Code Generator