I have no idea what is going on here. I do not get any errors, the program hits the first function and then skips to return 0. This is a practice exercise I'm doing. The user will input a number in a soda machine and then they receive the item which they chose. Any help would be greatly appreciated!
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
void Menu()
{
cout << "===========================" << endl;
cout << "========SODA MACHINE=======" << endl;
cout << "===========================" << endl;
cout << "Pick a soda... " << endl;
cout << "[1] Coca-Cola" << endl;
cout << "[2] Diet Coca-Cola" << endl;
cout << "[3] MUG Root Beer" << endl;
cout << "[4] Sprite" << endl;
}
int processSelection()
{
int selection;
cin >> selection;
cout << "This function was called." << endl;
return selection;
}
void dropSoda()
{
int myselection;
myselection = processSelection();
switch (myselection)
{
case 1:
cout << "Your can of Coca-Cola drops into the bin at the bottom of the machine." << endl;
break;
case 2:
cout << "Your can of Diet Coca-Cola drops into the bin at the bottom of the machine." << endl;
break;
case 3:
cout << "Your can of MUG Root Beer drops into the bin at the bottom of the machine." << endl;
break;
case 4:
cout << "Your can of Sprite drops into the bin at the bottom of the machine." << endl;
break;
default:
cout << "INVALID SELECTION." << endl;
break;
}
}
int _tmain(int argc, _TCHAR* argv[])
{
Menu();
int processSelection();
void dropSoda();
return 0;
}