Giter Club home page Giter Club logo

microsoft_dev210_2x's Introduction

Lab Instructions

For this assignment:

  • Create a Person base class with common attributes for a person (first_name, last_name, age, race, phone, as examples)
  • Make the age variable private
  • Make the phone variable protected
  • In the Person class, create a pure virtual function called OutputIdentity() that accepts no parameters and returns void
  • Also in the Person class, implement a virtual function called OutputAge() that displays "I am X years old", where X is the value of the Person's age attribute
  • Create a Student and a Teacher class that each inherit from the Person base class using public inheritance
  • In your main.cpp file, instantiate an Student object and initialize the member variables with valid data
  • Override the Student's OutputIdentity() pure virtual method to display the text "I am a student" to the console
  • Override the Student's OutputAge() virtual method to display the text "I am a student" and then calls the Person class's OutputAge() method
  • Instantiate a Teacher object in main.cpp and assign valid data to the member variables
  • Override the Teacher's OutputIdentity pure virtual method to display the text "I am a teacher" to the console
  • Override the Teacher's OutputAge() virtual method to display the text "I am a teacher" and then calls the Person class's OutputAge() method

microsoft_dev210_2x's People

Contributors

maxkhrichtchatyi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.