Draw a flowchart. do not output the number of minutes during which the service is used.
a. regularBill: This method calculates and returns the billing amount for regular
service.
b. premiumBill: This method calculates and returns the billing amount for premium
service.
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
System.out.println("Enter price for Regular services: ");
int regularBill=in.nextInt();
System.out.println("Enter price for premium services: ");
int premiumBill=in.nextInt();
System.out.println("Choose type of service:\n1. Regular service\n2. Premium service");
int c=in.nextInt();
if(c==1){
System.out.println("Regular bill: "+regularBill);
}
else if (c==2){
System.out.println("Premium bill: "+premiumBill);
}
}
}
Comments
Leave a comment