Question: #include #include #include using namespace std; // structure struct Hat { string size; string color; float price; };// declare the structure variable int main() {

#include #include #include using namespace std; // structure struct Hat { string size; string color; float price; };// declare the structure variable

int main() { Hat hat_1,hat_2,hat_3,hat_4,hat_5; cout<<"Welcome to Hats For U! "; cout<<"Hat 1 "; cout<<"Enter the hat size: "; cin>>hat_1.size; cout<<"Enter the hat color: "; cin>>hat_1.color; cout<<"Enter hat price: "; cin>>hat_1.price;

cout<<"Hat 2 "; cout<<"Enter the hat size: "; cin>>hat_2.size; cout<<"Enter the hat color: "; cin>>hat_2.color; cout<<"Enter hat price: "; cin>>hat_2.price;

cout<<"Hat 3 "; cout<<"Enter the hat size: "; cin>>hat_3.size; cout<<"Enter the hat color: "; cin>>hat_3.color; cout<<"Enter hat price: "; cin>>hat_3.price; cout<<"Hat 4 "; cout<<"Enter the hat size: "; cin>>hat_4.size; cout<<"Enter the hat color: "; cin>>hat_4.color; cout<<"Enter hat price: "; cin>>hat_4.price; cout<<"Hat 5 "; cout<<"Enter the hat size: "; cin>>hat_5.size; cout<<"Enter the hat color: "; cin>>hat_5.color; cout<<"Enter hat price: "; cin>>hat_5.price; cout<<" RECORD OF HATS "; cout<<"---------------------------------------------------------- "; cout<

return 0; }

Create a program which involve nested structure. What u need to do is to create another structure that related to the structure definition in the program above. For example you may have structure such as BookInfor and AuthorInfor. Therefore you can produce information like the book A is written by the this author B. The program should store five records accordingly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!