Write an application that reads determines the surface area

Assignment Help JAVA Programming
Reference no: EM13334106

Program 2

You are going to simulate a simple version of a game called Liar Dice.The rules are as follows:

The first player claims a Poker hand (see "Hand Ranks" below for legal calls). When making a claim, a player says what all five dice are, not just the name of the hand. For example, a player should say, "I have a full house: three 4s and two 5s," not simply "I have a full house."

A player does not need to actually have the hand he claims.

His opponent then has a decision to make. She can do one of three things:

  • Claim a higher hand;
  • Roll again (up to two times) and claim a higher hand; or
  • Challenge and lift the screen.

Claiming a Higher Hand

If a player claims a higher hand, her opponent must then choose from one of the three options above.

Rolling Again

A player is entitled to a total of three rolls in a round. After the first roll and before the second, he may set aside any number of dice. (Any dice which are set aside are not revealed to his opponent.)

When a player chooses to rolls again, he must then also claim a higher hand.

After rolling the third time, a player's only choices are to claim a higher hand or lift the screen.

Challenging and Lifting the Screen

When a player challenges a claim and lifts the screen, the round comes to an end. If the challenged player has as good a hand as she claimed, or better, she wins the round. Otherwise, the player making the challenge wins.

Hand Ranks

The possible hands are ranked as follows:

  • Five of a kind, e.g. 4-4-4-4-4
  • Four of a kind, e.g. 2-2-2-2-6
  • Full house, e.g. 6-6-6-1-1
  • High straight, 6-5-4-3-2
  • Low straight, 5-4-3-2-1
  • Three of a kind, e.g. 5-5-5-2-1
  • Two pairs, e.g. 3-3-2-2-4
  • One pair, e.g. 4-4-5-3-1
  • Runt, e.g. 6-5-3-2-1

In this program, you are going to simulate a single hand and give the user the ability to roll again or declare a claim.You will simulate rolling 5 dice and then showing the dice to the player.They can then roll again or make a declaration of their claim.In order to do this, you will need an if statement.I would suggest the following:// print out a choice// 1. Would you like to make a claim?// 2. Would you like to roll again?// user enters 2.// you create an if statement like this:if(answer == 2){// roll again}else{// prompt the user for their claim and then print out their claim and show their hand.}

Program 3

Write an application that reads determines the surface area and volume of a hemisphere and then calculates the radius given a surface area and volume.The first step is to read in the radius from the users and then calculate the surface area and volume. (Please use the Math class). Next, you should prompt from the user a surface area and calculate the radius of the hemisphere. Finally, you should prompt from the user the volume of a hemisphere and calculate the radius of the hemisphere.

Surface area = 3pr^{2}

Volume =(2/3)pr³

Program 4

Write a program that uses the top five countries' National Wealth to calculate the average of those five countries.Then, I would like to see an estimate of the per capita wealth per country as well as the average per capita wealth for those five countries.Please use the format the numbers in currency format.

Reference no: EM13334106

Questions Cloud

How many payments will you have made for the account : You're prepared to make monthly payments of $225, beginning at the end of this month, into an account that pays 10 percent interest compounded monthly.
Awards-memorabilia-honors and degree certificates : awards, memorabilia, honors, and degree certificates on the walls and desk. photographs, cushions, scent diffusers, candles, stuffed animals, and characters around the office.
What fraction of the power is lost in this transmission line : A home receives 1.3kW of electric power from a transformer on a nearby pole. What fraction of the power is lost in this transmission line
Determine what are the prices of the bonds today : Bond X is a premium bond making annual payments. The bond has a coupon rate of 9.2 percent, a YTM of 7.2 percent, and has 17 years to maturity. Bond Y is a discount bond making annual payments.
Write an application that reads determines the surface area : Write a program that uses the top five countries' National Wealth to calculate the average of those five countries.
Explain the overall formation constant for cu(nh3)42 : The overall formation constant for Cu(NH3)42+ is 1.1x1013 at 25oC. What is [Cu2+], in moles per litre, at equilibrium when 8.3 g Cu(NO3)2 is dissolved in 0.500 L of 1.00 mol/L NH3(aq)? Assume that there is no volume change when the Cu(NO3)2 is add..
Computerized production control systems-car rental agencies : What variables might be used to segment lawnmowere, frozen dinners, dry breakfast cereals, soft drinks, industrial sweepers, photocopiers, computerized production control systems, and car rental agencies?
How fast was car going just before the collision : Two cars collide at an intersection. Car A with a mass of 1800kg, is going from west to east, while car B of mass 1400kg, How fast was car A going just before the collision
Evaluate the atomic mass of zinc : Calculate the atomic mass of zinc from the relative peak intensities in the following spectrum. peak intensity for zinc 64 = 100 peak intensity for zinc 66 = 57.4 peak intensity for zinc 68 = 38.6

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a reference class called ctatrain

writing a reference class that consist of the 2nd and 3rd instance variables below. my class should consist of an array of values in the 2nd instance variable

  Java program that computes a ride you took in taxi

Write a java program that computes a ride you took in taxi. The bill computed based on an initial cost plus the taxi charges 0.5 dirham every 0.3 km.

  Rewrite the following method using a while loop

Rewrite the following method using a while loop using an Iterator instead of the For each loop, files is an ArrayList storing String objects, also include ANY addition that you would need to have anywhere in the class.

  Design a course registration system

Create an application which represents a simplified course registration system using ArrayLists and HashMaps.

  Palindrome is a sequence of char that reads backward forwrd

A palindrome is a sequence of characters that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554, and 11611. Write an application called Palindrome.java that asks the user t..

  Write java program to enter number of marks

Write a java program called AverageMark.java. This program should allow the user to enter any number of marks and then display the minimum, maximum & average mark.

  Allows the user to enter students names followed

Write a program that allows the user to enter students names followed by their test scores and outputs the following information(assume that the maximum nmber of students in the class is 50

  Create four classes

Create four classes: Account.java, Checking.java, Savings.java, and AccountArray.java.

  Implement a card game in java

In this assignment, you will be asked to implement a card game. You will need to make several design decisions for your code. It will be expected that all classes you write will utilize the principle of encapsulation.

  How to count number of objects (instances) created

How to count number of objects (instances) Created, use java code and please be descriptive

  Write an application that uses an array

Write an application that uses an Array to store 10 messages of type String. You will store this Array with 10 messages of your choosing.

  Explain calculating average asdouble

EnhancedTestScoreApp.javacompiles, Uses += onscoreCountandscoreTotalfields, UsesMathclass methods to track minimum and maximum scores, Displays minimum and maximum scores at end, ChangedscoreTotaltoint, CastscoreCountandscoreTotaltodoublebefore calcu..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd