need help with using rng and returning strings from functions

every time i run this code it skips to the part where it prompts the user if they would like to go again i don't know why it skips the function call and it doesn't give any errors when compiling greatly appreciate any help given

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
int main (){
srand(time(NULL));
string PLAY_AGAIN = "yes";
string RNG_GUESS();
do{
string USER_VS_COMPUTER (string RNG_GUESS()); // the problem appears to be here 
cout << "you would like to play ultimate coin toss simulator.(again?)"; // this prompt and the next cin are looped without running the two functions

cin >> PLAY_AGAIN;
    }
while (PLAY_AGAIN == "yes");
}

string RNG_GUESS (){
int RNG_NUMBER = (rand() % 100) * 100;
if (RNG_NUMBER < 50){
    return "heads";
    }
else if (RNG_NUMBER > 50){
    return "tails";
    }
    else {
        return "your rng number is too high or too low fix it"; // error to test if my rng gave the correct range of outputs
    };
}
string USER_VS_COMPUTER (string RNG_GUESS()){
string USER_INPUT = "q";
cout << "please guess either t (tails) or h (heads).";
cin >> USER_INPUT;
if (USER_INPUT == "h" &&  RNG_GUESS() == "heads"){
cout << "you win";
    }
else if(USER_INPUT == "t" && RNG_GUESS() == "tails"){
    cout << "you win";
    }
else {
    cout << "you lose sorry";
    }
};
string USER_VS_COMPUTER (string RNG_GUESS());
Declare USER_VS_COMPUTER as function
Taking a single parameter named RNG_GUESS
    which is a function
    witout parameters
    returning string
Returng string

This is no a function call, but function declaration.
Registered users can post here. Sign in or register to post.