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 program to calculate net pay for factory worker

Write and run a program in C++ that calculates the net pay for a factory worker. The program prompts the user for skill level and hours worked, as well as appropriate insurance and retirement options for the employee's skill.

  Program to check compatibity for matrix multiplication

Write down program in C++ for matrix multiplication. Program must accept dimension of both matrices to be multiplied and check for compatibity.

  A robot can take steps of 1 meter

A robot can take steps of 1 meter, 2 meters, or 3 meters. Write a recursive function to calculate the number of ways the robot can walk n meters. (n is an integer obtained from user.) As example:

  Write a full program that implements the aggregation concept

Write a full program that implements the aggregation concept for the Mail Message, Header , Body and Attachment classes.

  Design and write a c++11/fltk game program

The project is to design and write a C++11/FLTK game program with a graphical user interface. The game is based on "pancake sorting," which actually has some mathematical significance.

  Write a program in which the user is prompted

Write a program in which the user is prompted for the number of values that they will be entering. The user then enters that number of integers into an array

  Use c-strings without using the c-string library

write a program that implementd and test the following functions for use C-strings without using the c-string libaray  ( that is, you re NOT ALLOWED to use #include in this   program):

  Write function to accept character array

Write down the C++ function which will accept the character array of at most 30 cells. Your function must return true if string and its reverse are identical;

  Returns a count of the steps through the sort

Please write a c++ implimentation that returns a count of the steps through the sort. (do not worry about updating count, I will rewrite that segemnt. I need help with writing the shell sort.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Write the output of the program

Design a C++ program that will interactively prompt for and read the name of the input file interactively prompt for and read the name of a file to write the output of the program to write the following to the specified output file your name, sect..

  In psuedocode, design an application

In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values

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