Answer to Question #204804 in Java | JSP | JSF for 4729201

Question #204804

At Mr. G school of Programming, the final school fees to be paid is calculated as follows.

  • Original Fees should be greater than or equal to R50 000
  • Minimum fixed deposit of R10 000
  • If deposit is greater than pr equal to half the original fees, you get a 5% discount from the original fees
  • Final total fees will also include the following
  1. School Levy is 10% of original fees
  2. Sports fee is 5% of original fees.

Write a program the calculates the final total fees to be paid.

Program must request user to enter original fees value greater then R50 000.

Program should also request user to enter amount to deposit before calculating final total fees.




1
Expert's answer
2021-06-08T23:49:44-0400
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) {
	    Scanner sc=new Scanner(System.in);
	    System.out.println("Enter details for character 1");
	    System.out.print("Enter attr11: ");
		int attr11=sc.nextInt();
		System.out.print("Enter attr21: ");
		String attr21=sc.next();
		
		System.out.println("Enter details for character 2");
	    System.out.print("Enter attr12: ");
		int attr12=sc.nextInt();
		System.out.print("Enter attr22: ");
		String attr22=sc.next();
		int compare = attr21.compareToIgnoreCase(attr22);


		if (attr11>attr12 && compare>0){
		    System.out.println("Character 1 has won");
		}
		else{
		    System.out.println("Character 2 has won");
		}
	}
}

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