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

Have you ever answered a test question that tells you to enumerate a series of things, but the answer must be in a sentence? Quite tiring to write those things separated by commas and a single space, isn't it?

Then let's try coding it instead


write a java program that enters students names, test 1, test 2, test 3 scores and calculate average for each student " use arrays"


You will be given two integers x and y as input, you have to compute x/y . If x and y are not integers or if y is zero, exception will occur and you have to report it. You should use try and catch blocks to handle the exception. You also have to include a finally block to show output "Output from finally block". Read sample Input/Output to know what to report in case of exceptions.


10


3



3


Output from finally block




10


Hello



Check your input: java.util.InputMismatchException


Output from finally block




10





Value is undefined: java.lang.ArithmeticException: / by zero


Output from finally block




23.323





Check your input: java.util.InputMismatchException



Output from finally block

Q: Write a program that displays the following menu to the user:

Press 1 for Permanent Employee

Press 2 for Daily wages Employee

After selecting the appropriate employee calculate salary for the employees.

The daily wages employees are paid 400 per hour while permanent employees are paid 800 per hour. First you need to ask for the number of hours for which the employee has worked so far and then calculate and display the salary of each type of employee.

Perform the above-mentioned task using switch statement. 


Required Object Class and Driver Class , Write a Java program to obtain transpose of a 4 x 4 matrix. The Transpose of the matrix is obtained by exchanging the elements of each row. With the elements of the corresponding column. 


Create objec-oriented java program that will ask the user for 2 names ( boy and girl).



1. Two (2) classes -MyMainClass and Other Class


2. One (1) Constructor - set the name of the girl and boy (for object)


3. Two (2) accessors


getBoyNumLetters () & getGirlNameLetters (return numbers of letters)


4. One (1) mutator - check (to check who has the higher number of letters)



Sample output:


Enter the name of the girl: Claire


Enter the name of a boy: Christian


Claire has 6 letters of her name.


Christian has 9 letters in his name


The boy's name has more letters than the girls

Write a Java program to do the following, using Object Class and Driver Class

a) Read the names of employeeid, name and salary of all employees.

b) Check whether the given employeeid is present in the array,

if it is not, print the name of the employee and the employeeid.


Write a Java program to do the following, using Object Class and Driver Class

a) Read two-dimensional array (3 x3).

b) Find the diagonal elements of the array.


Write a Java program to obtain transpose of a 4 x 4 matrix. The Transpose of the matrix is obtained by exchanging the elements of each row. With the elements of the corresponding column. using Object Class and Driver Class


Write a Java program to do the following

a) Read the names of employeeid, name and salary of all employees.

b) Check whether the given employeeid is present in the array,

if it is not, print the name of the employee and the employeeid.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS