Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is a JAVA code please post a copy of the code so I can run it on my computer. the simpler the code the

image text in transcribed

this is a JAVA code please post a copy of the code so I can run it on my computer. the simpler the code the better. thank you in advance for your help!

Write a program using Scanner to help you decide what to do this weekend. Decision Trees Imagine you only ever do three things at the weekend: go shopping, watch a movie, or just stay in. What 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 your yourself: if my parents are visiting we'll go to the cinema. If they're not visiting and the weather's good and I'm rich, then I'll go shopping. If they're not visiting, and the weather's good and I'm poor, then I will go to the cinema. If they're not visiting and the weather is bad and I'm rich, I'll go to the cinema, if they're not visiting and the weather is bad and I'm poor, I'll stay in. Create a program asking whether the parents are visiting whether the weather is good, and whether you are rich or poor. Your program should print go to the cinema 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 Truth Table for Did You Ever Have to Make Up Your Mind? Are parents visiting is the weather good? Are you rich? What you do yy y y > - > - - > - n The problem can be solved by testing a lot fewer cases than 8, but if you get confused, the full 8 case solution might provide a way to understand all of the possibilities. Grading Elements Program uses nested if statements to separate various Cases Program displays the correct action Program displays exactly one action per run

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

Students also viewed these Databases questions

Question

5. Understand how cultural values influence conflict behavior.

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago