1. Engineering
  2. Computer Science
  3. lab one includes three parts go over the lab instructions...

Question: lab one includes three parts go over the lab instructions...

Question details

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 185.00 Enter CD initial balance, interest rate, and term: 200 1e 12 CD Account interest rate: 10.00 CD Account initial balance: 280.00 CD Account balance at maturity is: 220.e0 CD Account term is: 12 months when your CD matures in 12 months it will have a balance of 220.00Problem 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) Default constructor that sets both dollars and cents to 0 2. 1. The constructor has 2 parameters that set dollars and cents to the indicated values. 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 cents. 6. Show current balance. A function that will print dollars and cents. Give the implementation code for all the member functions. Data (Member Data) 1. Dollar 2. Cents Have the code generate two objects: * bankl: has its values set during definition by the user bank2: uses the default constructor Have the code input deposit and withdraws for both bankl 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 bankl. 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 = 2Post-Lab: Employee Class Write a class named Employee that has the following member variables . name. A string that holds the employees name . idNumber. An int variable that holds the employees ID number . department. A string that holds the name of the department where the employee works * position. A string that holds the employees job title The class should have the following constructors . A constructor that accepts the following values as arguments and assigns them to the appropriate . A constructor that accepts the following values as arguments and assigns them to the appropriate .A default constructor that assigns empty strings () to the name, department, and position member variables: employees name, employees ID number, department, and position. member variables: employees name and ID number. The department and position fields should be assigned an empty string (). member variables, and 0 to the idNumber member variable 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 an array of 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 Name Susan Meyers Mark Jones Joy Rogers ID Number 47899 39119 81774 Department Accounting IT Manufacturing Position Vice President Programmer Engineer

1 E//DISPLAY 10.1 A Structure Definition 2 //Program to demonstrate the CDAccount structure type. #include iostream» using namespace std; 6 //structure for a bank certificate of deposit: 8 struct CDAccount 9 double balance; double interestRate int term;//months until maturity 12 13 15 16 17 void getData(CDAccount& theAccount); E//Postcondition: theAccount.balance and theAccount.interestRate //have been given values that the user entered at the keyboard 19 20 21 Eint main() 23 24 25 26 27 CDAccount account: getData(account); double rateFraction, interest rateFractionaccount.interestRate / 100.0; interestaccount.balance*rateFraction (account.term 12.0); account.balanceaccount.balance interest; 29 30 31 cout.setf(ios::fixed); cout.setf(ios: :showpoint); cout.precision(2); cout <When your CD matures in 34 << account.termくく months, << it will have a balance of $ 36 00%cout.setf (ios:showpoint); cout.precision(2): cout <<When your CD matures in << account.term<< months, \n <<it will have a balance of $ << account.balance << endl; return 0; //Uses iostream: void getData (CDAccount& theAccount) cout << Enter account balance: $; cin >theAccount.balance; cout << Enter account interest rate: ; cin >theAccount.interestRate; cout < Enter the number of months until maturity\n <<(must be 12 or fewer months): ; cintheAccount.term;

Lab One includes three parts. Go over the lab instructions and complete the first part (Pre-Lab Redefine CDAccount) and the second part (SavingsAccount).

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution