Person class that includes fields for last name

Assignment Help C/C++ Programming
Reference no: EM13165472

Create a Person class that includes fields for last name, first name, and zip code. Include a default constructor that initializes last name, first name, and zip code to "X" if no arguments are supplied. Also include a display function. Write a main() function that instantiates and displays two Person objects: one that uses the default values, and one for which you supply your own values. Save the file as Person.cpp.

Create a class named SavingsAccount . Provide fields for the customer use the Person class, account number, balance, and interest rate. Provide two constructors. One requires a customer and sets each numeric field to 0; the other requires a customer and an account number and sets the account's opening balance to $100 at 3% interest. Include a function that displays an account's data fields. Write a main() function that instantiates one SavingsAccount object of each type and displays their values. Save the file as SavingsAccount.cpp

So far I have this for Person.cpp

#include
#include
using namespace std;

class Person {
private:
   string firstName;
   string lastName;
   string zipCode;
  
public:
   Person();
   void setValues();
   void displayValues();
};

Person::Person()
{
   firstName = "X";
   lastName = "X";
   zip = "X";
}

void Person::setValues()
{
   cout << "Please enter your first name" << endl;
   cin >> firstName;
   cout << "Please enter your last name" << endl;
   cin >> lastName;
   cout << "Please enter your Zip code" << endl;
   cin >> zipCode;
}

void Person::displayValues()
{
   cout << "Your first name is: " << firstName << endl;
   cout << "Your last name is: " << lastName << endl;
   cout << "Your Zip code is: " << zipCode << endl;
}

Reference no: EM13165472

Questions Cloud

Prepare a statement of cash flows for 2012 : Prepare a statement of cash flows for 2012 using the indirect method in the Operating Activities section and problem Statement of Cash Flows Indirect Method
Identify five different it systems : Identify five different IT systems that have affected business in the past few years. For each system, briefly note the following: · A name for the system
Create a global array of structures : Create a global array of structures with the following data. Each structure should store the data (Employee Table - Name, age, salary information) . Array size must be at least 10
The techniques in discovering the requirements : What are some of the techniques in discovering the requirements (fact finding) for a system?
Person class that includes fields for last name : Create a Person class that includes fields for last name, first name, and zip code. Include a default constructor that initializes last name, first name, and zip code to "X" if no arguments are supplied. Also include a display function. Write a ma..
Find a regular expression and an finite automata : For the following pair of regular languages, find a regular expression and an Finite Automata that each define L1 ? L2
Discuss how your organization might use the findings : The purpose of the study defines what the researcher wants to find out and is found in the introductory section of the research article. Sometimes the purpose contains a research questions.
What output would be produced by the program segment : What output would be produced by the following program segment?
How much limestone in kg is need to completely : How much limestone in kg is need to completely neutralize a lake containing -- of H2 per liter? 5.0 * 10-3g SO4 5.2 * 10^9-L.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program in c that will find smallest value

Write a programe c that will find the smallest, largest and average values in a collection of N numbers.Get the value of N before scanning each value in the collection of N numbers.

  Create a text file named grades.txt

Write a program to calculate students' average test scores and their grades. Creat a text file named  grades.txt

  Calculate the net pay as the gross less the taxes

Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference.

  Displays columns titled "name", "quantity", "price", value

Write a program that displays columns titled "Name", "Quantity", "Price", and "Value". The fourth column contains the result of multiplying each item's quantity by its price. In addition, the program should calculate and display the total value of th..

  Write a program that inputs a dollar amount to be printed

Write a program that inputs a dollar amount to be printed on a check and then prints the amount in check-protected format with leading asterisks if necessary

  The knight''s tour problem

The knight's tour problem is as follows: given an initial position for a single knight on an otherwise empty chessboard, find a sequence of 64 moves that will make the knight visit every square on the board exactly once

  Write a recursive and iterative versions of binary search

in C++ write a recursive and iterative versions of binary search and compare their run times using the array a[i]=i, i=0,..., n-1

  Demonstrate the construction and output of an array

In fluid mechanics, the Reynolds number (Re) is a dimensionless quantity that is used to help predict similar flow patterns in different fluid flow situations. For example, Reynolds numbers can be computed for different velocities of fluid flow over ..

  Submap that accepts two maps from strings

Write a method called subMap that accepts two maps from strings to strings as its parameters and returns true if every key in the first map is also contained in the second map and maps to the same

  Time conversion

Write a C++ program that takes an Eastern standard time in hours, minutes, and seconds,and prints it out in Central time, Mountain time, or Pacific time.

  Program that will ask for a month

Write a program that will ask for a month (1-12) and a year (yyyy). the program should then produce a calendar showing the month name and year and have all of the days displayed under it.

  Repeat these questions by writing functions

Repeat these questions by writing functions that receive the arrays as constant reference parameters and return the appropriate values through the function name (via return statement). The function header could look like:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd