CompSci Y08 Spr1 Flashcards
1.1 What is input?
Input is where the user enters data. This could be the user typing data in.
1.2 What is output?
Output is where the program shows the user data. This could be a message on screen.
1.3 How do you make the program output the message “Hello world”?
Console.Writeline(“Hello world.”)
1.4 What command is used to make the program let a user type in data?
Console.Readline()
2.1 What is a variable?
In a computer program, a variable is used to store data.
2.2 How do you make the program store the user’s input?
name = Console.Readline() will store the user’s input in a variable called ‘name’.
2.3 How do you output the contents of a variable?
Console.Writeline(name) will output the data held in the variable ‘name’.
3.1 What is selection?
Selection is where a program checks a criteria, and the program responds accordingly.
3.2 What is a criteria?
The criteria is the check which the program performs.
3.3 What does the word criteria mean?
The criteria is what the program checks to see if it is the case. For example: score > 10
3.4 How would you make a program show “Well done” if the variable score is above 10?
If score > 10 then Console.Writeline(“Well done”)
Endif
3.5 What does the command “ElseIf” do?
allows additional criteria to be checked.
3.6 What does “Else” do?
This tells the program what to do if none of the criteria have been met.
4.1 What is iteration?
Iteration is makes commands repeat.
4.2 What are the two types of iteration?
definite iteration and indefinite iteration.