Please help

I am just learning and hoping to get better and begin my career once I master this. I can not go to any of the functions?? It does nothing. Am I calling them right?
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#include "stdafx.h"
#include <iostream>
char cal();
char AI();

int main()          
{
	char exit;
	int user_choice;
	std:: cout << "Hello!\nPlease choose one of the following.\n\n";
	std:: cout << "Press the number 1 for \n";
	std:: cout << "The Calculator: solves mathematical problems inputing two numbers.\n\n";

	std:: cout << "Press the number 2 for \n";
	std:: cout << "Age identifier: Tells how old are you.\n\n";
	
	std:: cin >> user_choice;
	if (user_choice >= 3)
	{
		std:: cout << "Oops!\n Please pick one of the options above.\n";
	}
	switch (user_choice)
	{
		case 1: (user_choice==1);
				{
					char cal();
					break;
				}
		case 2: (user_choice==2);
				{
					char AI();
					break;
				}
	}
	return 0;
	}
char cal()
{
	char choice ='y';
	do{
	int user_problem;	
	std:: cout << "You have selected the calculator.\n";
	std:: cout << "Press 1 for addition.\n";
	std:: cout << "Press 2 for subtraction.\n";
	std:: cout << "Press 3 for multiplication.\n";
	std:: cout << "Press 4 for division.\n";
	if (user_problem >= 5)
	{
		std:: cout << "Whoops! Please pick the right problem.\n";
	}

	switch (user_problem)
	{
	case 1: (user_problem == 1);
			{
				int user_num1;
				int user_num2;
				std:: cout << "Choose the first number.\n";
				std:: cin >> user_num1;
				std:: cout << "Choose the second number,\n";
				std:: cin >> user_num2;
				std:: cout << user_num1 <<'+' << user_num2 << '=' << user_num1+user_num2 << std:: endl;
				break;
			}

	case 2: (user_problem == 2);
			{
				int user_num1;
				int user_num2;
				std:: cout << "Choose the first number.\n";
				std:: cin >> user_num1;
				std:: cout << "Choose the second number.\n";
				std:: cin >> user_num2;
				std:: cout << user_num1 << '-' << user_num2 << '=' << user_num1-user_num2 << std:: endl;
				break;
			}

	case 3: (user_problem == 3);
			{
				int user_num1;
				int user_num2;
				std:: cout << "Choose the first number. \n";
				std:: cin >> user_num1;
				std:: cout << "Choose the second. \n";
				std:: cin >> user_num2;
				std:: cout << user_num1 << '*' << user_num2 << '=' << user_num1*user_num2 << std:: endl;
				break;
			}

	case 4: (user_problem == 4);
			{
				float user_num1;
				float user_num2;
				std:: cout << "Choose the first number.\n";
				std:: cin >> user_num1;
				std:: cout << "Choose the second number.\n";
				std:: cin >> user_num2;
				std:: cout << user_num1 << '*' << user_num2 << '=' << user_num1*user_num2 << std:: endl;
				break;
			}
	}

	std:: cout << "Would you like to restart the calculator? Press y to restart.\n Otherwise press any other key to return to the main menu.";
	std:: cin >> choice;
	if (choice == 'y')
		system ("cls");
	}
	while (choice == 'y');
	system ("cls");
	std:: cout << "You have chose to exit. Press any key to exit.\n";
	char x;
	std:: cin >> x;
	return main();
}

char AI()
{
	char choice = 'y';
	do{
		int user_ybirth;
		std:: cout << "You have chosen Bithday Identifier.\n";
		std:: cout << "Enter the year you were born on.\n";
		std:: cout << user_ybirth << '-' << "2011" << '=' << user_ybirth-2011<< std::endl;
		
		std:: cout << "Press y to restart otherwise press any key to return to the main menu.\n";
		std:: cin >> choice;
		if (choice == 'y')
			system("cls");
	}
	while (choice =='y');
	system ("cls");
	std:: cout << "You have chocsen to exit. Press any key to exit.\n";
	char x;
	std:: cin >> x;
	return main();
}
No, your calling them wrong.

You call a function like so:

PlayGame();

You don't need the type when you call a function.
Let me know if that solves your problem :)
Thank you! lol silly me I forgot.
Also, you shouldn't use stuff like
if (user_problem >= 5)
{
std:: cout << "Whoops! Please pick the right problem.\n";
}
what if the imput is -1? it's not a valid possibility but it isn't bigger or = 5. Just use default: on your switch. That will make it so that ANY inputs other then those you use, in this case 1,2,3,4, will have the same responde.
so you could just use
default:
std:: cout << "Whoops! Please pick the right problem.\n";
break;

also remember that if u want to keep asking for a value until you get a valid one you should probably put that switch inside a while.
Also. the return inside you're function should return a value, in this case of type char
I'm also a beginner myself but i think that's how it works.
Topic archived. No new replies allowed.