Answer to Question #24383 in C++ for Nour
2013-02-14T05:26:34-05:00
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.
1
2013-02-18T12:13:32-0500
#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 !
Learn more about our help with Assignments:
C++
Comments
Leave a comment