Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Public static void getLetterGrade This method should take an int as an input/parameter for this method. The goal of the method is for the

image text in transcribedimage text in transcribedimage text in transcribed

1. Public static void getLetterGrade This method should take an int as an input/parameter for this method. The goal of the method is for the user to type in a possible numeric score and print out the related grade that it represents. The letter grade and their related percentage grade can be seen in Table 1. Letter GradePercentage Grade 90-99% 80-89% 70-79% 60-69% Less than 60% Not Valid Table 1: A table showing the letter grade and its related percentage grade Else A case/switch statement should be used to determine what will be printed to the screen (Hint: You should not need a case for every single percentage between 0% to 100%). An example of some possible outputs for this method can be seen in Figure 1. A percentage grade of 73 would be a C. 125 is not a valid percentage grade Figure1: A figure showing possible outputs for getNumericGrade 2. Public static int getGolfScore This method should take in a String as an input/parameter, which will represent the name. Given that String of a card name, the method will use a switch/case statement to return an int value representing how much this card would be worth in a card game of "Golf (yes, this is an actual card game). Table 2 contains a comparison of the card name to the points it would be cost in a round of "Golf". All others should be given the point value of 100 Card NamePoint Value Ace Two Three Four Five Six Seven 4 Nine Ten Jack 10 ueen Kin Joker Table 2: A table showing name of playing cards and their related values in "Golf". 3. Public static String getFullCardName This method should take in a String as an input/parameter, which will represent the notation for a card. The notations for the cards are given in Table 3. Notation Full Name Ace Jack Kin Hearts Clubs 2...10 Two...Ten ueen Diamonds Spades Else Invalid Table 3: A table showing the notation and full names used for playing card. The String input would be situated in the order of card value followed by suite, so "10H" would be "Ten Of Hearts" and "KC" would be "King Of Clubs". To do this, the method should divide the String into two separate strings representing the value and suite. This can be done properly by looking at the length of the String and dividing it accordingly (Hint: Use String class and an "if/else" statement). Once you have two separate strings, create two switch/case statements (one for value, one for suite) to save the full names of the notations as strings and combine them together at the end of the method to create a complete name for the card. This complete name for the card should be returned at the end of the method. 4. Public static main (String Il args) Print out a menu similar to that shown in Figure 2 and save the user's response. Welcome To Switch/Case Practice! Please Choose An Option 1. Determine A Letter Grade From A Percentage 2. Determine The PlayingCard Value Of A Card In 'Golf 3. Determine The Full Name Of An Abbreviated Playing Card Figure 2: A figure showing the possible menu layout of this class. Depending on the option chosen by the user, the program will prompt the user for the necessary information to run the related methods that have been created for this lab. Figure 3 shows potential outputs of Option 1, Figure 4 shows potential outputs of Option 2, and Figure 5 shows potential outputs of Option 3 Numeric Grade Possibilities Enter A Percentage Grade 73 A percentage grade of 73 would be a C. 125 is not a valid percentage grade Numeric Grade Possibilities Enter A Percentage Grade: 125 Figure 3: A figure showing potential outputs for Option 1 from Figure 2. Card Value In Golf Enter The Name Of The Card: Enter The Name Of The Card seven Card Value In Golf: Card Value In Golf Card Value In Golf Enter The Name Of The Card Joker Dlamond Card Value In Golf: 100 Card Value In Golf: Figure 4: A figure showing potential outputs for Option 2 from Figure 2. Card Name From Abbreviation Enter Abbreviation: 9h Full Name: Nine Of Hearts Card Name From Abbreviation Enter Abbreviation AC Full Name Ace of Clubs Card Name From Abbreviation Enter Abbreviation: 11J Full Name Invalid Of Invalid Figure 5: A figure showing potential outputs for Option 3 from Figure 2. a response was taken in that does not indicate any of the three options, output an error message stating "You ave chosen an invalid option", as can be seen in Figure 6 1. Public static void getLetterGrade This method should take an int as an input/parameter for this method. The goal of the method is for the user to type in a possible numeric score and print out the related grade that it represents. The letter grade and their related percentage grade can be seen in Table 1. Letter GradePercentage Grade 90-99% 80-89% 70-79% 60-69% Less than 60% Not Valid Table 1: A table showing the letter grade and its related percentage grade Else A case/switch statement should be used to determine what will be printed to the screen (Hint: You should not need a case for every single percentage between 0% to 100%). An example of some possible outputs for this method can be seen in Figure 1. A percentage grade of 73 would be a C. 125 is not a valid percentage grade Figure1: A figure showing possible outputs for getNumericGrade 2. Public static int getGolfScore This method should take in a String as an input/parameter, which will represent the name. Given that String of a card name, the method will use a switch/case statement to return an int value representing how much this card would be worth in a card game of "Golf (yes, this is an actual card game). Table 2 contains a comparison of the card name to the points it would be cost in a round of "Golf". All others should be given the point value of 100 Card NamePoint Value Ace Two Three Four Five Six Seven 4 Nine Ten Jack 10 ueen Kin Joker Table 2: A table showing name of playing cards and their related values in "Golf". 3. Public static String getFullCardName This method should take in a String as an input/parameter, which will represent the notation for a card. The notations for the cards are given in Table 3. Notation Full Name Ace Jack Kin Hearts Clubs 2...10 Two...Ten ueen Diamonds Spades Else Invalid Table 3: A table showing the notation and full names used for playing card. The String input would be situated in the order of card value followed by suite, so "10H" would be "Ten Of Hearts" and "KC" would be "King Of Clubs". To do this, the method should divide the String into two separate strings representing the value and suite. This can be done properly by looking at the length of the String and dividing it accordingly (Hint: Use String class and an "if/else" statement). Once you have two separate strings, create two switch/case statements (one for value, one for suite) to save the full names of the notations as strings and combine them together at the end of the method to create a complete name for the card. This complete name for the card should be returned at the end of the method. 4. Public static main (String Il args) Print out a menu similar to that shown in Figure 2 and save the user's response. Welcome To Switch/Case Practice! Please Choose An Option 1. Determine A Letter Grade From A Percentage 2. Determine The PlayingCard Value Of A Card In 'Golf 3. Determine The Full Name Of An Abbreviated Playing Card Figure 2: A figure showing the possible menu layout of this class. Depending on the option chosen by the user, the program will prompt the user for the necessary information to run the related methods that have been created for this lab. Figure 3 shows potential outputs of Option 1, Figure 4 shows potential outputs of Option 2, and Figure 5 shows potential outputs of Option 3 Numeric Grade Possibilities Enter A Percentage Grade 73 A percentage grade of 73 would be a C. 125 is not a valid percentage grade Numeric Grade Possibilities Enter A Percentage Grade: 125 Figure 3: A figure showing potential outputs for Option 1 from Figure 2. Card Value In Golf Enter The Name Of The Card: Enter The Name Of The Card seven Card Value In Golf: Card Value In Golf Card Value In Golf Enter The Name Of The Card Joker Dlamond Card Value In Golf: 100 Card Value In Golf: Figure 4: A figure showing potential outputs for Option 2 from Figure 2. Card Name From Abbreviation Enter Abbreviation: 9h Full Name: Nine Of Hearts Card Name From Abbreviation Enter Abbreviation AC Full Name Ace of Clubs Card Name From Abbreviation Enter Abbreviation: 11J Full Name Invalid Of Invalid Figure 5: A figure showing potential outputs for Option 3 from Figure 2. a response was taken in that does not indicate any of the three options, output an error message stating "You ave chosen an invalid option", as can be seen in Figure 6

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Did you cite the sources of the statistics?

Answered: 1 week ago