60 537
Assignments Done
97,9%
Successfully Done
In April 2018

Answer to Question #47564 in C++ for krad

Question #47564
4. Write a program for the Air Force to label an aircraft as military or civilian. The program is to be given the plane’s observed speed in km/h and its estimated length in meters. For planes traveling in excess of 1100 km/h, and longer than 52 meters, you should label tem as “civilian” aircraft, and shorter such as 500 km/h and 20 meters as “military” aircraft. For planes traveling at slower speeds, you will issue an “It’s a bird” message
Expert's answer
#include <stdlib.h>
#include <iostream>  // for cout and cin
#include <stdio.h>
#include <cstdlib>   // for system
using namespace std;
int main()
{
int speed;
int length;
cout<<"enter the aircraft's speed and length"<<endl;
cin>>speed>>length;
if (speed > 1100 && length > 52) cout<<"civilian aircraft"<<endl;
else
{
if(speed < 500 ) cout<<"It is a bird"<<endl;
else
cout<<"military aircraft"<<endl;
}
system("pause");
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions