#include #include #include using namespace std; // structure struct Hat { string size; string color; float price; };// declare the structure variable int main() {
#include
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
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started