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:
// 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>
usingnamespace 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;
}
elseif (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;
}
elseif (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;
}
elseif (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;
}
elseif (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;
}
elseif(PlayAgain == 'n'|| PlayAgain == 'N')
{
return 0;
}
else
{
cout << "Please enter a valid choice" << endl;
goto PlayAgainTop;
}
}