63 808
Assignments Done
99,5%
Successfully Done
In August 2018

Answer to Question #24383 in C++ for Nour

Question #24383
Suppose I have a struct called Player that has fields called points, assists, and rebounds. Write a function called All Star if points exceeds 20, assists exceeds 8, and rebounds exceeds 5.
Expert's answer
#include <cmath>
#include <conio.h>
#include <iostream>

using namespace std;

struct Player
{
int points;
int assists;
int rebounds;
};

bool AllStar(Player& player)
{
if (player.points > 20 && player.assists > 8 && player.rebounds > 5)
return true;
return false;
}

int main()
{
Player player = {19, 13, 6};
cout << AllStar(player) << endl;
player = Player {55, 9, 12};
cout << AllStar(player) << endl;

_getch();
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