-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolution-01.cpp
More file actions
39 lines (37 loc) · 823 Bytes
/
Copy pathSolution-01.cpp
File metadata and controls
39 lines (37 loc) · 823 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
38
39
#include <iostream>
using namespace std;
struct StInfo
{
string FirstName;
string LastName;
};
StInfo ReadInfo()
{
StInfo Info;
cout<<"Enter the First Name \n";
cin>>Info.FirstName;
cout<<"Enter the Last Name \n";
cin>>Info.LastName;
return Info;
}
string GetFullName(StInfo Info, bool Reversed)
{
string FullName="";
if(Reversed)
FullName = Info.LastName + " " + Info.FirstName;
else
FullName = Info.FirstName + " " + Info.LastName;
return FullName;
}
void PrintFullName(string FullName)
{
cout<<"Your Full name is: "<<FullName<<endl;
}
int main()
{
//كدا هيطبع الاسم معكوس
PrintFullName(GetFullName(ReadInfo(),true));
//كدا هيطبع الاسم عادي
// PrintFullName(GetFullName(ReadInfo(),false));
return 0;
}