Computer Science, asked by JAYESHPATEL91, 6 months ago

Boating
You went on a tour to Ooty with your friends. As a part of the tour, you went boating with them. For the boat to remain stable, the number of people on one boat is restricted based on the weight of the people. You find that the boatman who is sailing your boat is so much greedy of money. For earning more, he takes too many people to travel in the boat at a time. So you want to check how many people can travel in the boat at a time so that the boat will not drown. Calculate the weight by considering the number of adults and number of children. Assume that an adult weighs 75 kg and children weigh 30 kg each. If the weight is normal, display Boat is stable, else display Boat will drown. INPUT & OUTPUT FORMAT: Input consists of 3 integers. First input corresponds to the weight that the boat can handle. Second input corresponds to the number of adults. Third input corresponds to the number of children.
SAMPLE INPUT:



340

2

3



SAMPLE OUTPUT:



Boat is stable
write c program

Answers

Answered by BlackWizard
1

Answer:

#include<iostream>

using namespace std;

int main()

{

 

 int a,b,c,g,f,h;

 cin>>a>>b>>c;

 //out<<a<<"\n"<<b<<c;

 g=b*75;

 f=c*30;

 h=g+f;

 if(h<=a){cout<<"Boat is stable";}

 else{cout<<"Boat will drow";}

 //cout<<h;}

Answered by Anonymous
0

Answer:

#include<iostream>

using namespace std;

int main()

{

int a,b,c,adult,children,h;

cin>>a>>b>>c;

adult=b*75;

children=c*30;

h=adult+children;

if(h<=a){cout<<"Boat is stable";}

else{cout<<"Boat will drow";}

explanation:

Code written in C language

#include<stdio.h>

int main void

{

Int adult

int children

Int weight_adult

Int weight_child

Int weight_limit

printf("Enter the number of adults in boat");

         scanf("%d", &adult);

printf("Enter the number of children in boat");

         scanf("%d", &children);

weight_adult = adult *75;

weight_child = children *30;

if (weight_limit > (weight_adult + weight_child))

printf (“The boat is stable”)

else

printf (“The boat is not stable”)

return

#include<iostream>

using namespace std;

int main()

{

int a,b,c,adult,children,h;

cin>>a>>b>>c;

adult=b*75;

children=c*30;

h=adult+children;

if(h<=a){cout<<"Boat is stable";}

else{cout<<"Boat will drow";}

Explanation:

Code written in C language

#include<stdio.h>

int main void

{

Int adult

int children

Int weight_adult

Int weight_child

Int weight_limit

printf("Enter the number of adults in boat");

         scanf("%d", &adult);

printf("Enter the number of children in boat");

         scanf("%d", &children);

weight_adult = adult *75;

weight_child = children *30;

if (weight_limit > (weight_adult + weight_child))

printf (“The boat is stable”)

else

printf (“The boat is not stable”)

return

Similar questions