Java | JSP | JSF Answers

Questions: 4 418

Answers by our Experts: 3 943

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

Write a Java program that will create an array called ageArray of 10 ages. Prompt the user to input each age and store the age in the array. Then, calculate the average age. Output all the values in the array and the average age with appropriate description.
MSU Holding Sdn Bhd hires a programmer to create an application to calculate their student fee using class and object method.

class student
{
private String name;
private String student_ID;
private double num_of_subject;
}

• Create a class named student. Add new data fields that are String name, String student_ID and double num_of_subject. This class will store the information from the main class using set and get method.

• Create a class named Fee. This class will calculate the fees for a particular student. The fee for per subject is RM250. The calculation is fee = num_of_subject x 250.

• Create a main class which will ask the user to enter the following data: student Name, student ID and number of subject taken for particular semester using Scanner technique. This program must be able to display back all the data entered by the user and student fee.
create an application to calculate their student fee using class and object method.

class student
{
private String name;
private String student_ID;
private double num_of_subject;
}

• Create a class named student. Add new data fields that are String name, String student_ID and double num_of_subject. This class will store the information from the main class using set and get method.

• Create a class named Fee. This class will calculate the fees for a particular student. The fee for per subject is RM250. The calculation is fee = num_of_subject x 250.

• Create a main class which will ask the user to enter the following data: student Name, student ID and number of subject taken for particular semester using Scanner technique. This program must be able to display back all the data entered by the user and student fee.
Calculate staff payroll. Create a class named payroll that calculates staff payroll by checking on the hours worked. Use constructor to store value of hours worked and rate. Provide a methods named CalculatePayroll().

Create an extended class named overtime class if hours worked more than 40 hours. Provide a methods named CalculateOT(). For one hour RM 50.

Write an application named staffPayroll that creates an object of each class, demonstrates that all the methods work correctly. Get the user input for hours worked and rate.
Write a new public method in your Beach class called addTurtle(). This method should pick a random x/y location (e.g., using Random.generator()) on the beach and add a single Turtle there.

How do I do this??
Build a java application (OOP concepts). As your reference only, you can take any examples of real application (Vending machine, ATM or etc) or calculation to be used in your programs as long as it meet the requirements below

• Should have basic object and class, inheritance and encapsulation, separated method in main class, selection statement, and repetitive input from the user.
• Consisted of more than three classes. At least two super classes
i want to take inputs from a text file to arrays to use later in the program
i tried this but i always get a null output
String[] anArray;
anArray = new String[10];
Scanner input = new Scanner(file).useDelimiter(" ");
while (input.hasNext()) {
if (input.equals("Add_Emp_Name")) {
for (int i = 0; i > 10; i++) {
anArray[i] = input.next();
}
}
Lab 2h: Ingredient Adjuster (pg. 108 #17)
1. Open your template. Save the file as Lab2h.
2. A cookie recipe calls for the following ingredients:
• 1.5 cups of sugar
• 1 cup of butter
• 2.75 cups of flour
The recipe produces 48 cookies with these amounts of the ingredients.
3. Write a program that asks the user how many cookies he or she wants to make, and then displays the number of cups of each ingredient needed for the specified number of cookies.
4.​Assign to the variable sum the value of the algebraic expression below. Be careful to follow the order of operations! Assume sum and num are integers.

​num (num + 1)
​sum = ​------------------
​2




II​Assume the variable below are declared and initialized as shown:
​(1 point each) no calculators!
​int n, m;
​double x, y;
​n = 23; m = 5; x = 2.3; y = 4.5;


What is the value of each expression below?

1. n/m = _______ 2. n % m = ______ 3. 25 % m = _____ 4. m / n = ______

5.​n- x * 2 = _____ 6. y – x + m = _______ 7. (double)n / m =______
III. Assume that a String identifier sentence references the String below
sentence = “This is my first real homework.”;
(5 points)
What is the value of each expression below?

sentence.length()


sentence.charAt(3)


sentence.toLowerCase()


sentence.toUpperCase()
LATEST TUTORIALS
APPROVED BY CLIENTS