Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could someone please help me? I only have one error that is preventing me from r

ID: 3655051 • Letter: C

Question


Could someone please help me? I only have one error that is preventing me from running the program.

Error C2678: binary '>>' : no operator found which takes a left-hand operand of type 'std::istream' (or there is no acceptable conversion)

/* This program will let the user input the

number of wins and losses that a baseball

team acquired during a complete season.*/

#include <iostream>

#include <string>

using namespace std;

/* Wins should be input in a parameter-less

value returning function that returns the

wins to the main function.*/

void displayWins();

/* Losses should be input in a parameter-less

value returning function that returns the

wins to the main function.*/

void displayLosses();

/* Calculate the percentage of wins. Should be

input in a parameter-less value. It recieves

the wins and losses as parameters and returns

the percentage (float) to the main program,

which then prints the result.*/

void displayPercentage();

int main()

{

cout << "Please input the number of wins." << endl;

cin >> displayWins();

return 0;

}

/* Wins should be input in a parameter-less

value returning function that returns the

wins to the main function.*/

void displayWins();

/* Losses should be input in a parameter-less

value returning function that returns the

wins to the main function.*/

void displayLosses();

/* Calculate the percentage of wins. Should be

input in a parameter-less value. It recieves

the wins and losses as parameters and returns

the percentage (float) to the main program,

which then prints the result.*/

// Percent printed to two decimal places.

void displayPercentage();


Explanation / Answer

you can not input directly to a function like that. You need to make a variable that will store the input and then pass it to the function.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote