Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need to update this file import static org.junit.Assert.*; import org.junit.Test; public class BankAccountIA3Test { // test constructors @Test public void test_creation(){ BankAccount b = new

image text in transcribed

image text in transcribed

need to update this file

image text in transcribed

import static org.junit.Assert.*;

import org.junit.Test;

public class BankAccountIA3Test { // test constructors @Test public void test_creation(){ BankAccount b = new BankAccount(); assertEquals("Expected initial balance to be 0.0", 0.0, b.getBalance(), 0.00001); String actualAccountNumber = b.getAccountNumber(); assertEquals("Account number should have exactly length 4 (4 digits)", 4, actualAccountNumber.length()); int num = Integer.parseInt(actualAccountNumber); assertTrue("Account number should be a number between 1 and 9999 (inclusive)", 1

String actualAccountNumber = b.getAccountNumber(); assertEquals("Account number should have exactly length 4 (4 digits)", 4, actualAccountNumber.length()); int num = Integer.parseInt(actualAccountNumber); assertTrue("Account number should be a number between 1 and 9999 (inclusive)", 1

String actualAccountNumber = b.getAccountNumber(); assertEquals("Account number should have exactly length 4 (4 digits)", 4, actualAccountNumber.length()); int num = Integer.parseInt(actualAccountNumber); assertTrue("Account number should be a number between 1 and 9999 (inclusive)", 1

String actualAccountNumber = b.getAccountNumber(); assertEquals("Account number should have exactly length 4 (4 digits)", 4, actualAccountNumber.length()); int num = Integer.parseInt(actualAccountNumber); assertTrue("Account number should be a number between 1 and 9999 (inclusive)", 1 ) : ", "(Alan Turing 123) 3426: 101.56", b.toString()); } }

1 public class BankAccount private double balance; private String accountNumber; 4 6 public double getBalance() return this.balance; 10 public String getAccountNumber) return this.accountNumber 12 13 @override 15 public String toString) 16 return ""this.accountNumber+":"+ String.value0f (this.balance) +"; 18 19 public void deposit (double amount) if (amountbalance 21 this.balance -balance +amount; 23 4 public void withdraw(double amount) 25 26 27 28 29 public BankAccount) 30 31 32 if (amount

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions