Answered step by step
Verified Expert Solution
Link Copied!

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."

image text in transcribed

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/Week6S

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

2. Outline the functions of nonverbal communication

Answered: 1 week ago