Write a programme for displaying a school with different labs and their equipment’s and their prices
#include <iostream>
using namespace std;
int main()
{
string school_name;
cout<<"Enter the name of the school: ";
cin>>school_name;
int no_labs;
cout<<"\nEnter number of labs in the school: ";
cin>>no_labs;
string equipment[100];
int prices[100];
int n[100];
for(int i=0;i<no_labs;i++){
cout<<"\nEnter number of equipment in the lab "<<i+1<<":";
cin>>n[i];
for(int j=0;j<n[i];j++){
cout<<"\nEnter the name of equipment "<<j+1<<": ";
cin>>equipment[j];
cout<<"\nEnter the price of equipment "<<j+1<<": ";
cin>>prices[j];
}
}
cout<<"\nName of School: "<<school_name;
cout<<"\nNumber of labs in the School: "<<no_labs;
for(int i=0;i<no_labs;i++){
cout<<"\nDetails for lab "<<i+1<<":\n";
for(int j=0;j<n[i];j++){
cout<<"\nEquipment name: "<<equipment[j];
cout<<"\nPrice: "<<prices[j];
}
}
return 0;
}
Comments
Leave a comment