Java | JSP | JSF Answers

Questions: 3 611

Answers by our 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 & Filtering

Suppose there is XYZ Company and there are different departments like production, marketing, finance, sales etc. Manager of the company want to know about the detail of the employees who are highly paid in each of the department. Write a program using the concept of classes to implement the same.


Develop a Java program for a lottery winning game. The secret win number is “980-6578-854-976”. The user is allowed to enter their try, up to 10 times. For any incorrect entry, the program displays “Sorry. Try Again.” For each wrong entry, the program displays number of attempts remaining. When the 10 attempts are over, it displays “You have exhausted your chances to win. Bye.” The user can also press “E” to opt out of the game any time during the attempts. If they enter the win number at any point, the program displays “CONGRATULATIONS!! YOU HAVE WON 6 MILLION KSHS.” Then allows the user to enter their name, IDNO and phone number, after which the program displays e.g. “John Kamau, IDNO 89765, Phone Number 07863539, we shall contact you on information on how to receive your price. Have a good day”.


Create a class named Square which performs the following tasks. a. Provide a method which returns calcuated area and circumference of the square and takes side length as one parameter of type integer. Write a test application named SquareApp which performs the following tasks. a. Create an object for the class Square. b. Read the side length of the Square from the user c. Pass the side length to the methods of the square class as an argument and print the calculated area and circumference of the square.


Write a program to take a String as input then display the words in one column, its length in another column, replace the first with last character of each word in third column.

Enter a String

a is the first vowel

a 1 a

is 2 si

the 3 eht

first 5 tirsf

vowel 5 lowev

Hint: Use length(), indexOf(), substring() if required.

Array & split are not to be used


In a particular factory, the team leader is an hourly paid production worker that leads a small team. In addition to hourly pay, team leaders earn a fixed monthly bonus. Team leaders are required to attend a minimum number of hours of training per year. Design a TeamLeader class that extends the Production Worker Class. The LeamLeader class should have fields for the monthly bonus amount, the required number of training hours, and the number of training hours that the team leader has attended. Write one or more constructors and the appropriate accessor and mutator methods for the class. Demo the class by using a program that uses the TeamLeader object. 


Create a class named INVOICE that contains fields for an item number, name, quantity, price, and total cost. Create instance methods that set the item name, quantity, and price. Whenever the price or quantity is set , recalculate the total (price times quantity ). Also include a DISPLAYLine() method that displays the item number, name, quantity, price for each INVOICE. Save the class as INVOICE.java


Sample output

item # : 111

Item name: chips

Quantity:2

Price: 1.00

Total Cost: 2.00


Name your database using your names as: “db_first_last_studentNumber”. ∙ Name all your tables in your database using this format: “tbl_tableName”. ∙   

∙ This mini-project is worth 20 marks (10 marks for a working GUI, 10 marks for performing CRUD  operations on a DB through the GUI). 

Milestone: 

For this unit, you are required to develop a GUI application using Java. The application  should connect to a database and should be able to perform any CRUD operation. 

Main goal:  

Develop a Java application with GUI for a primary school called Duka. 

Functional Requirements: 

The application should allow:  

i. A shop attendant to be able to login to upload stock of items (with prices). ii. A buyer be able to search for items, get their prices and make an order. 

Non-functional Requirements: 

The application should: 

i. Have a user-friendly GUI for both shop attendant and buyer. 

ii. Not crash in case a user makes a mistake, instead it should provide a  clarification/warning.





Given the following code, what is the value of ticTacToe[2].length

String row1[] = {" ","X","O"};

String row2[] = {"X"," ","O"};

String row3[] = {"O","X"," "};

String ticTacToe[][] = {row1,row2,row3};


Given the following code, what is the value of ticTacToe[2][1]


String row1[] = {" ","X","O"};

String row2[] = {"X"," ","O"};

String row3[] = {"O","X"," "};

String ticTacToe[][] = {row1,row2,row3};


The function accepts two positive integers ‘r’ and ‘unit’ and a positive integer array ‘arr’ of size ‘n’ as its argument ‘r’ represents the number of rats present in an area, ‘unit’ is the amount of food each rat consumes and each ith element of array ‘arr’ represents the amount of food present in ‘i+1’ house number, where 0 <= i

LATEST TUTORIALS
APPROVED BY CLIENTS