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

a. Write a program to define a class Shape with data members row and column. The superclass has a constructor that used to set row and column and method rectangle() with access specifier ‘protected’ which used to display the shape of rectangle.
b. Create a class ShapeTriangle that inherits from class Shape by implement keyword ‘extends’. This class has a constructor that make a call to superclass constructor by using keyword super() and a method triangle() that display the shape of triangle.
Write a program to calculate students average test scores and their grades. You may assume the following data: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Use three arrays: a one-dimensional array to store the student names, a (parallel) twodimensional array to store the test score, and a parallel one-dimensional array to store grades. Your program must contain a function to read and store data, function to calculate largest , function to calculate average grade and test scores and a function to output the results and function for the best student.
Write an application for the Summerdale Condo Sales office; the program determines the price of a condominium. Ask the user to choose 1 for park view, 2 for golf course view, or 3 for lake view. The output is the name of the chosen view as well as the price of the condo. Park view condos are $150,000, condos with golf course views are $170,000, and condos with lake views are $210,000. If the user enters an invalid code, set the price to 0.

Add a prompt to the CondoSales application to ask the user to specify a (1) garage or a (2) parking space, but only if the view selection is valid. Add $5,000 to the price of any condo with a garage. If the parking value is invalid, display an appropriate message and assume that the price is for a condo with no garage.
Write a Person class with an instance variable age , and a constructor that takes an integer,initialAge , as a parameter. The constructor must assign initialAge to age after confirming the argument passed as initialAge is not negative; if a negative argument is passed as initialAge, the constructor should set age to 0 and print Age is not valid, setting age to 0.. In addition, you must write the following instance methods:

yearPasses() should increase the age instance variable by 1.
amIOld() should perform the following conditional actions:
If age<13, print You are young..
If age>=13 and age<18, print You are a teenager..
Otherwise, print You are old.
The general form of the equation of a straight line can be expressed as Ax + By + C = 0 with a condition that A and
B cannot both be zero. This equation can also be expressed as: y=
−(
In Java programming language, there are several methods in a class that have the same name but different
arguments/signatures. This concept is called method overloading. Now, create a class that have several methods
to add two numbers and return the total value as below:

sum (int numberOne, int numberTwo)
- return value is int
sum (float numberOne, float numberTwo)
- return value is float
sum (int numberOne, float numberTwo)
- return value is float
Write a program to apply the package. The package is customer will consist classes of member and non-member.
Member:
- There are method to calculate discount() -15% per item.
Non-member:
- No discount
Write a program to get a student marks. The marks consist Lab1,Test1 and PBT1. If the average of marks is below than 40, output “Student cannot sit final exam” will display. You must apply constructor in your program.
In this question you will be calculating the class average for a test a class of students recently took. It is your job to write a program that does the calculation and outputs the class average in a user-friendly format. Each of the following students’ marks was out of 100. Create a new Java Project with a descriptive project name, each mark should be stored in a variable. HINT, The student’s name should NOT be part of the variable name, that is too specific and limits the program from use with different students.
Bart
72
Moe
43
Lisa
98
Barney
97
Maggie
95
Lenny
85
Homer
23
Itchy
36
Marge
64
Scratchy
41
Ned
81
Ralph
7
Maude
57
Milhouse
60
Rodd
70
Nelson
48
Todd
68
Jimbo
65
Willy
100
Montgomery
93
Seymour
91
Wayland
90
Edna
85
In java statement int a=10,b=8; its right or wrong?
LATEST TUTORIALS
APPROVED BY CLIENTS