logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Develop a C++ class declaration called SavingsAccount class that allows user to input initial values of dollars and cents and then asks for deposits and withdrawals.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 Computer Science II Laboratory One

Pre-Lab

Redefine CDAccount from Display 10.1 to be a class rather than structure. Use the same member variables as in Display 10.1 but make them private. Include member functions for each of the following:

  • to return initial balance

  • to return balance at maturity

  • to return interest rate

  • to return the term

  • default constructor

  • constructor to set all the member variables to any specified values

  • input function (istream&);

  • output function (ostream&);

 

Embed your class definition in a test program. Sample output:

CD Account interest rate: 10

CD Account initial balance: 100

CD Account balance at maturity is: 105 CD Account term is: 6 months

when your CD matures in 6 months it will have a balance of 105.00

 

Enter CD initial balance, interest rate, and term: 200

10

12

CD Account interest rate: 10.00

CD Account initial balance: 200.00

CD Account balance at maturity is: 220.00 CD Account term is: 12 months

when your CD matures in 12 months it will have a balance of 220.00

 

Problem Description: SavingsAccount

Develop a C++ class declaration called SavingsAccount class that allows user to input initial values of dollars and cents and then asks for deposits and withdrawals. The class should include the following information:

Operations (Member Functions)

 

  1. Default constructor that sets both dollars and cents to

  2. The constructor has 2 parameters that set dollars and cents to the indicated

  3. Open account (with an initial deposit). This is called to put initial values in dollars and cents.

  4. Make a deposit. A function that will add value to dollars and cents

  5. Make a withdrawal. A function that will subtract values form dollars and

  6. Show current balance. A function that will print dollars and cents. Give the implementation code for all the member

Data (Member Data)

 

  1. Dollars

  2. Cents

Have the code generate two objects:

  • bank1: has its values set during definition by the user

  • bank2: uses the default

Have the code input deposit and withdraws for both bank1 and bank 2.

Note: you must perform normalization in cents. This means that if cents is 100 or more, it must increment dollars by the appropriate amount.

Example:

If cents is 234, then dollars must be increased by 2 and cents reduced to 34.

Write code that will create an object called bank1. The code will ten initially place $200.50 in the account. The code will deposit $40.50 and then withdraw $100.98. It will print out the final value of dollars and cents.

The following output should be produced:

dollars = 140 cents = 2

Post-Lab: Employee Class

 Write a class named Employee that has the following member variables:

  • A string that holds the employee’s name.

  • An int variable that holds the employee’s ID number.

  • A string that holds the name of the department where the employee works.

  • A string that holds the employee’s job title.

 

The class should have the following constructors:

  • A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: employee’s name, employee’s ID number, department, and

  • A constructor that accepts the following values as arguments and assigns them to the appropriate member variables: employee’s name and ID number. The department and position fields should be assigned an empty string ("").

  • A default constructor that assigns empty strings ("") to the name, department, and position member variables, and 0 to the idNumber member

Write appropriate mutator functions that store values in these member variables and accessor functions that return the values in these member variables. Once you have written the class, write a separate program that creates three Employee objects to hold the following data.

The program should store this data in the three objects and then display the data for each employee on the screen

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

682 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

809 Answers

Hire Me
expert
Husnain SaeedComputer science

971 Answers

Hire Me
expert
Atharva PatilComputer science

605 Answers

Hire Me
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30