Program is giving me gibberish

Hi, I wrote a simple program that uses a few yes or no questions to give a
commercial a score that tells how stupid it is but instead of giving me a score,
it gives me a random character like an ampersand or a spade(card type, not
gardening tool)
here is the code:
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
// How Stupid Is That Commercial.cpp : Defines the entry point for the console application.
//Uses simple yes or no questions to determine the stupidness of a commercial on a scale of 0 - 18 - 36

#include "stdafx.h"
#include <iostream>

using namespace std;
char Cartoon;
char TvShow;
char Price;
char Disclaimer;
char StupidScore;
char PlayAgain;

int _tmain(int argc, _TCHAR* argv[])
{
Top:
cout << "I'm going to ask you a few simple yes or no questions to determine how stupid \nthe commercial you're watching is on a scale of 1-10" << endl;
cout << "Is the commercial in cartoon form? (Y/N)" << endl;
cin >> Cartoon;
if (Cartoon == 'y'|| Cartoon == 'Y')
{
StupidScore += 3;
}
else if (Cartoon == 'n'|| Cartoon == 'N')
{
StupidScore -= 3;
}
cout << "Is the commercial telling you to watch an episode of a TV show? (Y/N)" << endl;
cin >> TvShow;
if (TvShow == 'y'|| TvShow == 'Y')
{
StupidScore += 5;
}
else if (TvShow == 'n'|| TvShow == 'N')
{
StupidScore -= 5;
}
cout << "Does the commercial say that similar products are sold for up to __ dollars,\nbut you can get this now for only __ dollars? (Y/N)" << endl;
cin >> Price;
if (Price == 'y'|| Price == 'Y')
{
StupidScore += 5;
}
else if (Price == 'n'|| Price == 'N')
{
StupidScore -= 5;
}
cout << "Does the commercial have a really long disclaimer at the bottom thats in \nsuch a small font you cant read it and it gets read really fast at the end so \nyou cant understand it? (Y/N)" << endl;
cin >> Disclaimer;
if (Disclaimer == 'y'|| Disclaimer == 'Y')
{
StupidScore += 5;
}
else if (Disclaimer == 'n'|| Disclaimer == 'N')
{
StupidScore -= 5;
}
StupidScore += 18;
cout << "The commercial you are watching has achieved a score of " << endl << StupidScore << " out of 36, 0 being not stupid at all, 36 being really stupid and 18 being \naverage." << endl;
PlayAgainTop:
cout << "Do you want to test another commercial? (Y/N)" << endl;
cin >> PlayAgain;
if(PlayAgain == 'y'|| PlayAgain == 'Y')
{
goto Top;
}
else if(PlayAgain == 'n'|| PlayAgain == 'N')
{
return 0;
}
else
{
cout << "Please enter a valid choice" << endl;
goto PlayAgainTop;
}
}

Any help would be greatly appreciated
It's because StupidScore is a char. Change the type to int and it should work fine.
You're declaring StupidScore as a char, but it should be an int. Just declare it as an int and be sure you initialize it to 0 and you should be fine.
Topic archived. No new replies allowed.