Draw a flowchart of cellphone that uses the following methods to calculate the billing amount. 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
{
static void regularBill(){
Scanner input=new Scanner(System.in);
System.out.print("\n\nInput the initial price: ");
double Price=input.nextDouble();
double w=0.2*Price;
double n=Price-w;
System.out.println("Billing amount for regular service is: "+n);
}
static void premiumBill(){
Scanner input=new Scanner(System.in);
System.out.print("\nInput the price: ");
double M=input.nextDouble();
double R=0.3*M;
System.out.println("The billing amount for premium service is: "+R);
}
public static void main(String[] args) {
System.out.print("Regular Billing");
regularBill();
System.out.print("\npremium Billing");
premiumBill();
}
}
Comments
Leave a comment