$10.00 basic conversions
- From Computer-Science: General-CS
- Closed, but you can still post tutorials
- Due on Oct. 20, 2009
- Asked on Oct. 17, 2009 at 10:05:16AM
Q:import java.util.Scanner;
public class BasicConversions{
public static void main(String[] args){
/* There are four exercises to complete. Instructions for completing these are indicated in the comments above each
The comments below each exerice will indicate the correct output.
Your job is to fill in the code to generate that ouput. Each exercise should output on a separate line. Good luck! *//****EXERCISE 1:
Complete this code to perform the arithmetic of a*b=c below. The answer should be stored in the variable named c */int a,b,c;
a=5;
b=6;
System.out.println("Exercise 1: " + c);
//The exercise should output "Exercise 1: 30" to the console
/****EXERCISE 2:
Complete the code below to output the variable cashMoney in dollar format. */Double cashMoney= 2.39;
//The exercise should output "Exercise 2: $2.39" to the console
/****EXERCISE 3:
Complete this code to perform the arithmetic below. The answer should be stored in a variable named total */int hours=5;
Double rate=13.49;
//The exercise should output "Exercise 3: $67.45" to the console
/****EXERCISE 4:
Complete the code below to input and output from a prompt */Scanner in = new Scanner(System.in);
String myName=new String();System.out.println("Please enter you name:\n");
myName=in.nextLine();//The exercise should output "Exercise 4: yourname" to the console, where yourname is the name input by the user */
} //end class Main
} //end class BasicConversions



