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

Compose an Employee class with the attributes personalia, employeeNo, yearofAppointment, monthSalary, and taxPercent. In addition to get methods for all the attributes, the following operations should be available :

Find the employee’s monthly tax.

Find the gross annual salary

Find tax savings per year. To our employees June is tax free, and in December there’s only half the usual tax.

Find name (in the format last name, first name.)

Find age

Find number of years employed at the company.

Find out if the person has been employed for more than a given number of years

Set methods to change attributes that it makes sense to change.

Find out in which cases an instance of the Employee class has to collaborate with its personalia object in order to complete these tasks. Draw sequence diagrams for these operations.Write a simple program that puts data into an instance of the Employee class and calls all the methods you’ve created. Check that the results are correct


1) Write a program that helps solve the following problem: ground coffee from brand A costs Rs 45 for 450 grams, while ground coffee from brand B costs Rs 47 for 500 grams. Which brand is cheaper? Create Brand class. Suggest attributes and methods that are relevant for this problem.


1)  Imagine you need to open a standard combination dial lock but don't know the combination and don't have a pair of bolt cutters. Write a program that prints all possible combinations so you can print them on a piece of paper and check off each one as you try it. Assume the numbers on the dial range from zero to thirty-six and three numbers in sequence are needed to open the lock.

         Suppose the lock isn't a very good one and any number that's no more than one away from the correct number will also work. In other words if the combination is 17-6-32 then 18-5-31 will also open the lock. Write a program that prints the minimum number of combinations you need to try to guarantee opening the lock.


Compose an Employee class with the attributes personalia(data type Person),

employeeNo, yearofAppointment, monthSalary, and taxPercent. In addition to get

methods for all the attributes, the following operations should be available :

a. Find the employee’s monthly tax.

b. Find the gross annual salary

c. Find tax savings per year. To our employees June is tax free, and in

December there’s only half the usual tax.

d. Find name (in the format last name, first name.)

e. Find age

f. Find number of years employed at the company.

g. Find out if the person has been employed for more than a given number of

years (parameter)

h. Set methods to change attributes that it makes sense to change.

i. Find out in which cases an instance of the Employee class has to

collaborate with its personalia object in order to complete these tasks.


Write a simple program that puts data into an instance of the Employee class and calls all

the methods you’ve created. Check that the results are correct


Compose an Employee class with the attributes personalia(data type Person),

employeeNo, yearofAppointment, monthSalary, and taxPercent. In addition to get

methods for all the attributes, the following operations should be available :

a. Find the employee’s monthly tax.

b. Find the gross annual salary

c. Find tax savings per year. To our employees June is tax free, and in

December there’s only half the usual tax.

d. Find name (in the format last name, first name.)

e. Find age

f. Find number of years employed at the company.

g. Find out if the person has been employed for more than a given number of

years (parameter)

h. Set methods to change attributes that it makes sense to change.

i. Find out in which cases an instance of the Employee class has to

collaborate with its personalia object in order to complete these tasks.

Draw sequence diagrams for these operations.


An online E-commerce website is using non-persistent cookies to store the sessions of its visitors. The sessions are currently stored on the user’s computer locally. The website is facing a severe issue that before placing the order if the light goes off, the user’s cart information gets lost and the user has to add products again to the cart.

You are given a task to save the information stored in a session if the user accidentally leaves the website due to any reason. You have to select one session tracking technique from the following to resolve this issue.

1.        URL Rewriting

2.        HTTP Session

Now which technique you will prefer to resolve this issue. Justify your answer with solid arguments.



Use a single subscripted array to solve the following problem. Read in 20

numbers, each which is between 10 and 100, inclusive. As each number is read,

print it only if it is not a duplicate of a number already read. Provide for the

“worst” case in which all 20 numbers are different. Use the smallest possible way

to solve the problem.


import java.util.*;



class App {


public static void main(String[] args) {

Scanner in = new Scanner(System.in);

System.out.println("Enter a String: ");

String line = in.nextLine();

boolean space = true;

boolean first = false;

for (Character letter : line.toCharArray()) {

if (letter == ' ') {

System.out.print(letter);

space = !space;

first = false;

} else if (space) {

if (!first) {

System.out.print(letter + ".");

first = true;

}

} else {

System.out.print(letter);

}

}

System.out.println();

in.close();

}

}

Do this coding without using array, split, Character letter, line.toCharArray, boolean


Write a program to take a String name as input then display the name's first and last words as it was and the middle will be only first letter using substring and indexOf.

Example:

Enter a String

Meser chen Rixou xang

Meser c.R. xang

Don't use array and split


3. Student Storage

by CodeChum Admin

Given the Student class that inherited from the Person class (the same ones from our lesson), construct another class called StudentAssistant. The class inherits from Student. What makes a StudentAssistant different from Student is that they have to render a fixed set number of hours. All student assistants are to render at least 40 hours of duty in a month. This maybe changed at any time by the Administrator.


More Info here, Important!

https://pastebin.com/PKEgsRSQ


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS