Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using Scanner to help you decide what to do this weekend. There is enough information in the narrative paragraph to do this

image text in transcribed
image text in transcribed
Write a program using Scanner to help you decide what to do this weekend. There is enough information in the narrative paragraph to do this prograrn. Converting a narrative (story) into a program is required to become a programmer, Using that information to complete the table. The narrative : Imagine you only ever do three things at the weekend: go shopping, watch a movie, or just stay at home, Which of these you do depends on three things: the weather (good or bad); how much money you have (rich or poor), and whether your parents are visiting. You say to yourself: If my parents are visiting and the weather's bad, we'll stay in. If they're visiting and the weather's good, we'll go to the cinema. If they're not visiting and I'm poor, I'll stay in. If they're not visiting and the weather is good and I'm rich, Fil 9 shopping. Otherwise, IIl go to the cinema. Create a program that asks whether the parents are visiting, whether the weather is good and whether you are rich or poor. Your program should print "go to the dinerna" "go shopping" or "stay in" as appropriate. Hint: There are two possibilities for the "Parents visiting?" question, two for the "is weather good?" question, and two for the "are you rich?" question. That gives eight possible cases: The problem can be solved by testing a lot fewer cases than B, but if you get confused, the full 8 case solution might provide a way to understand all of the possibilities. Note: Since we haven't covered String processing yet, I suggest giving the user instructions such as "Enter 1 for yes, 2 for no' when asking the various questions. That will let you use integers internally, which should make the prograrn easier

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

Oracle Database Upgrade Migration And Transformation Tips And Techniques

Authors: Edward Whalen ,Jim Czuprynski

1st Edition

0071846050, 978-0071846059

More Books

Students also viewed these Databases questions

Question

3. It is the commitment you show that is the deciding factor.

Answered: 1 week ago

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago