Write a program using class ‘Rectangle’ to compute the area and perimeter of rectangle. The Class rectangle should have the following members:
· Two data members’ length and width.
· One member function ‘setData’ to assign values to data members ‘length’ & ‘width’. It should also verify that length and width between 0.0 and 25.0
· One member function ‘area’ to compute and print the area of rectangle.
Area =length * width
· One member function ‘perimeter’ to compute and print the perimeter of rectangle.
Perimeter =2*(length * width)
Write a program using class ‘FindEnergy’ to compute the Potential Energy and kinetic Energy of an object. The class FindEnergy should have following members.
• Four data members mass, height, velocity and gravity (9.8m/s2) take gravity as Constant.
• One member function ‘setInputData’ to assign values to data members.
• One member function ‘potentialEnergy’ to compute. And return the Potential Energy.
HINT: P.E=mgh
• One member function ‘kineticEnergy’ to compute. And return the Kinetic Energy.
HINT: K.E=1/2 mv2
Give an example of a while loop, then provide the equivalent do-while loop and for loop. Then give a different example of a do-while loop, along with the equivalent while loop and for loop. Finally, give an example of a for loop, along with the equivalent while loop and do-while loop. Use your examples to illustrate the advantages and disadvantages of each looping structure, and describe those advantages and disadvantages.
In the character class main method, implement code to demonstrate applying the above classes as follows: (a) Declare a Character reference variable and create one of your custom character objects to store in it (b) Create an Item object for use by the character (c) Simulate the character receiving and using the item by calling character class method.
Make UML diagrams for your character class and item class, including fields
Write a class in java to get the name of Student and marks of three subjects. Calculate the total marks and average marks. Each subject has a maximum of 100 marks.
Question: Use your own theme to make your own class design and implementation unique, giving the character unique attributes and actions.
Implement a main game character object oriented class type to simulate what is common to all characters in your game
A class data field (variable) (data member) to represent the name/identifier of the character/ make sure each character can carry an item
Management of Goodwill Pharmacy have approached your group to develop an application that prints receipts of Medication purchased by customers. Write a JAVA program to generate a receipt [using the sample below] for the medication sold as Goodwill Pharmacy.
The application should;
i. accept as inputs the ITEM(S), QUANTITY, DISCOUNT, UNIT PRICE, TOTAL, TAX RATE, VAT, NET VALUE, and CASH PAID.
ii. calculate TOTAL AMOUNT, BILL TOTAL, BALANCE
iii.
display the ITEM(S), QUANTITY, DISCOUNT, UNIT PRICE, TOTAL, TAX RATE, VAT, NET VALUE, TOTAL AMOUNT, BILL TOTAL, BALANCE, and CASH PAID [using the sample below].
How to print duplicate values using parameterized constructor
using javafx
A dentist requests you to develop the Dental Payment application. This application is used to calculate the total bill. The clinic provides the services and their price as shown in the table below.
Services Prices (RM)
1.Cleaning 35.00
2.Cavity Filling 150.00
3.X-ray 85.00
4.Flouride 50.00
5.Root canal 225.00
6.Other Type in
Your dental payment entry form is shown as follows:
-----------------------------------------
Dental Payment Application
-----------------------------------------
Dental Payment Entry Form
Patient Name
Services Prices(RM)
Cleaning 35.00
Cavity Filling 150.00
X-ray 85.00
Flouride 50.00
Root canal 225.00
Other
---------------------------------------
total
calculate
Question 1) Declare and initialize a one dimensional array to hold the numeric index values for each character in your own simulated game theme.
Question 2) Declare and initialize a two dimensional array to hold the textual character attribute data for all characters. Include data for at least two textual attributes per character