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

Create a program that will make the user input the Month, Date and Year as Integers then use switch statemet and concatenation to display it in this format:










Sample output










Month : 6










Day : 13










Year : 2022










June 13, 2022










Note: If the user inputs an invalid Month then you should tell the user that it is invalid by using the default keyword.










Syntax of default keyword is default:

Write a program to print all the composite numbers between a and b

Fibonacci sequence




Create a Java program that asks the user to input a student number. The format of the student number is a sequence of the following:



Four (4) digits


A dash


Two (2) digits


A dash


Three (3) digits


Display a welcome message if the student number is valid; otherwise, show an appropriate error message. Do not copy the welcome message in the sample output.

Declare the Person superclass as abstract. Add this abstract method to the class:

public abstract void eat(String food);

Both the Student and Employee class inherit from abstract superclass Person, and provides an implementation for eat() which displays that the student or employee is eating a certain food.

(Note what happens if you don’t  implement eat().)




Create an interface called StudentInterface. This interface has the following abstract method:

public void study(String subject);

The Student class implements this interface, and provides an implementation for study() which displays that the student is studying a certain subject.

(Note what happens if you don’t  implement study().)




Create an interface called EmployeeInterface. This interface has the following abstract method:

public void workingOn(String task);

The Employee class implements this interface, and provides an implementation for workingOn() which displays that the employee is working on a certain task.

(Note what happens if you don’t  implement workingOn().)




Write a program that initially requests


the user to enter the number of students


in a class. The program then proceeds to request the user to enter the marks (double) of these


students; these are to be inserted into an


array. Once all the marks have been entered,


your program shall have and use the below


functions


1. public static double sum(int [] array). Calculate & return sum of all marks.


2. Public static double[] sort(int []


array). Sort array containing marks.


3. public static double max(int []


array). Return highest mark.


4. public static double min(int [] array). Return lowest mark.

Write a program that initially requests


the user to enter the number of students


in a class. The program then proceeds to request the user to enter the marks (double) of these


students; these are to be inserted into an


array. Once all the marks have been entered,


your program shall have and use the below


functions


1. public static double sum(int [] array). Calculate & return sum of all marks.


2. Public static double[] sort(int []


array). Sort array containing marks.


3. public static double max(int []


array). Return highest mark.


4. public static double min(int [] array). Return lowest mark.

Write a program that initially requests


the user to enter the number of students


in a class. The program then proceeds to request the user to enter the marks (double) of these


students; these are to be inserted into an


array. Once all the marks have been entered,


your program shall have and use the below


functions


1. public static double sum(int [] array). Calculate & return sum of all marks.


2. Public static double[] sort(int []


array). Sort array containing marks.


3. public static double max(int []


array). Return highest mark.


4. public static double min(int [] array). Return lowest mark.

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS