Coding Example
Coding Example
//
//
//
//
//
//
main.cpp
assignment1
Created by Stephen Addison on 10/15/15.
Copyright 2015 Stephen Addison. All rights reserved.
#include <iostream>
using namespace std;
int showMenu();
void rockPaperscissors();
void rollDice();
int main()
{
void rockPaperscissors(), rollDice();
int choice;
choice = showMenu();
if (choice == 1)
rockPaperscissors();
else if (choice == 2)
rollDice();
else
cout << "Game Ending!" << endl;
return 0;
}
int showMenu()
{
int choice;
cout << "1. Play Rock/Paper/Sciccorss." << endl;
cout << "2. Play Dice Role Game." << endl;
cout << "3. Exit (if any other input)" << endl;
cout << "Enter your choice: " << endl;
cin >> choice;
return choice;
}
void rockPapersciccors()
{
int answer, computer;
cout << "1. Rock " << endl;
cout << "2. Paper " << endl;