#include <iostream>
using namespace std;
struct customer
{
int cstmrnmber;
char name[50];
int age;
char address[50];
double contactno;
double temp;
} c[10];
int main()
{
cout << "Enter information of Customer:\n " << endl;
for(int i = 0; i < 10; ++i)
{
c.cstmrnmber = i+1;
cout << "For Customer number" << c.cstmrnmber << ",\n" << endl;
cout << "Enter the name of Customer:\n ";
cin >> c.name;
cout << "Enter the age of customer: \n";
cin >> c.age;
cout << "Enter the Address of Customer:\n ";
cin >> c.address;
cout << "Enter Contact number: \n ";
cin >> c.contactno;
cout << "Enter the temperature: \n";
cin >> c.temp;
cout << endl;
}
cout << "Displaying Information: " << endl;
for(int i = 0; i < 10; ++i)
{
cout << "\nCustomer number: " << i+10 << endl;
cout << "Name: " << c.name << endl;
cout << "Age: " << c.age << endl;
cout << "Address: " << c.address << endl;
cout << "Contact number: " << c.contactno << endl;
cout << "Enter the temperature:" << c.temp << endl;
}
if (age > 21)
{
cout << "Eligible to Enter." << endl;
cout << "no longer a minor." << endl;
}
else if(age < 20)
{
cout << "Not eligible to enter."<< endl;
cout << "Still a minor." << endl;
}
return 0;
}
using namespace std;
struct customer
{
int cstmrnmber;
char name[50];
int age;
char address[50];
double contactno;
double temp;
} c[10];
int main()
{
cout << "Enter information of Customer:\n " << endl;
for(int i = 0; i < 10; ++i)
{
c.cstmrnmber = i+1;
cout << "For Customer number" << c.cstmrnmber << ",\n" << endl;
cout << "Enter the name of Customer:\n ";
cin >> c.name;
cout << "Enter the age of customer: \n";
cin >> c.age;
cout << "Enter the Address of Customer:\n ";
cin >> c.address;
cout << "Enter Contact number: \n ";
cin >> c.contactno;
cout << "Enter the temperature: \n";
cin >> c.temp;
cout << endl;
}
cout << "Displaying Information: " << endl;
for(int i = 0; i < 10; ++i)
{
cout << "\nCustomer number: " << i+10 << endl;
cout << "Name: " << c.name << endl;
cout << "Age: " << c.age << endl;
cout << "Address: " << c.address << endl;
cout << "Contact number: " << c.contactno << endl;
cout << "Enter the temperature:" << c.temp << endl;
}
if (age > 21)
{
cout << "Eligible to Enter." << endl;
cout << "no longer a minor." << endl;
}
else if(age < 20)
{
cout << "Not eligible to enter."<< endl;
cout << "Still a minor." << endl;
}
return 0;
}