Back to marketplace

Writing Algorithms

No description yet. This curated deck is ready for daily study.

Total cards: 9•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (9)

#1
Front (Question)

The three parts to an algorithm:

Back (Answer)

Input Process Output

#2
Front (Question)

Input -

Back (Answer)

Here the user needs to input some data

#3
Front (Question)

Process

Back (Answer)

Here you’ll need to perform some form of process on your data e.g perform a calculation, perform a condition or check on your data)

#4
Front (Question)

Output

Back (Answer)

Output something to the user

#5
Front (Question)

Algorithm used to calculate the price of an item with a 10% off discount

Back (Answer)

price = input(“Please enter the process of the product: “) INPUT new_price = price * 0.9 PROCESS print(new_price) OUTPUT

#6
Front (Question)

Write an algorithm that: 1. Allows the user to input the base and height of a triangle 2. Calculates the area of the triangle 3. Outputs the area of the triangle

Back (Answer)

• height = input(“Enter the height: “) • base = input(“Enter the base: “) • area = (base * height) / 2 • print(area)

#7
Front (Question)

A company wants to create a program that alerts the user to the freeing and boiling points of water. The boiling point of water is 100 degrees Celsius, and the freezing point of water is 0 degrees Celsius. Write an algorithm that: • Allows the user to input the temperature of the water • Calculates whether the water is boiling, freezing, or neither • Outputs appropriate messages to the user

Back (Answer)

INPUT - - water = input(“Input the temperature of the water: “) PROCESS - - if water > 100 then - elseif water <= 0 then - else - endif OUTPUT - - print(“The water is at boiling point”) - print(“The water is at freezing point”) - print(“The water isn’t not boiling or freezing”)

#8
Front (Question)

A parcel tracking company want to create a program to check whether an inputted parcel number is the required 8 characters or not. If a parcel number is 8 characters it should output the message ‘VALID’, otherwise it should output the message ‘INVALID’. Write an algorithm that: • Allows the user to input the parcel number • Calculates whether the parcel number is 8 characters or not • Outputs appropriate messages to the user

Back (Answer)

INPUT - - parcel = input(“Enter the parcel number: “) PROCESS - - if parcel.length == 8 then - else - endif OUTPUT - - print(“VALID”) - print(“INVALID”)

#9
Front (Question)

A student wants to create a program using a function. The aim of the program is to return the day of week based on its number e.g. Monday = 1, Tuesday = 2 etc. up to Sunday = 7. Write an algorithm that: • Creates a function named DayOfWeek and takes the number of the day as a parameter • Calculates what day is outputted for each number • Returns the day of the week

Back (Answer)

INPUT - function DayOfWeek (number) endfunction PROCESS - if number == 1 then elseif number == then (up to 7) else endif OUTPUT - day = “Monday” day = “Tuesday” (up to Sunday) return day