Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part A: Casino As usual, create a project, class, and write main(- [Project and class names are your choice, make them descriptive.) Therein, do the

image text in transcribed
image text in transcribed
Part A: Casino As usual, create a project, class, and write main(- [Project and class names are your choice, make them descriptive.) Therein, do the following: 1. Generate a random number between 1-13 representing card denomination: 1='Ace', 2="2", 3="3", ..., 10="10", 11="Jack", 12='Queen', 13="King' 2. Generate another random number between 101-104 representing the suit 101="Hearts", 102="Diamonds", 103="Spades', 104="Clubs 3. Print out the numbers and a description of the card as shown in the sample output. Requirements: 1. Write your switch statement to minimize the number of cases. [It can be as few as 4, not counting the default.) 2. Do not include any System.out.println( statements in the if-else or switch statements 3. Use 2 System.out.println( statements 4. Output should be grammatically correct (the article 'an" for "Ace" and "8"; "a" for all other denominations) 5. Do not use anything not covered in class yet (loops, arrays, etc.) Sample Output: Denomination: 1 Suit: 102 You picked an Ace of Diamonds Denomination: 2 Suit: 104 You picked a 2 of Clubs Denomination: 2 Suit: 101 You picked a 2 of Hearts Denomination: 13 Suit: 101 You picked a King of Hearts Denomination: 13 Suit: 101 You picked a King of Hearts art B: AG A person signs up for an account at Acme Explosives (AE) by providing their first and last name, and a password. A usemame will be generated the first 5 letters of their last name + the first letter of their first name (lower case) + a random number between 0-99 (0.9., rogeram 15). If the person's last name is shorter than 5 characters, use their entire last name + first letter + random number According to AE policy, a password is valid If it does not contain their first and last name (regardless of case), and is at least 8 characters long. If the password entered is valid, prompt the user to enter their password (again). If they get it right, say "Welcome, and display their username, otherwise, otherwise printBoom! passwords don't match. If the passwords is invalid, print out an error message (worded exactly as written in the sample output) Sample Output: Name: Donald Duck Password: quack too short Nooo! Invalid password (it must be least 8 characters long, and not contain your name) BBB Name: Grace Hopper Password: quackquack Enter password again: quackquack Welcome, hoppeg22 Name: Bugs Bunny Password: itsabugslife # contains "bugs" Nooo! Invalid password (it must be least 8 characters long, and not contain your name) Name: Colonel Chu Password: ilovewandavision Enter password again: ilovewandavision Welcome, chufc60 # full last name used Name: Colonel Shuttle Password: andcant wait torloki Enter password again: andcant wait torlokil #password mismatch Sorry, passwords don't match

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

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago