1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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

    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