Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*JAVA* Daily chores are specified in the table mentioned below with one character each representing a day and the chores for that day. Write a

*JAVA*

Daily chores are specified in the table mentioned below with one character each representing a day and the chores for that day. Write a program that, given a single character input, will print the day and chores to be performed on that day. If the character is not one of the pre-specified one, the program should print You have entered an invalid input. You may assume that a user will only enter a single character as an input. Your program should be case in-sensitive i.e. both M and m are correct inputs. (a) Use an if/else statement (b) Using a Switch statement

SR Input Day Chore message

1 M Monday Today's Monday. Take out Garbage.

2 T Tuesday Today's Tuesday. Move car.

3 W Wednesday Today's Wednesday. Recycle bag out.

4 J Thursday Today's Thursday. No chore.

5 F Friday Today's Friday. Take garbage out.

6 Any other input You have entered an invalid input.

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_2

Step: 3

blur-text-image_3

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

Why would you want to work in digital Marketing?

Answered: 1 week ago

Question

Identify five strategies to prevent workplace bullying.

Answered: 1 week ago