BankAccount.java
/** java.util package is imported to use Scanner class for
accepting input from user */
import java.util.*;
/** Definition of class BankAccount */
public class BankAccount
{
/** instance/member variables of the class */
String name;
String address;
String city;
String state;
String zipcode;
String socialsecurity;
int balanceamount;
/** Method to deposit amount to the initial balance */
public void deposit(int amt)
{
balanceamount = balanceamount + amt;
}
/** Method to withdraw amount from the initial balance */
public void withdraw(int amt)
{
balanceamount = balanceamount - amt;
}
/** Method to display the details of the account */
public void display()
{
System.out.println("Account Details");
System.out.println("===============");
System.out.println("Name :: " + name);
System.out.println("Address :: " + address);
System.out.println("City :: " + city);
System.out.println("State :: " + state);
System.out.println("Zipcode :: " + zipcode);
System.out.println("SocialSecurity :: " + socialsecurity);
System.out.println("Account balance :: $" + balanceamount);
}
/** Method to calculate the count of bills in the balance amount
*/
public void calculateCountOfBills(int amt)
{
/** the bills available are stored in an array */
int[] bills = new int[]{ 78, 33, 12, 3, 1 };
int count;
System.out.println("Bill amount : Count");
System.out.println("=========== : =====");
/** The number of first maximum bill available is found by dividing
the amount
* by the bill value ($78 initially,) and get the count.
* Find the balance amount using (amt-(count *bills[i]))
* Take the next highest bill value from the array and check for
count in the
* same way. This process continues as long as there is
balance.
*/
for (int i = 0; i < bills.length; i++) {
if (amt >= bills[i]) {
count = amt / bills[i];
System.out.println("$" + bills[i] + " : " + count);
amt = amt - (count * bills[i]);
}
}
}
/** Driver method to accept all details from the user using Scanner
object and call
* methods as required in the specific order
*/
public static void main(String[] s)
{
BankAccount ba = new BankAccount();
Scanner sc = new Scanner(System.in);
System.out.print("Enter Full name :: ");
ba.name = sc.nextLine();
System.out.print("Enter Street address :: ");
ba.address = sc.nextLine();
System.out.print("Enter City :: ");
ba.city = sc.nextLine();
System.out.print("Enter State :: ");
ba.state = sc.nextLine();
System.out.print("Enter Zipcode :: ");
ba.zipcode = sc.nextLine();
System.out.print("Enter Social Security :: ");
ba.socialsecurity = sc.nextLine();
System.out.print("Enter Initial account balance :: ");
ba.balanceamount = sc.nextInt();
System.out.println("\nAfter Initial Balance ::");
ba.display();
ba.deposit(1300);
System.out.println("\nAfter Depositing $1300 ::");
ba.display();
ba.withdraw(600);
System.out.println("\nAfter Withdrawing $600 ::");
ba.display();
System.out.println("\nCount of Bills");
ba.calculateCountOfBills(ba.balanceamount);
}
}
=========================================================================================



Output:


in java (Bank Account) Write a program that inputs in the full name, street address, city, state, zip code, and social...
Write a program that uses a structure to store the following data about a customer account: Name Address City, state, and ZIP Telephone number Account Balance Date of last payment The program should use an vector of at least 20 structures. It should let the user enter data into the vector, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Input Validation: When the data for...
Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...
This year Evan graduated from college and took a job as a deliveryman in the city. Evan was paid a salary of $68,500 and he received $700 in hourly pay for part-time work over the weekends. Evan summarized his expenses below: Cost of moving his possessions to the city (125 miles away) Interest paid on accumulated student loans Cost of purchasing a delivery uniform Contribution to State University deliveryman program $1,200 2,840 1,440 1,320 Calculate Evan's AGI and taxable income...
Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...
Harriet And Smoking Cessation This chapter’s case study demonstrates the usefulness of the Ecological Model and its interaction with individual-focused interventions, and it also draws together information from other models discussed in the chapter. The case study is presented in segments of a life course as well as an episodic perspective of factors involved in the case. It provides a perspective of the social changes that allow individual behavior changes to succeed, while also examining some of the processes involved...
First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....