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

Class "Savings"..

int id, String name, double balance, double interestRate

Add a constructor of Savings that receives four parameters: id, name, balance, interest rate. Validate that interest rate is greater than zero, and add set & get methods.

I know how to do most of the above, but how do I validate that the interest rate is greater than 0? Can you give a few random examples of validating variables? Does this happen in the set/get methods?
Using the method calcInterest in the super class, create calcInterest that calculates interest as follows
Interest=balance*interest rate* extra rate.
11- Using the method toString in the super class, create toString method that prints all information of ThreeYearSaving.
12- Create class called Test, in main method create an object of type ThreeYearSaving and call method toString
7- Using the method toString in the super class, create toString method that prints all information of SavingAccount
8- Create class ThreeYearSaving that extends class SavingAccount. It has one more data which is extraRate(double).
9- Add Add constructor that receives five parameters: id, name, balance, interest rate, extra rate. Validate that extra interest rate is greater than zero, and add setter,getter methods.
4- Create class called savingAccount that extends class Account. It has one more data which is interestRate(double).
5- Add constructor that receives four parameters: id, name, balance, interest rate. Validate that interest rate is greater than zero, and add setter,getter methods.
6- Add method calcInterset that calculates the interest as follows
interest=balance*interest rate.
1- Create class called Account that has id(int), name (String), balance (double).
2- Add parametrized constructor, setter, getter methods. Validate that balance is always positive.
3- Add method toString that returns account information as a string.
Declares and create an array of 5 instances of Vehicle, two of which should be Dumpers, two of which should be Excavators and the other should be a Telehandler.

Dumper, Excavator and Telehandler are subclasses of Vehicle.
Write a java program that will do the following. Use classes and methods as needed.

1. Prompt the user to input five integers.
2. Put the integers into an array named UserNums
3. Display the sum of the numbers and the average.
4. Write the numbers out to a file named UserNums.txt. Use a relative path so the file will be saved in your project folder.
Create an application that allows you to enter student data that consists of an ID number, first name, last name, and grade point average. Depending on whether the student's grade point average is at least 2.0, output each record either to a file of students in good standing or those on academic probation. Save the program as StudentStanding.java.
Object class Borrower to represent a borrower in library.

Name: Pat Reeds
Library No: LIB214
Max books on loan: 3
Current books on loan: 2

Initialisin new borrower via constructor
Displayin details about borrower
Amendin borrowers name
Amendin borrowers borrowing limit
Borrowin book (provided the max not been exceeded)
Returnin book (provided at least 1 book is on loan)


•exercise is only concerned with recordin how many books a borrower has currently on loan
•Borrowin a book involves addin one to the number of books currently on loan
•Returnin a book involves reducin the no of books currently on loan by 1

Test class in simple program that declares 1 instance of class & checks each of methods

Use Borrower class in program that creates 1 instance of class & then presents the user with menu:

Library System

1. Display borrowers details
2. Amend borrowers name
3. Adjust borrowers borrowin limit
4. Record borrowin of a book
5. Record return of a book
6. Exit
You must also override toString() method and return a user-friendly receipt of all the items in the basket in this cashier. Once you run the TestSystem.java file that is already supplied, you must see something similar to the following:

Number of items is: 4
Total cost is: 157.69
Total tax is: 3.94
Eat Healthy Fruit Shop
---------------------
12 @ 45.00 /dz
Gala Apples 45.00
2.30 kg @ 4.30 /kg
African bananas 9.89
23 @ 3.20 /pc
Qatari Lemons 73.60
1 @ 19.20 /cp
+ 10.00 Labor
Lemon mix juice 29.20
Tax: 3.94
Total cost: 161.63
Eat Healthy Fruit Shop
---------------------
23.00 kg @ 33.20 /kg
Thailand Bananas 763.60
4 @ 19.20 /cp
+ 10.00 Labor
Juice Mix 86.80
Tax: 21.26
Total cost: 871.66
LATEST TUTORIALS
APPROVED BY CLIENTS