Lost with function stubs

Can someone give me some guidance

Define stubs for the functions called by the below main(). Each stub should print "FIXME: Finish FunctionName()" followed by a newline, and should return -1. Example output:
FIXME: Finish GetUserNum()
FIXME: Finish GetUserNum()
FIXME: Finish ComputeAvg()
Avg: -1

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#include <iostream>
using namespace std;

/* Your solution goes here */

int main() {
int userNum1 = 0;
int userNum2 = 0;
int avgResult = 0;

userNum1 = GetUserNum();
userNum2 = GetUserNum();

avgResult = ComputeAvg(userNum1, userNum2);

cout << "Avg: " << avgResult << endl;

return 0;
}
What is it that you have trouble with? When they say stub I think they just mean incomplete function. After you have implemented the functions as described you should be able to compile the program but it will not make a useful program to run, but as an exercise it's probably okay.
Last edited on
@Peter87
I just need some kind of example that would help me start this. It's just for exercise
You could start by defining the functions.
that would be the GetUserNum & ComputeAvg, right?

Sorry I'm just starting my CS course and takes me a while to get things
Monstrosity1219 wrote:
that would be the GetUserNum & ComputeAvg, right?

Yes, those are the functions that you need to define.
Each stub would have to output the example given above?
Yes, what it says in the description.
Thank you I got it down!
Topic archived. No new replies allowed.