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

The user must have the ability to search for a product. The user will select menu item
two (2), which will prompt the user to enter a product code. If a valid product is found in
the application, then display the product details to the user. If no valid product is found,
display an error message to the user that the product cannot be located.

You have to design your own Java console application about any valid problem that your application must solve. Your solution can include solving a business problem, a new idea or even a game. Your application must make use of concepts such as arrays, loops, inheritance, constructors and information hiding. Output must be shown in the form of a report using the console.  

In your solution, make use of as many concepts, and components dealt with in this course, but pay special attention to the following learning units: • Learning Unit 1: Advanced arrays. • Learning Unit 2: Introduction to inheritance.


If the user selects to capture a new product, you are required to save all the information
supplied by the user into memory. To achieve this, you may use arrays or array lists.
Sample Capture Product Screenshot
Q.1.4 Special consideration needs to be made for the selection of the product category. Allow
the user to make a selection between the following categories:
• Desktop Computer.
• Laptop.
• Tablet.
• Printer.
• Gaming Console.

The statements below shows the declaration of an array:

 

String[] Municipality ={”Steve Tshwete”, “Nkomazi”, “City of Mbombela”, “Govan Mbeki”};

 

1) Make use of a loop of your choice and write statement(s) that will display all array elements indicating the Municipality’s name as follows:

 

Municipality 1: Steve Tshwete

Municipality 2: Nkomazi

Municipality 3: City of Mbombela

Municipality 4: Govan Mbeki

 

1) Write a statement that will replace array element Nkomazi with White River.

3) What is the array length?

4) Make use of a loop of your choice and write statement(s) that will display all Municipalities, considering effects of question (2), starting with the last Municipality as shown below:

 

Municipality 4: Govan Mbeki

Municipality 3: City of Mbombela

Municipality 2: Nkomazi

Municipality 1: Steve Tshwete


Special consideration needs to be made for the selection of the product category. Allow
the user to make a selection between the following categories:
• Desktop Computer.
• Laptop.
• Tablet.
• Printer.
• Gaming Console.
Extreme IT Products is a local supplier that specialises in the sales of the latest Information
Technology hardware devices. The business has recently opened an outlet in the town you reside
and has hired the software development house you work for to design a Java application to
manage their products.
Your line manager has requested you to develop the application with the following requirements:
Q.1.1 When the application starts, it must display the following menu structure:

Define Exception Handling. Write a java program to create a user defined

exception for the following

a) Create a student class and get the name of the student and 3 subject marks

b) Find the length of the name. If the length > 7 throw LengthException

c) Find the average of marks, if avg < 50 throw FailedException

d) If avg < 75 && avg > 50 throw NotFirstClassException

e) If avg > 75 throw FirstClassException


Create a program that when run with two numbers as CMD arguments, it prints out the difference

and product separated by space[Hint: CMD arguments need to be converted to integers]:

Sample run 1

java lab02_task02 12 3 

Output: 9 36 

Sample run 2

java lab02_task02 2 5

Output: -3 10


12.8 (LAB) Fun With Branching - FINAL

For this project you will write a Java program that will run a simple math quiz. Your program will generate two random integers between 1 and 20 and then ask a series of math questions. Each question will be evaluated as to whether it is the right or wrong answer. In the end a final score should be reported for the user. (See below for how to generate random numbers).

Sample Ouptut This is a sample transcript of what your program should do. Values in the transcript in BOLD show the user inputs. So in this transcript the user inputs 33, Jeremy, 24, -16, and 80 the rest is output from the program.


Create a window (program) that will run as a standalone application. Your program must contain the following components:

 A label

 A button

 A check box

 A text field with a vertical scroll bar




LATEST TUTORIALS
APPROVED BY CLIENTS