Pseudo Code Generator

Admission Charge System Pseudocode

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.


Empty image or helper icon

Prompt

An admission charge for Ice Age: Dawn of the Dinosaurs Movie varies according to the age of 
the person. Develop a system to display the ticket price given the age of the person. Input 
age of the THREE (3) audiences using looping. Then check and display the ticket price based 
on the THREE (3) ages entered. The charges are as follows:
Age Ticket Price 
18 and above RM24.99
7 until 17 RM19.99 
6 and below Free

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.

Create your Thread using our flexible tools, share it with friends and colleagues.

Your current query will become the main foundation for the thread, which you can expand with other tools presented on our platform. We will help you choose tools so that your thread is structured and logically built.

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.