Question: Assignment 8.1: Jokes (10 pts) Write a program to ask a user whether (s)he wants to hear a bad joke. If the user indicates no,

Assignment 8.1: Jokes (10 pts)

Write a program to ask a user whether (s)he wants to hear a bad joke. If the user indicates no, the program should quote Mae West, a classic Hollywood actress, who was famous for her amusing one-liners.

Between two evils, I always pick the one I never tried before.

-Mae West

If the user indicates yes, the program should print out the computer joke:

"Q: Why did the computer get cold? A: Because it forgot to close Windows."

Your program should work identically to the example output below.

Note that your output should display the "" around the jokes.

Note that you are required to use exactly one if statement and one else statement to receive full credit on this assignment. (No else if needed!)

Submit Joke.java to Canvas when you are finished.

Example Output:

Want to hear a bad joke (yeso)? no

Okay. I will tell you a good one:

Between two evils, I always pick the one I never tried before.

- Mae West

Alternately,

Want to hear a bad joke (yeso)? yes

"Q: Why did the computer get cold? A: Because it forgot to close Windows."

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!