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

( Date Class) Create a class called Date that includes three instance variablesa month (type int ),
a day (type int ) and a year (type int ). Provide a constructor that initializes the three instance
variables and assumes that the values provided are correct. Provide a set and a get method for each
instance variable. Provide a method displayDate that displays the month, day and year separated
by forward slashes ( / ). Write a test application named DateTest that demonstrates class Date s
capabilities.
(Employee Class) Create a class called Employee that includes three instance variablesa first name
(type String ), a last name (type String ) and a monthly salary ( double ). Provide a constructor
1
that initializes the three instance variables. Provide a set and a get method for each instance
variable. If the monthly salary is not positive, do not set its value. Write a test application named
EmployeeTest that demonstrates class Employee s capabilities. Create two Employee objects and
display each objects yearly salary. Then give each Employee a 10% raise and display each Employee
s yearly salary again
How to do control of selection in java?
Every positive integer greater than 1 can be expressed as a product of prime numbers. This
factorization is unique and is called the prime factorization.For example, the number 60 can be
decomposed into the factors 2 ∗ 2 ∗ 3 ∗ 5, each of which is prime. Note that the same prime can
appear more than once in the factorization. Write a program to display the prime factorization of
a number n e.g. if a user enter enter 60 as an input then program should print 2 ∗ 2 ∗ 3 ∗ 5 as an
output.
Write a program that reads in a list of integers from the user until the user enters the value 0 as
a sentinel. When the sentinel appears, your program should display the largest and second largest
value in the list, e.g. if user enter values 13, 17, 34, 19, 33,0 then program output should say the
largest value was 34 and second largest value was 33. You should also make sure that the program
works correctly if all the input values are negative. not using arrays
Create a program that input a grade from the user. The grade input from the user will be an integer. Once the
input is stored, use an if-else-if block of code to determine the letter grade of the inputted integer grade. Do
not use if statements by itself or another strategy to solve this problem. You will print and “Error” for inputs
greater than 100. You will also print an “Error” for inputs less than 0. Both errors must be handled together
by a compound conditional statement that is joined by a short circuit &&. The error should not be a print
statement. It should use a String variable that is assigned the value of ERROR. You must a Char variable for
each letter grade. You must use a System.out.println for printing the error. You must a System.out.printf for
printing the letter grade.
You will run the program three times. Each time you run the program you will enter three different inputs.
1. 140
2. -42
3. 85
Exercise 71109 Write a class named Employee that has the following fields:
name: The name field is a String object that holds the employee's name.
idNumber: The idNumber is an int variable that holds the employee's ID number.
department: The department is a String object that holds the name of the name of the department where the employee works.
position: the position field is a String object that holds the employee's job title.
Write appropriate mutator methods that store the values in these fields and accessor methods that return the values in the field.
Once you have written the class add a main method that creates three Employee objects to hold the following data:
Name ID Number Department Position
Susan Meyers 47899 Marketing Sales Rep
Mark Jones 39119 IT Programmer
Joy Rogers 81774 Manufacturing Engineer
The program should store this in the three objects and then display the data for each employee in the format:
How can I compare two strings and capitalize the second one in the same places as the first one?
1 : What is meant by collections in java?
2 : What is the difference b/w abstract classes and interface in java?
3 : Why we write "String args[ ]" as a parameter in main method of java?
What are Applets and Servlets in Java? Explain with Example
LATEST TUTORIALS
APPROVED BY CLIENTS