/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author lenovo
*/
public class Computer {
void show(double amount,double price){
if(amount<=90&&amount>=1)
price=amount*0.6;
else if(amount<=150&&amount>90)
price=amount*1.1;
else if(amount>150)
price=amount*1.7;
else System.out.print("input"+amount+"is unlegal");
System.out.printf("the fee of power:%5.2f",price);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author lenovo
*/
import java.util.Scanner;
public class Test {
public static void main(String args[]){
Scanner reader = new Scanner(System.in);
double amount=0;
double price=0;
System.out.println("input electric power:");
amount = reader.nextDouble();
Computer p1=new Computer ();
p1.show(amount,price);
}
}