Answer to Question #222890 in C++ for Vinaayak Sunder

Question #222890

Write a programme for displaying a school with different labs and their equipment’s and their prices


1
Expert's answer
2021-08-04T02:03:28-0400


#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS