Question: Complete the following tasks in Java within the lab time using NetBeans. Create a class called Client and has 1 class field and 3 instance
Complete the following tasks in Java within the lab time using NetBeans. Create a class called Client and has 1 class field and 3 instance variables 1. No as an Integer (class field) 2. ID as a String 3. Name as a String 4. Balance as a Double Your class should have a constructor that take the ID, Name and an initial Balance and use it to initialize the balance amount. Your constructor should validate that the initial Balance is greater than 0, otherwise balance should be initialized to the default value 0.0. Provide a set and a get method for each instant variable Add a method called deposit that add an amount to the accounts balance. It also should print the updated balance. Add a method called debit that withdraws money from an account. Ensures that the debit amount does not exceed the accounts and if it does the method should keep the balance as it is and print a message to the user indicating that The debit amount exceeded account balance. Then the method should ask the user to enter another amount or (0) to exit. If the withdraw amount is correct the method should print the updated balance. Write a class called TestAccount with a main method in this method you will create 3 objects of the class account. Prompt the user to enter the id, Name and the initial balance Then ask the user for the wanted operation (show balance, deposit or debit) and perform it.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
