Computer Science, asked by Ayush0009, 1 year ago

plz answer me this question related to java.fast

Attachments:

Answers

Answered by Theindianbrain
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

Ayush0009: goo
Ayush0009: sorry hii
Ayush0009: program dissent run
Ayush0009: does'nt
Ayush0009: first line of the program has class,interface,or enum expected
Similar questions