Question
Asked by:
carmmanrique
carmmanrique
Rating : No Rating
Questions Asked: 4
Tutorials Posted: 0
 

$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  

 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
chetan2009
chetan2009
Rating (146): A
Questions Asked: 0
Tutorials Posted: 464, earned $2,832.42
 

$5.00 Complete solution, A++ guranteed

  • This tutorial hasn't been purchased yet.
  • Posted on Oct. 17, 2009 at 10:35:42AM
A:
Preview: ... ic static void main(String[] args){       int a,b,c;    a=5;    b=6;    c=a*b;        System.out.println("Exercise ...

The full tutorial is about 41 words long .
Posted by:
 

$7.00 Completed and Tested Well

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Oct. 17, 2009 at 10:53:37AM
A:
Preview: ... rt java.text.DecimalFormat; import java.io.*; public class BasicConversions{  public static void main(String[] args){      /* EXERCISE 1 */       int a,b,c;   a=5;   b=6;       ...

The full tutorial is about 129 words long plus attachments.

Attachments:
BasicConversions.java (0K) (Preview)
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$7.00 Java: solution and UseNotes describing solution

  • This tutorial hasn't been purchased yet.
  • Posted on Oct 17, 2009 at 10:50:48PM
A:
Preview: ... ouble cashMoney = 2.39;         java.text.DecimalFormat df = new java.text.DecimalFormat("0.00");         System.out.println("Exercise 2: $" df.format(cashMoney)); // Ex 2         //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 ...

The full tutorial is about 292 words long plus attachments.

Attachments:
BasicConversions.java (2K) (Preview)
BasicConversionsUseNotes.txt (1K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty