Answer:
30.00 + x * .45 where x is the number of minutes
in code it would be:
import java.util.Scanner;
public class monthlyFee{
final double MONTHLY_FEE = 30.00;
final double ADDITIONAL_MINUTE_FEE = 0.45;
double additionalMinute = 0;
public monthlyFee(double minutes){
additionalMinute = minutes;
}
public double calculate(){
if(additionalMinute > 0){
double TotalFee = MONTHLY_FEE + additionalMinute * ADDITIONAL_MINUTE_FEE;
return TotalFee;
}
else
return MONTHLY_FEE;
}
public static void main(String...args){
Scanner input = new Scanner(System.in);
System.out.println("Enter minutes: ");
double minutes = input.nextDouble();
monthlyFee obj1 = new monthlyFee(minutes);
System.out.printf("$" + "%.2f", obj1.calculate());
}
}
Explanation:
so whatever x is just multiple it by 0.45 to get the total for just the fee.