Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

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!

Search & Filtering

Write a program to find if a year is a leap year or not. We generally assume that if a year number is divisible by 4 it is a leap year. But it is not the only case. A year is a leap year if −

1.   It is evenly divisible by 100

2.   If it is divisible by 100, then it should also be divisible by 400

3.   Except this, all other years evenly divisible by 4 are leap years.

So the leap year algorithm is, given the year number Y,

●    Check if Y is divisible by 4 but not 100, DISPLAY "leap year"

●    Check if Y is divisible by 400, DISPLAY "leap year"

●    Otherwise, DISPLAY "not leap year"

For this program you have to take the input, that is the year number from an input file input.txt that is provided to you. The input file contains multiple input year numbers. Use a while loop to input the year numbers from the input file one at a time and check if that year is a leap year or not. Your output should go in the console.


Create a constructor that accepts the student number, test result, assignment result and the exam result as parameters and create get methods for the variables (UseJOptionePane to get variable from the user).


Design a program using a console application in java NetBeans, named studentMarksReport that will print the final result obtained by a student with the weighting of each module. Make use of a class named Student that contains variables to store the student number, test result, assignment result and exam.


Write a java program on hotels bookings ask the user for single room, double rooms, family of 6 room and the VIP room bookings the time and the cost must be included.


Create an OOP Java program that will ASK the user for the Prelim, Midterm, Prefinal, and Finals grades.




Create two (2) classes: MyMainClass and SecondClass.



The class SecondClass has 5 double attributes: prelim, midterm, prefinal, finals.



Create one (1) constructor method to set the prelim, midterm, prefinal, and finals grades.



Create one (1) accessor method to calculate for and return the final grade output.



Display the final grade output in the MyMainClass.




Sample output:



Enter prelim grade:75



Enter the midterm grade: 80



Enter the prefinal grade: 90



Enter the final grade: 91



Your final grade is 85.4

Output:


Using If /If else/ If else if statements, switch case statement, and nested conditional statement


Create a full java program of this output.


Salvador, Mark F.


BSIT 1C


CHOICES:


A. JEEPNEY FARE


B. CINEMA FARE


ENTER YOUR CHOICE:____


Enter number of student: ___


Enter number of senior: ___


Enter number of regular: ___


Choose your movie category:


A. Foreign(240 pesos)


B. Local (210 pesos)


Enter choice: ____


Total pax: ____


Cinema Fare: _____





Output:


Using If /If else/ If else if statements, switch case statement, and nested conditional statement


Create a full java program of this output.


Salvador, Mark F.


2nd yr


CHOICES:


A. JEEPNEY FARE


B. CINEMA FARE


ENTER YOUR CHOICE:



Enter kilometer to travel:


Choose your status:


A. Student / Senior / PWD (20%)


B. Regular


Enter choice:


Hello, your fare is:




Create a short program that will print 123467.89 as currency using NumberFormat.



Sample Output:


I have ₱1,234,567.89 in my bank account.

Create a short program that will generate a random number from 0 to 100 while using Math.random and Math.round command.

 Write a program to perform the function of a Simple Interest Calculator.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS