1. A year with 366 days is called a leap year. A year is a leap year if it is divisible by 4 (for e.g., 1980), except that it is not a leap year if it is also divisible by 100 (for e.g., 1900); however, it is a leap year if it is further divisible by 400 (for e.g., 2000).

Write a program that prompts the user to enter a year and displays whether that year is a leap year. The program should repeatedly prompt the user for a year until the user enters a sentinel value of -99 to quit the program. Note that you will need to use the mod function (%) to determine divisibility by a number. You CANNOT use the class GregorianCalendar and any of its methods.

2. Write a java program to print student's total marks, percentage and grade. User input is given to enter number of subjects and then prompts user to enter marks. Calculate Total marks, Student Percentage, Student Grade.

Note:

1. Maximum marks for a subject is 100.

2. percentage = (totalMarks/(count*100)) * 100;
>=90 is Grade A
>=80 and <=89.99 is Grade B
>=70 and <=79.99 is Grade C
>=60 and <=69.99 is Grade D
< 60 is Fail

Tips: use scanner for inputs, use for loop (to iterate and store marks), use switch statement (to print grades).

Sample Output:

Enter Number of Subject(s):
3
Enter Marks of 3 Subject(s):
70
80
90
Total Marks : 240
Student Percentage: 80
Student Grade : B
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.