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 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.

Using three dimensional array, create a program that will enter table, row, and column together with the total number of Elements then display the Biggest number, Smallest number, and Second to the biggest number.



Sample input and output:



Input:



Enter number of Tables: 2


Enter number of Rows: 2


Enter number of Columns: 2



Enter 8 number of Elements


2


6


34


76


34


98


56


45



The biggest number among them is: 98


The smallest number among them is: 2


The second to the biggest number is: 76

Using three dimensional array, create a program that will enter table, row, and column together with the total number of Elements then display the Biggest number, Smallest number, and Second to the biggest number.



Sample input and output:



Input:



Enter number of Tables: 2


Enter number of Rows: 2


Enter number of Columns: 2



Enter 8 number of Elements


2


6


34


76


34


98


56


45



The biggest number among them is: 98


The smallest number among them is: 2


The second to the biggest number is: 76

Using three dimensional array, create a program that will enter table, row, and column together with the total number of Elements then display the Biggest number, Smallest number, and Second to the biggest number.



Sample input and output:



Input:



Enter number of Tables: 2


Enter number of Rows: 2


Enter number of Columns: 2



Enter 8 number of Elements


2


6


34


76


34


98


56


45



The biggest number among them is: 98


The smallest number among them is: 2


The second to the biggest number is: 76

A window with the title “Welcome Home”

What is the output of the following code?


int x = 100;


int y = 200;



if (x > 100 && y <= 200)


System.out.println(x + “ “ + y + “ “ + (x + y));


else


System.out.println(x + “ “ + y + “ “ + (2 * x - y));

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().)


Override toString() in the Student and Employee classes. For example, if a Student object is created like this:

Student student = new Student("Maria",18,"BSIT",1);

then the Student class’ toString() method will return this string:

Maria 18 BSIT 1




Write a program that asks the user to enter an integer from 20 to 99 in numeric form. The program should output the equivalent number in words. For example, if an input of 58, the output is fifty eight


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS