Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a complete Java program, which will allow the user to determine if a given point is contained within a rectangle. rectangle is assumed
Write a complete Java program, which will allow the user to determine if a given point is contained within a rectangle. rectangle is assumed to be orthogonal to the coordinate system and defined by two diagonal end points. Example Runs: Fractions and Stuff Enter the bottom left X value: 1 Enter the bottom left Y value: 1 Enter the top right x value Enter the top right Y value 8 : 5 0 (1.1) Prompt the user to enter the lower left x and y values. Prompt the user to enter the upper right x and y values. Prompt the user to enter the x and y values of the point. Display if the point is contained with the rectangle. : 5 : 4 (5.4) (8,5) The Enter the point X value Enter the point Y value The point (5,4) is contained within the specified rectangle If the point entered was 11 3 then the output should be The point (11,3) is not contained with the rectangle Write a complete Java program, which will allow you to play Rock/Paper/Scissors against the computer. The program should start by asking you for your choice of either rock, paper or scissors. At this point the program should randomly generate its own choice (no cheating) and then display the result. For those of you not familiar with the game, the rules are as follows: Rock breaks scissors Scissors cut paper Paper covers rock Equal values Example Runs: Choices are 1: Rock 2: Paper 3: Scissors which do you choose (1,2,3): 1 You picked ROCK and T picked SCISSORS : You win Choices are 1: Rock 2: Paper 3: Scissors which do you choose (1,2,3): 2 You picked PAPER and I picked SCISSORS : (Rock wins) (Scissors wina) (Paper wins) (Tie) Choices are 1: Rock 2: l'aper 3: Scissors RR RP RS Which do you choose (1,2,3) 1 You picked ROCK and I picked Rack We tie Hint: you need to check for 9 possible permutations of the user and computer choices. Assume R is for Rock, P for Paper and S for Scissors. The permutations are: I win PR PP PS SR SP SS
Step by Step Solution
★★★★★
3.39 Rating (161 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started