Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a pseudocode before and after that, write a code using repl.it. Java In the game Blackjack players get two cards to start with. Then

Write a pseudocode before and after that, write a code using repl.it.

Java

In the game "Blackjack" players get two cards to start with. Then they are asked if they want more cards. Players can continue to take as many cards as they like. The goal is to get close to 21 without going over. If the total is greater than 21 we say the player "busted".

Write a command line game that plays a simple version of blackjack. The program should generate random numbers between 1 and 10 each time the player gets a card. It should keep a running total of the players cards, and ask the player whether or not it should deal another card. Sample output for the game is written below. Your program should produce the same output.

> First cards: 3, 2

> Total: 5

> Do you want another card? (y/n): y

> Card: 6

> Total: 11

> Do you want another card? (y/n): y

> Card: 7

> Total: 19

> Do you want another card? (y/n): n

Here is another sample run

> First cards: 10, 2

> Total: 12

> Do you want another card? (y/n): y

> Card: 6

> Total: 18

> Do you want another card? (y/n): y

> Card: 7

> Total: 25

> Busted.

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_2

Step: 3

blur-text-image_3

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

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

10. Why have centrally planned economies failed? LOP8

Answered: 1 week ago

Question

Recognize examples of linguistic profiling in the workplace

Answered: 1 week ago

Question

=+ b. What is the per-worker production function, y = f(k)?

Answered: 1 week ago