Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Hello,This is my first java class.I have taken IT, class, before but nothing like this.I am stuck.

Hello,This is my first java class.I have taken IT, class, before but nothing like this.I am stuck.Please help.Write a program that prompts the user to input a decimal number and output the number rounded to the nearest integer.

This is what I have come up with.

public class DecimalRounder 

    static Scanner console = new Scanner(System.in); 
     
    public static void main(String[] args) 
    { 
        long answer; 
        double input; 
          
         
        System.out.println(“3.8. It will be rounded to the nearest integer.”); 
         
         
        input = console.nextDouble(); 
         
        System.out.println(“3.8″ + ” ” + input); 
         
        answer = round(input); 
        
        System.out.println(“The answer is” + ” ” + answer); 
         
    } 
   
    }
      

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"