11th Week Fourth project--Teacher cadre category

Source: Internet
Author: User

/*copyright (c) 2016, Yantai University School of computer *all rights reserved. * File Name: * Author: Tian Zhiwei * Completion date: May 10, 2016 * Version number: v1.0 * * Problem Description: Teacher and Cadre class * Input Description: * Program output: Teacher information */#include <iostream>u    Sing namespace Std;class teacher{protected:int age;    String name;    String addr;    string title;    string sex;    int tel;public:teacher (int a,string n,string ad,string t,string s,int te); void display ();};    Teacher::teacher (int a,string n,string ad,string t,string s,int te) {age=a;    Name=n;    Addr=ad;    title=t;    Sex=s; Tel=te;}    void Teacher::d isplay () {cout<< "Age:" <<age<<endl;    cout<< "Name:" <<name<<endl;    cout<< "Address:" <<addr<<endl;    cout<< "Account:" <<title<<endl;    cout<< "Sex for:" <<sex<<endl; cout<< "Phone:" &LT;&LT;TEL&LT;&LT;ENDL;}    Class Cadre{protected:int age;    String name;    String addr;    String post;    string sex; int tel;public:cadre (int a,string n,string ad,string p,string s,int te);};    Cadre::cadre (int a,string n,string ad,string p,string s,int te) {age=a;    Name=n;    Addr=ad;    post=p;    Sex=s; Tel=te;} Class Teacher_cadre:public teacher,public cadre{private:double wages;public:teacher_cadre (int a,string n,string AD    , String p,string t,string s,int te,double wa); void display ();}; Teacher_cadre::teacher_cadre (int a,string n,string ad,string p,string t,string s,int te,double wa): Teacher (A,n,ad,t,s,    TE), cadre (a,n,ad,p,s,te), Wages (WA) {}void teacher_cadre::d isplay () {Teacher::d isplay ();    cout<< "Position:" <<post<<endl; cout<< "Commission for:" &LT;&LT;WAGES&LT;&LT;ENDL;}    int main () {Teacher_cadre F1 (+, "Laowang", "Shandongsheng Zhaoyuanshi", "Qingjiegong", "Tiyu", "Woman", 10086,250); F1.display ();}

Program run:



11th Week Fourth project--Teacher cadre category

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.