Computer Science
Write an algorithm that performs the following:
Ask a user to enter a number.
If the number is between 5 and 15, write the word GREEN.
If the number is between 15 and 25, write the word BLUE.
If the number is between 25 and 35, write the word ORANGE.
If it is any other number, write that ALL COLORS ARE BEAUTIFUL.
Algo & Flowcharts
3 Likes
Answer
Step 1: INPUT number
Step 2:
IF number is between 5 and 15 THEN
PRINT "GREEN"
ELSE IF number is between 15 and 25 THEN
PRINT "BLUE"
ELSE IF number is between 25 and 35 THEN
PRINT "ORANGE"
ELSE
PRINT "ALL COLORS ARE BEAUTIFUL"
Answered By
2 Likes
Related Questions
Write an algorithm to find the greatest among two different numbers entered by the user.
"Decomposition leads to simplicity." How?
Write an algorithm that accepts four numbers as input and find the largest and smallest of them.
Write a pseudocode that will perform the following:
(a) Read the marks of three subjects: Computer Science, Mathematics and Physics out of 100.
(b) Calculate the aggregate marks.
(c) Calculate the percentage of marks.