1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question about how to change my program to user change the input of rate by user

Discussion in 'Java' started by maxruas, Apr 23, 2012.

  1. maxruas

    maxruas New Member

    Joined:
    Apr 23, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    /**
     * @(#)MathDemo.java
     *
     * MathDemo application
     *
     * @author
     * @version 1.00 2012/4/23
     */
    //import java.util.Scanner;
    public class MathDemo {
    
        public static void main(String[] args) {
    		//rate is the value of hourly pay
    	//	Scanner in = new Scanner(System.in);
        	double rate = 80.00;
        	System.out.println("value of rate is " + rate);
    
        	//pay is value of weekly pay
        	double pay = 40 * rate;
        	System.out.println("the value of pay is " + pay);
    
        	//anualPay is the value of a year's work
        	int bonus = 100;
        	double annualPay = pay * 12 + bonus * 12;
        	System.out.println("annual salary is $ " + annualPay);
    
    
    //sorry guys im lost on how I suppose to change rate to be input by the user pleeasy help //:)
    
        }
    }
     
    Last edited by a moderator: Apr 24, 2012

Share This Page