Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Write a Java program that prompts the user to enter the day of the week as an integer, 0 for Sunday, 1 for Monday,
1. Write a Java program that prompts the user to enter the day of the week as an integer, 0 for Sunday, 1 for Monday, etc, 6 for Saturday. Depending on the input day, produce different inputs as follows:
Input 0, 6; respond : "No service on Weekends."
Input 1 , 2, 5; respond: "Reduced fare in effect."
Input 3, 4; respond: "Full fare in effect."
For any other input, respond: "Incorrect input."
2. What is the value of the logical expression true && true || true && false ?
Linux5:~/CS1/Week6$ java Day Enter the week day as an integer Sun-0, Mon-1, etc., Sat-6): 3 Full fare in effect linux5: /CS1/Week6S java Day Enter the week day as an integer Sun-0, Mon-1, etc., Sat-6): 6 No service on Weekends. linux5: /CS1/Week6S java Day Enter the week day as an integer Sun-0, Mon-1, etc., Sat-6): 2 Reduced fares in effect. linux5: /CS1/Week6S java Day Enter the week day as an integer(Sun-0, Mon-1, etc., Sat-6): 7 Incorrect input Linux5:~CS1/Week6SStep 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