A: Add one drone to end of the list. Prompt for user to enter the new drone info
ID: 3764393 • Letter: A
Question
A: Add one drone to end of the list. Prompt for user to enter the new drone info. I have this so far
droneType addOne () {
droneType one;
cout << " Enter ID: ";
cin >> one.id;
cout << " Enter name: ";
cin >> one.name;
cout << " Enter flight status: ";
cin >> one.flightStatus;
cout << " Enter mission: ";
cin >> one.missionRole;
cout << " Is it armed or unarmed: ";
cin >> one.armed;
cout << " Enter the distance : ";
cin >> one.distance;
return one; }
Explanation / Answer
// Please give more details about the program! What list? and please give existing code if we have to complete some program. I made the drone structure!
struct droneType{
int id;
string name;
string flightStatus;
string missionRole;
string armed;
double distance;
};
droneType addOne () {
droneType one;
cout << " Enter ID: ";
cin >> one.id;
cout << " Enter name: ";
cin >> one.name;
cout << " Enter flight status: ";
cin >> one.flightStatus;
cout << " Enter mission: ";
cin >> one.missionRole;
cout << " Is it armed or unarmed: ";
cin >> one.armed;
cout << " Enter the distance : ";
cin >> one.distance;
return one;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.