Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started