2532: Cast ResumeTime limit:1 Sec Memory limit:128 MB
submit:1126 solved:802
[Submit] [Status] [Web Board]
Description
Xiaohua after 12 bided, and experienced 4 years of university honed, finally graduated, with the arrival of the graduation season, looking for work is increasingly tense up. Because of interviewing different companies, Xiao Hua needs to prepare a different resume. Of course, the most basic information is essential, basic information: name, age, gender, professional. Existing two companies, Xiao Hua want to cast a resume to try. The first Langchao company needs to know about Xiaohua Graduate school, and the second Lenovo company needs to know about its salary target (pay).
Please use the method inherited in the class to help him complete his resume. *-* *-* *-* Input
Enter two lines, the first line: The information of Xiao Hua. Second line: Xiaohua the name of the company you want to enter. Output
The CV to be submitted by Xiao Hua, Sample Input
Xiaohua F IT YT 8000
Langchao
Sample Output
Name:xiaohua
age:25
sex:f
major:it
school:yt
HINT
The pre-code and type definitions are given below, which are not required to be included in the submission and are automatically added to the front of the program
#include <iostream>
#include <string>
using namespace Std;
Class Jianli
{
Public
void GetValue () {
cin>>name>>age>>sex>>major;
}
void display ();
Private
String name;
int age;
char sex;
String Major;
};
The main function is given below and is not required to be included in the submission and is automatically added to the end of the program
/* C + + code */
int main ()
{
Jianli1 Xiaohua;
Jianli2 XIAOHUA2;
String A= "Langchao", b= "Lenovo";
string C;
Xiaohua.getvalue ();
Xiaohua.getvalue1 ();
Xiaohua2.getvalue2 ();
cin>>c;
if (c==a) {
Xiaohua.display ();
Xiaohua.display1 ();
}
if (c==b) {
Xiaohua.display ();
Xiaohua2.display2 ();
}
return 0;
}
Analysis:
The Jianli1 class inherits the Jinali class and adds a new member school;
The Jianli2 class inherits the Jinali class and adds a new member pay;
AC Code:
Class Jianli1:public Jianli
{public
:
void getvalue1 ()
{
cin>>school;
}
void Display1 ();
Private:
string School;
};
Class Jianli2:public Jianli
{public
:
void Getvalue2 ()
{
cin>>pay;
}
void Display2 ();
Private:
double pay;
};
void Jianli::d isplay ()
{
cout<< "name:" <<name<<endl;
cout<< "Age:" <<age<<endl;
cout<< "Sex:" <<sex<<endl;
cout<< "Major:" <<major<<endl;
}
void Jianli2::d isplay2 ()
{
cout<< "pay:" <<pay<<endl;
}
void Jianli1::d isplay1 ()
{
cout<< "school:" <<school<<endl;
}