Computer Science, asked by swethachowdary845, 10 months ago

The catering staff in the SECE mess are known for their good cooking skills as well as hospitality. We all know that the dining table arrangement needs to be different for left handed and right handed persons. So whenever any VIP guest visits SECE, they would make the table arrangements based on whether he/she is left handed or right handed. The mess is situated on the 15th floor of the hostel building. SECE hostel building has superfast elevators to help travel from one floor to another. Each elevator has 2 doors, the front one and the rear one. If a person enters the elevator through the front door, he goes out through the rear door and vice-versa. The elevator has 2 rails numbered as 1 and 2. Rail 1 is located to the left of the entrance of the front door (or correspondingly, to the right of the entrance of the rear door). Rail 2 is located opposite it, to the right of the entrance of the front door and to the left of the entrance of the rear door. We know that each person holds on the rail with his/her strongest hand. There is an IP camera in the elevator and based on the camera output, the catering staff will be easily able to identify whether a guest is left handed or right handed. They have decided to automate this task and they asked the help of Image Processing Group. The Image Processing Group has written a program to perform this task and the program will output the door through which the person entered and the rail number which the person held. Based on this input, write a program to determine whether a person is left handed or right handed.

Answers

Answered by mihaadkhan242
15

sorry I can't answer this

Answered by mayankpathak4513
63

Answer:May be this can help you little bit.

#include<iostream>

#include<string.h>

using namespace std;

int main()

{

char a[10];

 int b;

 std::cin>>a;

 std::cin>>b;

if((strcmp(a,"front")==0) && b==1)

  std::cout<<"Left Handed";

  else if((strcmp(a,"rear")==0) && b==1)

  std::cout<<"Right Handed";

   else if((strcmp(a,"front")==0) && b==2)

     std::cout<<"Right Handed";

 else if((strcmp(a,"rear")==0) && b==2)

   std::cout<<"Left Handed";

 else

   std::cout<<"Left Handed";

 

}

Explanation:

Similar questions