Answer to Question #250794 in Java | JSP | JSF for kayjay

Question #250794

Draw a flowchart so that it uses the following methods to calculate the billing amount for a cellphone. 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.



1
Expert's answer
2021-10-13T06:25:27-0400
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();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS