Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java HomeWork

eltom117
eltom117 


5 Java applications Attachments Tags Clarifications

Answers

Assignment 7 - Solution

dickersonka
dickersonka 



Attached is the solution to Assignment 7 including source and comments Attachments
Assignment7.zip (3 K) Download
Preview
java.util.Random; import java.util.Scanner; public class CoinTossing { //coin enum enum Coin{ HEADS, TAILS } public static void main(String[] args){ Scanner input = new Scanner(System.in); String choice = ""; int numHeads = 0, numTails = 0;

Preview
System.out.print("Do you want to play again? (Y / N): "); //get choice choice = input.nextLine(); } } private static void makeGuesses(int number){ //Set to true after user guesses number boolean winner = false; //Continue looping until the player

Preview
= minimum3(f1, f2, f3); System.out.println("The minimum is: " + minimum); } /** * Calculates minimum of 3 floats * @param f1 float 1 * @param f2 float 2 * @param f3 float 3

Preview
charges: " + charge); System.out.println("Total charges: " + total); System.out.println(); } }while(!sHours.equalsIgnoreCase("q")); } /** * Calculates parking charges for hours * @param hours Hours parked * @return Charge for parking */ private static double calculateCharges( double hours )

Preview
Scanner input = new Scanner(System.in); //prompt celsius System.out.print("Enter temperature to convert to fahrenheit: "); String sTemp = input.nextLine(); Double temp = Double.parseDouble(sTemp); //convert to fahrenheit System.out.println("Fahrenheit = " + fahrenheit(temp)); //prompt fahrenheit System.out.print("Enter temperature to

Screenshots
Purchase Answer