Question: How do i get the - 2 5 % as shown in the example / sample run. Please look at my code and tell me

How do i get the -25% as shown in the example/sample run.
Please look at my code and tell me what I need to change or do. Thanks!
INSTRUCTIONS:
Note that it costs 120.25 dollars per credit hour in addition to $35.00
charged for health and id services. Students with gpa of 3.5 or higher
receive a discount of 25% when the total payments exceed $700.
My Code:
private double calculateTotalPayment(){
double totalPayment =0;
for (Integer crn : listOfCrns){
totalPayment +=120.25;
}
totalPayment +=35.00; // Health & id fees
if (totalPayment >700 && gpa >=3.5){
totalPayment *=0.75; //25% discount
}
return totalPayment;
}
public void printFeeInvoice(){
System.out.println("VALENCE COLLEGE");
System.out.println("ORLANDO FL 10101");
System.out.println("--------------------------");
System.out.println("");
System.out.println("Fee Invoice Prepared For Student: ");
System.out.println(+ studentId +"-"+ studentName);
System.out.println("");
System.out.println("1 Credit Hour = $120.25");
System.out.printf("%-10s%-10s%-10s%-10s
","CRN","CR_PREFIX", "CR_HOURS", "AMOUNT");
double totalPayment =0;
for (Integer crn : listOfCrns){
String prefix = getPrefix(crn);
int creditHours = getCreditHours(crn);
double amount = creditHours *120.25;
totalPayment += amount;
System.out.printf("%-10d%-10s%-10d$%-10.2f
", crn, prefix, creditHours, amount);
}
System.out.println("\t\t\tHealth & id fees $ 35.00");
System.out.println("------------------------------");
System.out.printf("%-10s$%-10.2f
","\t\t\tTotal Payments", totalPayment +35);
}VALENCE COLLEGE
ORLANDO FL 10101
Fee Invoice Prepared for Student:
5959-DANIEL TAZI
1 Credit Hour =$120.25
 How do i get the -25% as shown in the example/sample

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!