Professional Documents
Culture Documents
Test Guide
Test Guide
if radius >= 0); { missing ( before radius and semi colon after the )
else {
name = keyboard.nextLie();
shares = keybard.nextInt();
System.out.println("The amount paid to purchase " + shares + " shares is $" + priceOfShares
+ ".");
System.out.println("The total amount spent by " + name + " is $" + total + ".");
value1 = keyboard.nextDouble();
value2= keyboard.nextDouble();
System.out.print("Enter the value for the third rainfall: ");
value3 = keyboard.nextDouble();
System.out.println(Safe to travel );
//Create an if statment
if ((0.00<weight)&&(weight<=1.00)) {
System.out.println("The shipping cost for package weighting " + weight + " pounds is 3.50 dollars.");
else if ((weight>1.00)&&(weight<=3.00)) {
System.out.println("The shipping cost for package weighting " + weight + " pounds is 5.50 dollars.");
}
else if ((weight>3.00)&&(weight<=10.00)) {
System.out.println("The shipping cost for package weighting " + weight + " pounds is 8.50 dollars.");
else if ((weight>10.00)&&(weight<=20.00)) {
System.out.println("The shipping cost for package weighting " + weight + " pounds is 10.50
dollars.");
else
Modify the code below so after the dices are shown, it asks for the user if he wants to play another
round and if user says yes, then plays it again. Remember it needs to play the first time and then ask
if he/she wants to play it again.
do {
die1 = rand.nextInt(6) + 1;
die2 = rand.nextInt(6) + 1;
again = keyboard.nextLine();