Mrs. Jessy teaches her 7-year-old daughter to tell the day of a week when jessy tells a number between 1 to 7. Implement this scenario and generate an algorithm for the same.
Answers
Answered by
35
Step-by-step explanation:
Start
Enter the input x from 1 to 7
define a matrix
y = Monday if x =1
y = tuesday if x=2
y =Wednesday if x =3
y = thursday if x = 4
y = friday if x = 5
y = Saturday if x = 6
y = Sunday if x = 7
Print Y
End
Answered by
22
Answer:
Step-by-step explanation:
Algorithm for Predicting Days:
START
1. Take the number from the User's.
2. If the number is equal to 1 then, tell it's Sunday.
3. If the number is equal to 2 then, tell it's Monday.
4. If the number is equal to 3 then, tell it's Tuesday.
5. If the number is equal to 4 then, tell it's Wednesday.
6. If the number is equal to 5 then, tell it's Thursday.
7. If the number is equal to 6 then, tell it's Friday.
8. If the number is equal to 7 then, tell it's Saturday.
END
Similar questions