Question: using main method like public static void main(String[] args) { please and thanks II. Creating an Application from Scratch: Part A Write a Java class
![using main method like public static void main(String[] args) { please](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f38fd0d7a6d_09666f38fd05e9a8.jpg)

II. Creating an Application from Scratch: Part A Write a Java class named Creditcard that can be used to create & work with Creditcard objects. For each Creditcard, we need to keep track of the name of the card holder (e.g. "Pierre Martin"), the credit card number (e.g. 4567890123456789), as well as the current balance owing (which is always 0.00 when the card is first issued). In the creditcard class, include three instance variables and one constructor. The constructor should initialize the instance variables. Provide three simple accessor methods one to retrieve the card holder's name. one to retrieve the card number, and one to retrieve the current balance owing. Provide a mutator method that would be called when making a purchase with this Creditcard. This method adds the price of a purchase to the card's balance owing. The purchase amount is passed in through a parameter. Provide a mutator method that would be used to make a payment on the Creditcard's balance. This method reduces the balance owing on the card by the payment amount which is passed in through a parameter. Include one more accessor method that will calculate and return the amount of interest that will be charged on the balance owing on the Credit Card when given the interest rate as a percentage. For example, if the current balance owing on the creditcard is 130.00 and the interest rate on the card is 12%, the amount of interest would be 15.60. This method will accept the interest rate as a percentage expressed in decimal format (e.g.0.12 for 12%) and return the amount of interest. Side Notes Re: Java's Numeric Types (see also: Section 2.3 of the course textbook) Java has 6 built-in primitive data types for representing numeric values: float and double for floating-point values and byte. short, int and long for whole numbers. These types differ by the amount of memory space that is used to store a value of that type. For floating point numbers, we usually choose double, since this type uses 64 bits (where float only uses 32 bits) and we usually want as much precision as possible when working with decimal values. For whole numbers, we will often choose int as the default but we may sometimes choose one of the other integer types (If we need to use more or less space). Since the int type uses 32 bits to represent the number, an int variable can hold values in the range: -237 to 231-1 (that is: 2147483648 to 2147483647). If you need to store values that are larger for smaller than what an int can accommodate. you would choose the long data type. Since long uses 64 bits for storage, a long variable can hold in the to 24-1 -20 to values range lor: -9223372036854775808 9223372036854775807) Part B . . Write and test a Credit Carddriver class. This class will serve as a driver program for Port A and should be saved in the same folder as the creditcard class. In the main method of the creditcardDriver class, include statements to support the following in this order): Mateo Garcia receives his credit card. His credit card number is 1234123412341234. Create a Credit Card object called mateosCard Mateo buys a winter jacket, which costs 112.55. Sarah Jones gets a new credit card with the number 246813578642, call this object variable sarahsCard. Sarah buys a computer for 1675.89 Justin Tremblay's credit card arrives in the mail with the number 234510106789: call this object variable justinsCard. Justin uses his credit card to buy a 25.00 Amazon gift card as a birthday gift for a friend. Jill Thomas got a credit card with the card number 3579864278901234: call this object variable 111.Card. With her new credit card. Jll buys groceries that cost 75.86, and then she buys a USB drive to back up her work for 63.44. (Use two separate statements. one for each purchase.) Sarah makes a payment of 500.00 on her card. Justin decides to also make a payment on his card. He pays 10.00. Mateo then decides to go snowboarding at Crabbe Mountain and orders his lift ticket online for 40.00. When he gets there he realizes that he forgot his helmet so re rents ane: this costs 6.00. (Use two separate statements, one for each purchase.) Jill makes a payment of 96.50 on her card Justin makes another payment of 15.00 on his card. Mateo's credit card charges 20% Interest. Sorah's card is a bit better the interest rate is 17%. Both Justin and have credit cards that charge 12.5% interest Next, for each of the four creditcard objects print out the card holder's name. the credit card number, the current balance owing, and the amount of interest they will be charged on this balance. Aside: You do NOT need to worry about displaying the monetary amounts with exactly 2 decimal digits.) NOTE: In this driver program be sure to label all of your output so the meanings of the values are clear. fl.e. Don't just print out numbers without explaining what they represent.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
