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

Build a class Project with id(int) , desc (String), duration (int) , budget (double) and members (ArrayList of Workers). a. Provide a parameterized constructor Project (int id, String desc, double budget). The member array will be initialized as empty array and the initial duration of the project will be 0 b. Provide setters for description and budget and getters for all except members list c. Provide a method addMember(Worker m) that adds the worker instance to the members array list d. Provide a method Worker getMember(int wId) that searches for the worker with the given id in the members list and returns instance.  


Build a class Worker having id(int), name(Sting), hoursWorked(int), salRate (double) a. Provide a constructor Worker(int id, String name, double salRate). The hoursWorked will be initially 0 b. Provide getters for each but setters for only salRate c. Provide a method addHours(int h) that increase the number of hoursWorked by the provided value. d. Provide a method getCurrentSalary() that calculates and returns the current salary i.e. the hoursWorked times the salRate. e. Override the toString to get appropriate output  


Write a Java GUI application that will keep track of sport vehicle details. The application must contain the vehicle name, vehicle price, 0 – 100 in seconds and the engine size.


Q.3.1 On the form create three radio buttons and a list box to display the vehicle details. Also create a submit button that when clicked will display the vehicle name, vehicle price, 0 – 100 in seconds and engine size.


Q.3.2 Create a sequential file (cars.txt) that contains data for the following fields: • The vehicle name • The vehicle price • The speed from 0 to 100 in seconds • The engine size


Write a Java application and use a Two dimensional array to store five Dutch, French and Italian translated words. Use a single array to store the English words.  Your program must:

Q.2.1 Contain a single array to contain the following five English words and a Two dimensional array to store the following Dutch, French and Italian translated words. ENGLISH WORD  sky, run, study, music

 DUTCH WORD hemel, rennen, studie, muziek

FRENCH WORD ciel, courir, etude, musique

ITALIAN WORD   cielo, correre, studia, musica

                 

Q.2.2 Print out each English word with the translated Dutch, French and Italian word.


Develop a Java GUI application that will display the ink cartridge usage of three different printers with a time span of three years.


Q.1.1 On the form, create two combo boxes, to allow a user to select between three different printers and years. When a user has selected a printer and year and clicked the submit button, display the amount of ink cartridges used for that year. Use the following table for the printers and yearly cartridges used:

2018 HP Deskjesk 650 10 35 20

2019 Canon Z100 30 31 33


Q.1.2 You are also required to create a menu system which will allow the user to exit the application under the file menu. Under the tool’s menu, allow the form submission and an option to display the yearly ink cartridges used for each printer. The layout of the form is left to your discretion. Marks will be allocated to the presentation and effectiveness of the layout, but the following layout is displayed for your convenience


riorityQueue class which is implemented in the collection framework provides us a way to process the objects based on the priority. It is known that a queue follows First-In-First-Out algorithm, but sometimes the elements of the queue are needed to be processed according to the priority, that’s when the PriorityQueue comes into play. Let’s see how to create a queue object using this class.


  1. Write a Java program that computes the salary of an employee. The program should perform the following:
  • Ask the user to enter an employee name, pay rate, and total hours of work.
  • Compute the salary of the employee
  • Display the entered information of employee and his salary

2. Name the class as SalaryCalculator and save the file

3. Compile and execute the program using command prompt

4. Correct syntax and logical errors if there is any


  1. Create a folder named LastName_FirstName on your local disk
  2. Write a program that calculates the average grade of a student. The program should perform the following:
  • Prompts the user to input five decimal numbers.
  • Compute the average grade of five entered decimal.
  • Output the average grade with two decimals places.

3. Name the class as AverageGradeCalculator and save the file.

4. Compile and execute the program using command prompt

5. correct and syntax and logical errors if there is any.


4. The Big One

by CodeChum Admin



Instructions:

  1. Create a variable that accepts a positive integer.
  2. Create an empty list. Then, using loops, add random integer values into the list one by one. The number of values to be stored is dependent on the inputted positive integer given in the first instruction.
  3. Print out the largest integer among all the elements on the list, by any means necessary.

Input

The first line contains the size of the array/list.

The next lines contains an integer on each.

5
5
34
3
23
10

Output

A line containing an integer.

34




Square to the Next Level

by CodeChum Admin

We've already tried printing out the values of an array in reversed order, right? Today, we shall compute for the squares of all the numbers.


There's already a predefined array/list containing 100 integer values. Loop through each values, compute their squares, and display them.


Output

Multiple lines containing an integer.

4
9
25
10000
49
9
25
9
1
16
.
.
.
LATEST TUTORIALS
APPROVED BY CLIENTS