1.Creating a class called Cash that consists of two values, a double balance, and a double interest rate. Make the class

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1.Creating a class called Cash that consists of two values, a double balance, and a double interest rate. Make the class

Post by answerhappygod »

1.Creating a class called Cash thatconsists of two values,a double balance, anda double interest rate. Makethe class so that both values can be retrieved and changed outsideof the class. Require that when an instanceof Cash is created, boththe balance and interestrate must be specified.
Using what you know of Java, provide what you believe to be thebest implementation of such a class.
2.Creating a class Loan that consistsof four values,a double balance,a double interest rate, an int limit,and an int penalty.
Using what you know of Java, provide what you believe to be thebest implementation of such a class.
3.Add an additional method toyour Cash type of Question 1. The methodshould be update that takes no input andincreases the balance ofthe Cash by the product ofthe interest rate and the balance.Write the method as it would appear insidethe Cash type then use the properobject-oriented coding style.
4.Change the behavior ofthe update methodthat Loan inheritsfrom Cash. The new behavior is to increasethe balance ofthe Loan by the product ofthe interest rate and the balance.Then, if the resulting balance is larger thanthe limit, the balance isdecreased by the penalty. Write the method as itwould appear inside the Loan class anduse a proper object-oriented coding style.
5.Writing a method that takesa String anda Char as inputs and returnsa String. Theoutput String is the same as theinput String except that all of theoccurrences of the input Char areremoved from the input String. Forexample, removeChars("abracadabra", 'a')should return "brcdbr " because all ofthe Char 'a' is removed from theinput String.
6.Writing a class method that takes six parameters:two double values,two int values, andtwo boolean values. The method returnsa boolean value.
The method returns true if atleast one of the following statements are true andfalse otherwise:
7.
public class Utility
extends Object
Constructor Summary
Method Summary
Creating a new type of utility calledan InternetUtility. The InternetUtility extends Utility andit should work exactly the sameas Utility except:
Using what you know of Java, provide what you believe to be thebest implementation of such a class
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply