Your Perfect Assignment is Just a Click Away

Starting at $8.00 per Page

100% Original, Plagiarism Free, Customized to Your instructions!


CSC 243 University of Pennsylvania Write a Java Program Java Coding Task

CSC 243 University of Pennsylvania Write a Java Program Java Coding Task

Question Description

Write a Java program that will allow a user to play one hand of the card game Blackjack, orTwenty-One, as its sometimes known. The rules, for the purpose of this assignment, are asfollows:Blackjack rules:? The game is played with a deck of standard paying cards.? A player is dealt 2 cards to start the “hand”? A player’s score is the sum of the value of all cards in their hand, where:o Cards numbered 2 through 10 are worth their numerical valueo Picture cards (Jack, Queen, King) are worth 10 pointso Aces are worth either 1 or 11 points? The player then has the choice to “hit” or “stand”o If the player “stands”, their turn is finishedo If the player “hits”, they are dealt another card and the score is updated? Play continues until the player “stands”, gets 21, or “busts” (see below)o The current score is then final? The object is to get 21, or as close as possible, without going over? If the final score is over 21, the player “busts”, i.e. loseso Initially, an ace is valued at 11, but…o if an 11 would lead to a “bust”, it is re-valued at 1? If the player gets 21 with the first 2 cards (i.e. an Ace and a card worth 10), they have“Blackjack”Normally, Blackjack is played competitively, where hands are dealt to both players and thedealer in a casino. Bets are placed and the players attempt to outscore the dealer, therebywinning their bet. In this assignment, we will only deal one player’s hand (no dealer, no bets).Assignment Description:For this assignment, we will associate each card in a standard playing deck with an integer “id”code having a value ranging from 0 to 51. Each card will also be represented with a 2 characterstring of the form “RS” where R is the rank and “S” is the suit. The rank and the suit can bedetermined using the following arrays and formulas:String[] ranks = {“A”, “2”, “3”, “4” ,”5″, “6”, “7”, “8”, “9”, “10”, “J”, “Q”, “K”};String[] suits = {“S”, “H”, “C”, “D”};R= id % 13; // the one character string containing the card rankS= id / 13 // the one character string containing the card suitThus for an id == 31, the 2 character card string is “6C”, representing the six of clubsCreate a Java class called Assignment1. Include a main() method in which one hand ofBlackjack will be played. The program should, in main(), deal the first two cards and displayboth the cards in the hand (a string) and the score. Then, ask the player to hit or stand,continually displaying the result with each hit until the player stands, gets 21 (or blackjack), orbusts. Display the final result and exit.The main routine should contain two arrays as follows:int deck[52]; // contains the integer id codes for all cards in the deckint hand[12]; // contains the integer id codes for the cards in the player’s handNote that, before starting play, the deck should be populated with the 52 card id’s and shuffled(the cards randomly arranged) using the shuffling routine provided below. Cards are then “dealt”in order from the array and added to the player’s hand. The number of cards in the player’shand will need to be tracked and updated as the game progresses.Write the following methods for the Assignment1 class and use them to play the game in main().

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.