Reference no: EM132317860
Build JAVA Applets Assignment -
Assessment Task 1 - Project
Assessment Description - To demonstrate your competence in this task, you are required to perform the requirements in part A and part B.
Assessment Instructions -
Part A: Short answer questions: Answer the following questions:
Part B: Short programs: Create an APPLET program for the following requirements below. No input validation necessary. For demonstration purpose, put all programs as specified below:
Key Requirements -
For the submission to be valid, all codes must be demonstrated to the trainer within the time frame given.
Use the coversheet provided to enter all answers. Follow the instructions below:
- File naming convention: JVA_A1_<Nickname>.docx
- Write answers only with clear numbering. DO NOT COPY THE QUESTIONS AND INSTRUCTIONS TO THE COVERSHEET.
Part A:
1. What is called the blueprint from which individual objects are created?
2. These variables are non-static fields, and unique to each instance of a class.
3. These variables are stored in a temporary state inside a method.
4. What is the file extension of bytecode?
5. This method is used by Java applets to get the program ready before it calls the paint method.
6. Provide an HTML code in running an applet in web browser.
Part B:
Project name and package name: JVA_Assessment_1_<first name>
Example: JVA_Assessment_1_John
7. The program below should write: "Hello Applet "10 times. Correct the error of the program below.
package org.me.hello;
import java.applet.Applet;
import java.awt.Graphics;
/**
*
*
*/
public class MyApplet extends Applet {
public void paint(Graphics g)
{
int count = 0, line = 10;
while(count >= 10)
{
g.drawString("Hello Applet", 50, line);
line = line + 10;
}
}
}
8. Display the image: Red_Back_Spider.jpg. The image can be located at Assessment section in moodle.
9. Play the Sound: Dog_Bark.wav. The audio file can be located at can be located at Assessment section in moodle.
10. Compute for the volume of sphere based from the radius entered. The output should say: "The volume of the sphere is n cubic units." where n is the volume computed.
11. Compute for the average of five integers entered. The result should be double. No need to round off the result.
12. Write this statement 100 times using while loop: "statement x., where x is the number of lines starting with 1 and ending in 100. Each sentence should occupy one line; hence the output should be 100 lines.
13. Convert GBP (British Pound) to $AUD. Conversion: GBP 1 = AUD 1.82167. Example. If the user enters GPD 53.75, then the output will say: "The conversion in GBP is 97.91".
14. Convert weight between kilograms(KG) and pounds(LB). There will be two input fields namely:
- Value of the weight
- two-character field either "KG" or "LB".
The output should be the converted value: Example. If the user entered 10 KG, then the output should be: "The converted weight is 22 LB."
Assessment Task 2 - Practical
Assessment Description - Create a program that will divide two integers entered and display the quotient.
Assessment Instructions - Create more complex Java Applets
Create an APPLET program for the following requirements below. No input validation necessary.
For demonstration purposes, follow the specification below:
Key Requirements -
For the submission to be valid, all codes must be demonstrated to the trainer within the time frame given.
Use the coversheet provided to enter all answers. Follow the instructions below:
- File naming convention: JVA_A2_<Nickname>.docx
- Write answers only with clear numbering. DO NOT COPY THE QUESTIONS AND INSTRUCTIONS TO THE COVERSHEET.
- NetBeans source code answers must be pasted to the coversheet. It is not necessary to submit in moodle the entire Java project and its contents, as it will be covered in the demonstration mentioned in the previous point.
Project name and package name: JVA_Assessment_2_<first name>
Example: JVA_Assessment_2_John
1. Create a program that will divide two integers entered and display the quotient. If the divisor is zero, the program should display: invalid divisor.
2. Based from the academic grading table below:
Mark
|
Grade
|
Grade Description
|
85-100
|
HD
|
High Distinction
|
75-84
|
D
|
Distinction
|
65-74
|
C
|
Credit
|
50-64
|
P
|
Pass
|
-50
|
F
|
Fail
|
If a user enters a mark, output the respectiveGrade Description.
Example: Enter the mark: 73.75
Your grade is: C
3. Display the average of the sum of 10 consecutive integers. The integers should be multiples of x, where x is:
- The integer entered by the user.
- The first and smallest integer in the series.
Example:
- If the user entered 2, the it should calculate the sum of 2, 4, 6, 8, 10, 12, 14, 16, 18, 20. The sum will be 110.
- If the user entered 10, the it should calculate the sum of 10, 20, 30, 40, 50, 60, 70, 80, 90, 100. The sum will be 550.
- If the user entered 17, then the sum will be 935.
4. Create a program that determines if a person is qualified for a trip to New York. To be qualified for the trip, the person should be either a VIP or meet at least a total of 60 points from the criteria below:
Criteria
|
Points
|
Age between 18 to 60
|
20
|
Must have medical insurance
|
10
|
Marital Status: Never Married or Widow
|
10
|
American express card holder
|
10
|
Government Employee
|
20
|
The criteria must only be answered with "Y" for Yes or "N" for No.
Attachment:- Assignment Files.rar