Question: Constraints: You shall use the if then else structure. once you have identified the day of the week, you shall not evaluate more days. Things
Constraints:
- You shall use the if then else structure.
- once you have identified the day of the week, you shall not evaluate more days.
Things Needed:
- Pseudocode
- trace table
- flow charts
- your code (ifThenElse.java file)
- Screen shot of code execution
Support information. The following code solves this problem using several if then statements.
1.BEGIN
2. INITAILIZE dayNumber = 0;
3. PROMPT dayNumber
4. READ dayNumber
5. IF ( dayNumber = 6) THEN
6. PRINT Saturday
7. IF ( dayNumber = 7) THEN
8. PRINT Sunday
9. IF ( dayNumber = 5) THEN
10. PRINT Sunday
11. IF ( dayNumber = 3) THEN
12. PRINT Wednesday
13. IF ( dayNumber = 4) THEN
14. PRINT Thursday
15. IF ( dayNumber = 2) THEN
16. PRINT Tuesday
17. IF ( dayNumber = 1) THEN
18. PRINT Monday
19. PRINT "you entered, " dayNumber
20.END
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
