A java program for calculating telephone bill using inheritance concept?

Java

1 answer

Answer

1054884

2026-04-19 18:05

+ Follow

Java
Java

import Java.util.*;

class bill

{

public static void main (String arg[])

{

Scanner in = new Scanner (System.in);

int a,b=0,c=1;

while (c<=6)

{

System.out.print ("nt Enter bill of month no "+c+" = ");

a=in.nextInt();

b+=a;

++c;

}

int avg=b/6;

System.out.println ("nt Average bill = "+avg);

if (avg>5000)

System.out.println ("nt Government will pay ");

else

System.out.println ("nt Paid ");

}

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.