Answer to Question #249333 in Java | JSP | JSF for lucy

Question #249333

Redraw the flowchart of the cellphone so that it 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.



1
Expert's answer
2021-10-11T00:05:37-0400
import java.util.Scanner;
public class Main
{
	    static void regularBill(){
	        Scanner input=new Scanner(System.in);
	        System.out.print("\n\nEnter the initial price: ");
	        double p=input.nextDouble();
	        double x=0.2*p;
	        double y=p-x;
	        System.out.println("Billing amount for regular service is: "+y);
	    }
	    static void premiumBill(){
	        Scanner input=new Scanner(System.in);
	        System.out.print("\nEnter the price: ");
	        double M=input.nextDouble();
	        double Rate=0.3*M;
	        System.out.println("The billing amount for premium service is: "+Rate);
	    }
			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