c++ problem please elaborate with tables.. thanx in advance. A company wants to
ID: 3679280 • Letter: C
Question
c++ problem please elaborate with tables.. thanx in advance.A company wants to decorate its display room with tables and chairs. Create a program that identify how many tables and chairs can be occupied in the conference room according to the following requirements. The space around each table is 2 meters from all sides. The tables of different shapes like circle, square and rectangle Chairs are separated from tables. Each chair occupy area of 1.5 square meter INPUTS Ask the user to input the area of the display room the shape of the table and the dimensions to find the area of the table o o . Find the number of tables that can occupy half of the conference room. And the number of chairs that can reside in the other half Use "const, if-else, switch, setw(), cmath" among other instructions to solve the problem. celect shape of the table input C OR c for circle input S OR s for square input R OR r for recttangle input your choice input area of the conference room 288 input aide length in eters 3 naheP f table that can fit in the enfernnee Poon . 4 naber of chairs that can Fit in the conFerence FOOn 66 any key to continue- select shape of the table input C OR c for circle input S OR s for square input R OR r for recttangle choice x ress any key to continue . "
Explanation / Answer
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr(); //to clear the screen
float a,b,c,s,r,area;
int ch;
int freespace = 2;
int totarea;
cout << " the total Area of the room";
cin >> totarea;
cout<<“***Menu***1.Circle table 2.Square table”;
cout<<“3.Rectangle table”;
cin>>ch;
switch(ch)
{
case 1:
{
cout<<“nEnter radius of the circle:”;
cin>>r;
area=3.14*r*r;
int n;
int numer;
numer = totarea - freespace;
n = numer / area
cout <<" number of circle tables can be occupied after calculating freespace is"; //freespace + n* area = Total area
cout << n; // n = (total area - freespace) /area
break;
}
case 2:
{
cout<<“nEnter length and breadth:”;
cin>>a>>b;
area=a*b;
int n;
int numer;
numer = totarea - freespace;
n = numer / area
cout <<" number of circle tables can be occupied after calculating freespace is"; //freespace + n* area = Total area
cout << n; // n = (total area - freespace) /area
break;
}
case 3:
{
cout<<“nEnter three sides of the rectangle:”;
cin>>a>>b;
area=(2*a) + (2*b);
int n;
int numer;
numer = totarea - freespace;
n = numer / area
cout <<" number of circle tables can be occupied after calculating freespace is"; //freespace + n* area = Total area
cout << n; // n = (total area - freespace) /area
break;
}
default: cout<<“nWrong choice…!!!”;
break;
}
cout<<“Area=”<<area;
getch(); //to stop the screen
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.