A flowchart needs to display the message "Enter your age" and receive the user's response. Which flowchart symbol should be used to receive the age?
Input/output parallelogram.
Fill in the blank.
Counter ← 1
WHILE Counter <= 5
OUTPUT Counter
Counter ← _____
ENDWHILE
Answer: Counter + 1
Design an algorithm (pseudocode is fine for this, just two lines of it) that asks the user to enter their name and then displays:
Welcome, Chris!
INPUT Name
OUTPUT "Welcome, ", Name
What is the only mammal capable of true flight?
Bat
A flowchart uses a parallelogram for Total ← Price × Quantity.
What should the shape be?
Rectangle, because this is a processing operation requiring you to do some sort of calculation/updating a variable.
An algorithm accepts a test score and outputs a grade.
80 or above
A
70–79
B
60–69
C
Below 60
F
Complete the pseudocode:
INPUT Score
IF Score >= 80 THEN
OUTPUT "A"
ELSEIF Score >= _____ THEN
OUTPUT "B"
ELSEIF Score >= _____ THEN
OUTPUT "C"
ELSE
OUTPUT "F"
ENDIF
70, 60
An algorithm receives five numbers and must calculate their total. What three variables or values are needed?
Answer: A counter, an input number, and a running total.
What is the capital of Australia?
Canberra
A flowchart performs the following instructions:
Set X ← 3
Output X
Add 2 to X
Check whether X is less than or equal to 9.
If YES, repeat from step 2. If NO, stop.
What numbers are output?
Answer: 3, 5, 7, 9.
The algorithm must identify numbers divisible by both 2 and 5. Fill in the blanks. Use a variable called number in your response.
IF ___________ AND
____________ THEN
OUTPUT "Valid"
ENDIF
Number MOD 2 = 0
Number MOD 5 = 0
Design an algorithm that accepts a number and determines whether it is positive, negative, or zero.
Precise pseudocode not needed, but I want to see logical steps that need to be taken.
INPUT Number
IF Number > 0 THEN
OUTPUT "Positive"
ELSE
IF Number < 0 THEN
OUTPUT "Negative"
ELSE
OUTPUT "Zero"
ENDIF
ENDIF
Which ancient civilization built Machu Picchu?
Incas
A flowchart calculates the average of five entered numbers. It uses:
Total ← 0
Counter ← 1
Repeat while Counter < 5
Input Number
Total ← Total + Number
Counter ← Counter + 1
Average ← Total / 5
Identify the error
Counter < 5 only processes four numbers. It should be Counter <= 5.
Question: Identify the error and correct the missing logic.
Total ← 0
FOR Number ← 1 TO 10
IF Number MOD 2 = 0 THEN
Total ← Number
ENDIF
NEXT Number
OUTPUT Total
The program replaces Total each time instead of accumulating the values.
Correct statement:
Total ← Total + Number
A school needs an algorithm to check the grades of 10 students.
The algorithm must:
Accept each student's test score.
Use a procedure called CheckGrade that receives the student's score as a parameter.
Output "Pass" if the score is 50 or higher.
Output "Fail" if the score is below 50.
Question: How should the main algorithm and the procedure work together? Identify the parameter and explain when the procedure should be called. State how many times this procedure needs to be called and what value is being checked in the decision making process.
The main algorithm uses a loop to input 10 scores.
Each score is passed to the CheckGrade procedure.
The parameter is the student's score.
The procedure uses an IF/ELSE decision to determine whether the student passes or fails.
The procedure is called 10 times, once for each student.
How many minutes are there in two weeks 1 hour 30 minutes and 30 seconds?
Answer: 20,250.50 minutes
The School Attendance Algorithm
A school needs an algorithm to process attendance for 20 students.
The algorithm must:
Accept each student's attendance status (P for present or A for absent).
Count the total number of students present.
Count the total number of students absent.
Calculate the percentage of students present.
Output all three results.
Question: Design an algorithm using appropriate inputs, variables, selection, iteration, and outputs.
Pseudocode recommended, but I really just want you to write out the logical steps that need to be taken and any appropriate checks, processes or calculations needed.
Present ← 0
Absent ← 0
FOR Counter ← 1 TO 20
INPUT Status
IF Status = "P" THEN
Present ← Present + 1
ELSE
IF Status = "A" THEN
Absent ← Absent + 1
ENDIF
ENDIF
NEXT Counter
Percentage ← (Present / 20) * 100
OUTPUT "Present: ", Present
OUTPUT "Absent: ", Absent
OUTPUT "Percentage Present: ", Percentage, "%"
What is the study of the origin and history of words called?
Etymology