Java | JSP | JSF Answers

Questions answered by Experts: 3 611

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

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

Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.


Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".




Start coding now!


Input


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

The next lines contain the integers.

The last line contains an integer to be searched.


5

3

21

2

5

23

2

Output


A line containing a string.


Present


Groupings

by CodeChum Admin

Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.


Instructions:

  1. Create a variable that accepts a positive odd 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 odd integer on the first instruction.
  3. Reverse the order of the list. Then, print out the list's new order in this manner:
  4. [first-half values]-[middle value]-[second-half values], just like that of the sample output. Make use of list slicing that you’ve learned from the past lessons to easily achieve this segment.

Input

The first line contains an odd positive integer.

The next lines contains an integer.

5
1
3
4
5
2

Output

A line containing a list without space.

[2,5]-[4]-[3,1]




Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.

Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".


Start coding now!


Input

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

The next lines contain the integers.

The last line contains an integer to be searched.

5
3
21
2
5
23
2

Output

A line containing a string.

Present

 Write a Java program that asks the user to enter an integer number N and successively display all the odd numbers that are less than or equal to N.

 Improve the program so that it also displays the number of odd numbers

less than or equal to N.



LATEST TUTORIALS
APPROVED BY CLIENTS