Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program called PickMessagePlan.java to decide which of two message plans

ID: 441003 • Letter: W

Question

Write a program called PickMessagePlan.java to decide which of two message plans will have a lower fee for someone's estimated average monthly usage. The structure of the fee plans is to have a fixed number of text messages bundled into a monthly charge. Text messages above the bundled amount incur an additional per message fee. To make things a bit more complicated, the cell phone provider provides an overall discount to students of up to 50%. Your program should take in the 3 fee parameters for each plan, the percentage discount, and the estimated average messages sent per month. Then calculate and output the resultant monthly fee for both plans, and say which one is cheaper, or if they cost the same. Include the previously entered thresholds in requesting information about the fee rates. INPUT: A set of integers and doubles, representing fees, messages, and rates OUTPUT: The monthly fees as a properly formatted double, along with a decision as to which plan is cheaper Please keep this in if and if else! I NEED IT TO BE EXACT.

Explanation / Answer

This is the exact answer for your question :


Plan Class

public class Plan {
private int messages;
private double fee;
private double rate;


public Plan() {
super();
}


public Plan(int messages, double fee, double rate) {
super();
this.messages = messages;
this.fee = fee;
this.rate = rate;
}


public int getMessages() {
return messages;
}


public void setMessages(int messages) {
this.messages = messages;
}


public double getFee() {
return fee;
}


public void setFee(double fee) {
this.fee = fee;
}


public double getRate() {
return rate;
}


public void setRate(double rate) {
this.rate = rate;
}

public double monthlyFee()
{
double monthFee=messages*fee;

double discount=messages*fee* rate/100;

return (monthFee - discount);
}

}

Pick Message Plan Class


public class PickMessagePlan {


/**
* @param args
*/
public static void main(String[] args) {
Plan plan1 =new Plan(200,0.25,10);
Plan plan2 =new Plan(300,0.35,15);
double plan1monthlyFee=plan1.monthlyFee();
double plan2monthlyFee= plan2.monthlyFee();
System.out.println("Monthly fee for Plan1 is"+plan1monthlyFee);
System.out.println("Monthly fee for Plan2 is"+plan2monthlyFee);
if(plan1monthlyFee > plan2monthlyFee)
{
System.out.println("Plan2 is cheaper");
}
else if(plan1monthlyFee == plan2monthlyFee)
{
System.out.println("Both are same");
}
else
{
System.out.println("Plan1 is cheaper");
}
// TODO Auto-generated method stub

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote