(C PROGRAMMING ONLY) 4. Bored Person by CodeChum Admin Help! Our people in this tech universe we created are starting to get really, really boreed! They're complaining because there's internet connection but they don't have mobile phones. We need to create one for them ASAP or else they will go crazy!! Instructions: In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age, character value for its gender, and a struct Phone for its phone. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter. Your task is to define a new struct called Phone. This Phone would need 3 properties: char type - which can either be 'I' for iPhone or 'A' for Android int ram - the number of RAM this phone has int storage - the number of storage this phone has Then, using this struct Phone you defined, create a Phone in the main() and ask the user for its type, ram, and storage. Next, create a struct Person and ask the user for its age and gender and then set its phone to the Phone you just created earlier. Finally, call the displayPerson() function and pass the Person. Input 1. The type of the Phone 2. The RAM of the Phone 3. The storage of the Phone 4. The age of the Person 5. The gender of the Person Output Enter Phone's type: I Enter Phone's RAM: 2 Enter Phone's storage: 124 Enter Person's age: 24 Enter Person's gender: M PERSON DETAILS: Age: 24 Gender: Male Phone: iPhone (2GB, 124GB)
(C
4. Bored Person
by CodeChum Admin
Help! Our people in this tech universe we created are starting to get really, really boreed!
They're complaining because there's internet connection but they don't have mobile phones. We need to create one for them ASAP or else they will go crazy!!
Instructions:
In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age, character value for its gender, and a struct Phone for its phone. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter.
Your task is to define a new struct called Phone. This Phone would need 3 properties:
char type - which can either be 'I' for iPhone or 'A' for Android
int ram - the number of RAM this phone has
int storage - the number of storage this phone has
Then, using this struct Phone you defined, create a Phone in the main() and ask the user for its type, ram, and storage.
Next, create a struct Person and ask the user for its age and gender and then set its phone to the Phone you just created earlier.
Finally, call the displayPerson() function and pass the Person.
Input
1. The type of the Phone
2. The RAM of the Phone
3. The storage of the Phone
4. The age of the Person
5. The gender of the Person
Output
Enter Phone's type: I
Enter Phone's RAM: 2
Enter Phone's storage: 124
Enter Person's age: 24
Enter Person's gender: M
PERSON DETAILS:
Age: 24
Gender: Male
Phone: iPhone (2GB, 124GB)
Step by step
Solved in 3 steps with 5 images