-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem6.c++
More file actions
37 lines (33 loc) · 717 Bytes
/
Problem6.c++
File metadata and controls
37 lines (33 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
using namespace std;
struct stInfo
{
string FirstName;
string LastName;
};
stInfo ReadInfo()
{
stInfo Info;
cout << "Pleas enter Your First Name ?" << endl;
cin >> Info.FirstName;
cout << "Pleas enter Your Last Name ?" << endl;
cin >> Info.LastName;
return Info;
}
string GetFullName(stInfo Info , bool Reversed = false)
{
string FullName = "";
if(Reversed)
FullName = Info.LastName + " " + Info.FirstName;
else
FullName = Info.FirstName + " " + Info.LastName;
return FullName;
}
void PrintFullName(string FullName)
{
cout << "\n Your full name is : " << FullName << endl;
}
int main()
{
PrintFullName(GetFullName(ReadInfo()));
}