Create a class named Calculate. Add 2 instance variables, Quantity and UnitPrice. UnitPrice can include Rupees and Cents. Add a no-argument constructor. Add getters and setters for the 2 instance...


write java codes


Create a class named Calculate.<br>Add 2 instance variables, Quantity and UnitPrice. UnitPrice can include<br>Rupees and Cents.<br>Add a no-argument constructor.<br>Add getters and setters for the 2 instance variables.<br>Add a user defined method named Total with no arguments. Total will<br>calculate and return Quantity*UnitPrice. If Quantity is greater than 10, give<br>5% discount.<br>Add a user defined method to display the total amount to the user.<br>Create a Java Main application to create 2 objects based on the Calculate<br>class to test the program.<br>

Extracted text: Create a class named Calculate. Add 2 instance variables, Quantity and UnitPrice. UnitPrice can include Rupees and Cents. Add a no-argument constructor. Add getters and setters for the 2 instance variables. Add a user defined method named Total with no arguments. Total will calculate and return Quantity*UnitPrice. If Quantity is greater than 10, give 5% discount. Add a user defined method to display the total amount to the user. Create a Java Main application to create 2 objects based on the Calculate class to test the program.

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here