Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

56% Mon 4:32 PM Q Search October 20, 2017 at 11:19PM Learning objectives The learning objectives of this assignment are, as in Big Java: 1.

image text in transcribed
56% Mon 4:32 PM Q Search October 20, 2017 at 11:19PM Learning objectives The learning objectives of this assignment are, as in Big Java: 1. To implement decisions using if statements 2. To write statements using the Boolean primitive data type 3. To compare strings and/or characters 4. To write loops using while or for Representing playing cards and hands of cards An individual playing card is represented as a string of two characters so that the first character is me rank 23456789TJOKA", and note that 10 is encoded as letter T to make all card ranks to be single letters) and the second character is the suit (from cahs for clubs, diamonds, hearts and spades respectively).For example, "Jd* would be the jack of diamonds, and 4s" would be the four of spades A hand made up of multiple cards is given as sting enoeing all those ards consecutively reamei-sina air, card hand that happens to have one spade and four hearts. Note that the cards can be listed inside the string in any order, not necessarily sorted by suit or rank. The suits and ranks are also case sensitive, with the rank always given as a digit or an uppercase letter, and the sut atways given as a lowercase letter from the four possible letters eohs Class and methods to write in this assignment Write the class AssignmentOneF17 (the class must be named exactly that ) whose main method repeetedly reads from the console a five card poker hand, given as ten-character string as described above, or the word 'quit" to exit the program. Given the hand, the program should identily what kind of poker hand the user enters, and print the type of hand on the console. There are five types of hands that your program should recognize: pair, three of a kind, fiush, full house, and four of a kind Your program can assume that each input is a legal five-card poker hand from one of five possibilities, or the word "quit, so your program does not need to recognize and recover from illegal inputs An example run of the program might look like the following, with the user input in italics ts) Qs7s2s4s5s flush 7hBhKsTs8s pair 2h4d2d4s4c full house KsKhKc8sKd four of a kind 3s9hTh9s9d three of a kind quit Your program should print only the answers exactly the same way as user, to allow our automated testing of your progra hand that it reads in, so that its ines of output match those expected by our automated tester the previous example, but not any kind of prompt for the human am. Make sure that your program will print exactly one line of output for each

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

What is OSI?

Answered: 1 week ago

Question

How do members envision the ideal team?

Answered: 1 week ago