Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a complete program reads a shorthand text description of a playing card and prints the longhand equivalent. The shorthand description is the card's

1. Write a complete program reads a shorthand text description of a playing card and prints the longhand equivalent. The shorthand description is the card's rank (2 through 10, J, Q, K, or A) followed by its suit (C, D, H, or S). You should expand the shorthand into the form "Rank of Suit". You may assume that the user types valid input. You must have two methods in addition to the main method. YOU MUST USE APPROPRIATE METHOD NAMES, PROPER INDENTATION, AND CORRECT LOGIC

Main method: Create a Scanner object, call Method 3. No output can be produced in the main. Your main method must only have two lines of code.

Create the Scanner object Call method 3

Method 1: Get the Scanner object as its parameter then this method reads the cards rank and returns its longhand equivalent as a String.

Method 2: Gets the Scanner object as its parameter, this method then gets the suit value form the user and return the long hand form of the suit. .

Method 3: This method gets the Scanner object as its parameter. Then ask the user for the number of the cards that he/she has, create a for loop, within the for loop you must call methods1 and method 2, output the result for the users input.

Your program must work with lower case and upper case letters

Here is the sample execution: How many cards do you have? 2 Enter your cards rank: 9 Enter your cards suit: S Nine of Spades Enter your cards rank: K Enter your cards suit: c King of Clubs

please explain how to do it if you can!

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago