plz answer me this question related to java.fast
Attachments:
Answers
Answered by
1
import java.util.*;
public class Electricbill { //start of class
public static void ebill() { //start of method
Scanner sc=new Scanner(System.in);
System.out.println("Enter units consumed");
double u=sc.nextDouble();
double c=0.0;
if(u<=100)
c=(1.50*u);
else if(u<=200)
c=(1.50*100)+2.00(100-d);
else if(u<=250)
c=(1.50*100)+(2.00*100)+2.50(200-d);
else
c=(1.50*100)+(2.00*100)+(2.50*50)+4.00(
250-d) //this will be in previous line
double bill=250+c; //rent is added
System.out.println("Total amount paid="+bill);
System.out.println("Units consumed="+u);
} //end of method
} //end of class
public class Electricbill { //start of class
public static void ebill() { //start of method
Scanner sc=new Scanner(System.in);
System.out.println("Enter units consumed");
double u=sc.nextDouble();
double c=0.0;
if(u<=100)
c=(1.50*u);
else if(u<=200)
c=(1.50*100)+2.00(100-d);
else if(u<=250)
c=(1.50*100)+(2.00*100)+2.50(200-d);
else
c=(1.50*100)+(2.00*100)+(2.50*50)+4.00(
250-d) //this will be in previous line
double bill=250+c; //rent is added
System.out.println("Total amount paid="+bill);
System.out.println("Units consumed="+u);
} //end of method
} //end of class
Ayush0009:
goo
Similar questions