You are on page 1of 3

Programming HW 1 MS

Question 1
Three marks:
- Correct declaration (accept REAL and INTEGER)
- Input into a variable (comment only for missing prompt message)
- Output message (Correct message on the same line)

Sample Code:
DECLARE Height : REAL

OUTPUT "Enter your height:"

INPUT Height

OUTPUT "Your height is ", Height


Question 2
Four marks
- Correct declaration of two variables
- Correct input of both variables
- Correct output for the name
- Correct output for the homework mark

Sample code:
DECLARE Name : STRING

DECLARE Mark : INTEGER

OUTPUT "Enter your name:"

INPUT Name

OUTPUT "Enter your homework mark:"

INPUT Mark

OUTPUT "Hello ", Name

OUTPUT "Your homework mark is ", Mark

Question 3
Four marks
- Correct declaration of two variables
- Correct input of both variables
- Correct output for the song name
- Correct output for the artist name

Sample code:
DECLARE Song : STRING

DECLARE Artist : STRING

OUTPUT "Enter the song name:"

INPUT Song

OUTPUT "Enter the artist name:"

INPUT Artist

OUTPUT "Song Details for ", Song

OUTPUT "Artist Name is ", Artist


Question 4
Five from:
- Correct declaration of three variables
- Correct input of all variables
- Correct output for the name
- Correct output for the homework mark
- Correct output for the quiz mark

Sample code
DECLARE Name : STRING
DECLARE HomeworkMark : INTEGER
DECLARE QuizMark : INTEGER
OUTPUT "Enter your name:"
INPUT Name
OUTPUT "Enter your homework mark:"
INPUT Mark
OUTPUT "Enter your quiz mark:"
INPUT QuizMark
OUTPUT "Hello ", Name
OUTPUT "Your homework mark is ", Mark
OUTPUT "Your quiz mark is ", QuizMark

You might also like