CODE USING C++ 1. First Person In The World by CodeChum Admin Dear Master Programmer,   You have created everything that this tech universe needs. The next thing you need to do, is to create the very first Person.   I have in here a guide which you can use to create a Person. Feel free to use it.   Sincerely, Your Devoted Assistant     Instructions: In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter. Your task is to create a Person, take in an integer user input, and then set it as the Person's age. Finally, call the displayPerson() function and pass that Person you created. Input 1. The age of the Person Output Enter·Person's·age:·24 PERSON·DETAILS: Age:·24

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 1CP: In previous chapters, you have created programs for the Greenville Idol competition. Now create a...
icon
Related questions
Question

CODE USING C++

1. First Person In The World

by CodeChum Admin

Dear Master Programmer,

 

You have created everything that this tech universe needs. The next thing you need to do, is to create the very first Person.

 

I have in here a guide which you can use to create a Person. Feel free to use it.

 

Sincerely,

Your Devoted Assistant

 

 

Instructions:

  1. In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter.
  2. Your task is to create a Person, take in an integer user input, and then set it as the Person's age.
  3. Finally, call the displayPerson() function and pass that Person you created.

Input

1. The age of the Person

Output

Enter·Person's·age:·24
PERSON·DETAILS:
Age:·24
main.cpp
next thing you need to do, is to create the very first Person.
1 #include <iostream>
I have in here a guide which you can use to create a Person.
2 using namespace std;
Feel free to use it.
4 typedef struct {
int age;
6 } Person;
Sincerely,
Your Devoted Assistant
8 void displayPerson (Person);
9
Instructions:
10 int main(void) {
11
// TODO: Create a Person here and ask the user for its age
1. In the code editor, you are provided with the definition of
12
a struct Person. This struct needs an integer value for its
13
return 0;
age. Furthermore, you are provided with a
14 }
displayPerson () function which accepts a struct Person
15
16 void displayPerson (Person p) {
as its parameter.
cout <« "PERSON DETAILS:"« endl;
cout <« "Age: " <« p.age;
17
2. Your task is to create a Person, take in an integer user
18
input, and then set it as the Person's age.
19 }
3. Finally, call the displayPerson () function and pass that
Person you created.
Input
1. The age of the Person
Output
Enter Person's age: 24
PERSON DETAILS:
Age: 24
Transcribed Image Text:main.cpp next thing you need to do, is to create the very first Person. 1 #include <iostream> I have in here a guide which you can use to create a Person. 2 using namespace std; Feel free to use it. 4 typedef struct { int age; 6 } Person; Sincerely, Your Devoted Assistant 8 void displayPerson (Person); 9 Instructions: 10 int main(void) { 11 // TODO: Create a Person here and ask the user for its age 1. In the code editor, you are provided with the definition of 12 a struct Person. This struct needs an integer value for its 13 return 0; age. Furthermore, you are provided with a 14 } displayPerson () function which accepts a struct Person 15 16 void displayPerson (Person p) { as its parameter. cout <« "PERSON DETAILS:"« endl; cout <« "Age: " <« p.age; 17 2. Your task is to create a Person, take in an integer user 18 input, and then set it as the Person's age. 19 } 3. Finally, call the displayPerson () function and pass that Person you created. Input 1. The age of the Person Output Enter Person's age: 24 PERSON DETAILS: Age: 24
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT