Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Test Plan for Lab 1

Test Plan for Lab 1

Test Plan for Lab 1

Question Description

Write this code using Visual studio and write the code in separate files and fallow all these steps.

Write a Test Plan and create a test driver to test the Lab 1 Key code. Create a text file with enough command inputs to _thoroughly_ test the Lab 1 code. Plan your command inputs to exercise all normal app input types as well as any special cases (like boundary conditions and purposely wrong commands as input).

Your test driver will initially check for the presence of a test input file. If the input file does not exist, the app should display the menu and execute as normal Lab 1 code. If the input file does exist, read each command input , execute the input, and write the results to an output text file. Be sure to number each test in your input file, and number and describe each test in your output file. Make it easy for a person reading your output file to tell what happened in the code.

Start with the posted Lab 1 Key.

Submit your .cpp and .h files, your command input text file, and your output text file with test results. Name your input file lab1_test_input.txt.

#include <iostream>

#include <stdlib.h>

using namespace std;

class BankAccount

{

private:

//instances of the class

float balance, interestRate;

public:

//default constructor

BankAccount()

{

balance = 0;

interestRate = 0;

}

//getters and setters

void setBalance(float balance)

{

this->balance = balance;

}

float getBalance()

{

return balance;

}

void setInterestRate(float interestRate)

{

this->interestRate = interestRate;

}

float getInterestRate()

{

return interestRate;

}

//for performing deposit function

void deposit(float amount)

{

//deposit only when amount is more than 0

//else keep the balance unchanged

if (amount > 0)

balance += amount;

}

//for performing withdraw function

void withdraw(float amount)

{

//withdraw only when the amount is less than the balance

//else keep the balance unchanged

if (amount < balance)

balance -= amount;

}

//calculating the interest and adding it to the balance

void addInterest(int months)

{

interestRate = interestRate / 100;

for (int i = 0; i < months; i++)

{

balance = ((balance * interestRate) / 12) + balance;

}

}

};

int main()

{

BankAccount obj;

cout << “Initial Balance: $” << obj.getBalance() << endl;

cout << “Initial Interest Rate: ” << obj.getInterestRate() << “%” << endl;

//setting balance and interest rate

obj.setBalance(5000);

obj.setInterestRate(5);

cout << “nAfter Setting the Balance and Interest Rate” << endl;

cout << “Balance: $” << obj.getBalance() << endl;

cout << “Interest Rate: ” << obj.getInterestRate() << “%” << endl;

//depositing

obj.deposit(1250);

cout << “nBalance after deposit: $” << obj.getBalance() << endl;

//withdrawing

obj.withdraw(750);

cout << “nBalance after withdraw: $” << obj.getBalance() << endl;

//after interest added

obj.addInterest(6);

cout << “nBalance after interest added: $” << obj.getBalance() << endl;

}

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20