CSE278 Lab6 Creating Classes in C++

$30.00

Category: Tags: , , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (8 votes)

In this lab, we will be introducing NetBean (an IDE for C++) and it is expected that you complete the
assignment using NetBean. Please watch the entire video below as you may notice a certain style error
suggests a build failure, but the program will still compile in the IDE and you can run the executable from
the terminal!

Lab6_NetBeansTutorial

  0:00 / 13:04  1x 
Exercise: Using the Miami University C++ Project in NetBeans, you will need to utilize classes and OOP
to implement a bank account with basic properties and methods. The properties of a bank account are:
owner [3 points]
balance [3 points]
address [3 points]
The methods are:
depositMoney [3 points]
withdrawMoney [3 points]
getBalance [3 points]
updateAddress [3 points]
getAddress [3 points]
Note: The owner and initial balance should be set only by the constructor [4 points].
The program will need to split the appropriate declarations and definitions between header [6 points]
and source [6 points] files. A test file (testBank.cpp
(https://miamioh.instructure.com/courses/129645/files/17356055/download?wrap=1)
(https://miamioh.instructure.com/courses/129645/files/17356055/download?download_frd=1) ) has been
provided. To add it your project, first move it into your project’s folder (the folder in the NetBeansProjects
director), and then import it by right-clicking the project in the “Source Files” folder in your project and
clicking “Add Existing Item”. Find the testBank.cpp
(https://miamioh.instructure.com/courses/129645/files/17356055/download?wrap=1)
(https://miamioh.instructure.com/courses/129645/files/17356055/download?download_frd=1) file to add it. If
you have a default main.cpp file, you will need to delete by right-clicking it and selecting the “Remove
from Project” option. If you do not do these steps in the IDE, then you will need to manually modify the
build files – so do it in the IDE.
The output should match the following:
Test 1: 6000 Alternative Street
Test 2: 31000 Miami Place
Test 3: 995.65 Peach Grove
Command line compiling:
g++ -std=c++14 BankAccount.cpp testBank.cpp -o BankTest
Submission:
Submit all files including the test file.
Extra Credit: Savings Account
Lab 6 Rubric
[5 points]
Create a subclass of bank account for savings accounts that has the additional property of interest rate
that is set by the constructor and it has a method to both get and update the interest rate. A test file
(testSavings.cpp (https://miamioh.instructure.com/courses/129645/files/17356054/download?wrap=1)
(https://miamioh.instructure.com/courses/129645/files/17356054/download?download_frd=1) ) has been
included – you may need to follow the same steps as above and remove the testBank.cpp
(https://miamioh.instructure.com/courses/129645/files/17356055/download?wrap=1)
(https://miamioh.instructure.com/courses/129645/files/17356055/download?download_frd=1) file. It should
match the output:
Test 1: 7200 Main Street 5.3
Test 2: 1000 Miami Place 7.32
Test 3: 986.65 Orange Grove 2
Hint1: The following is an example of creating a subclass (Dog is a subclass of Animal):
Header file:
class Dog : public Animal {
// info for the Dog class
}
Hint2: The constructor must initialize the parent class. Example:
Source file
Dog::Dog(int age, string type) : Animal (age), breed(type) {
}
(assuming Animal has a variable for age and only Dog has a variable for breed).
Command line compiling:
g++ -std=c++14 SavingsAccount.cpp BankAccount.cpp testSavings.cpp -o SavingsTest
Submission:
Submit all files including the test file.
Total Points: 45
Criteria Ratings Pts
9 pts
15 pts
4 pts
12 pts
5 pts
Bank Account Properties: owner, balance, address 9 pts
Full
Marks
0 pts
No
Marks
Methods: depositMoney, withdrawMoney, getBalance, updateAddress,
getAddress
15 pts
Full
Marks
0 pts
No
Marks
The owner and initial balance should be set only by the constructor 4 pts
Full
Marks
0 pts
No
Marks
Split declarations and definitions between header and source files. 12 pts
Full
Marks
0 pts
No
Marks
Extra Credit 5 pts
Full
Marks
0 pts
No
Marks