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