-
Notifications
You must be signed in to change notification settings - Fork 0
/
REG.cpp
112 lines (103 loc) · 3.38 KB
/
REG.cpp
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
//
// main.cpp
// REG
//
// Created by Nkechi Iregbulem on 1/23/19.
// Copyright © 2019 Nkechi Iregbulem. All rights reserved.
//
#include "REG.h"
#include <iostream>
#include <string>
#include <time.h>
#include <random>
TvShows::TvShows()
{
std::string name;
std::string show;
std::string episode;
int randomIndex = 0;
}
TvShows::TvShows(std::string ShowName)
{
name = ShowName;
}
void TvShows::setShow(std::string tvShow)
{
std::string ShowName = tvShow;
name = tvShow;
}
void TvShows::setEpisodes(std::string episodes)
{
std::string episode = episodes;
}
std::string TvShows::getShow()
{
return name;
}
std::string TvShows::getEpisodes()
{
int randomIndex = rand() % 10;
std::string temp[10] = {"Season1:Episode1", "Season2:Episode2", "Season 3:Episode3", "Season 4:Episode4","Season5:Episode 2", "Season1: Episode 3", "Season 2:Episode 12", "Season 3:Episode 8", "Season 4: Episode 10", "Season 5: Episode 15"};
for( int i = 0; i < 10; ++i )
episode[i] = temp[i];
return episode[randomIndex];
return getEpisodes();
}
void TvShows::printInfo()
{
int option = 0;
//std::cout << name << std::endl;
//std::cout << name << std::endl;
//std::cout << name << std::endl;
//std::cout << name << std::endl;
while (option < 1 || option > 4) {
std::cout << "Please Enter an Option" << std::endl;
std::cin >> option;
};
srand( static_cast<unsigned int>(time(NULL)));
if (option == 1) {
name = "Friends";
std::cout << "You have chosen to watch " << name << std::endl << " Please wait a moment while we generate an episode" << std::endl;
std::cout << "........................." << std::endl;
std::cout << getEpisodes() << std::endl;
}
if (option == 2) {
name = "The Office";
std::cout << "You have chosen to watch "<< name << std::endl << "Please wait a moment while we generate an episode" << std::endl;
std::cout << ".........................." << std::endl;
std::cout << getEpisodes() << std::endl;
}
if (option == 3) {
name = "Boy Meets World";
std::cout << "You have chosen to watch " << name << std::endl <<"Please wait a moment while we generate an episode" << std::endl;
std::cout << "......................" << std::endl;
std::cout << getEpisodes() << std::endl;
}
if (option == 4) {
name = "Seinfeld";
std::cout << "You have chosen to watch " << name << std::endl <<"Please wait a moment while we generate an episode" << std::endl;
std::cout << "......................" << std::endl;
std::cout << getEpisodes() << std::endl;
}
}
int main() {
srand( static_cast<unsigned int>(time(NULL)));
std::cout << "1. Friends" << std::endl;
std::cout << "2. The Office" << std::endl;
std::cout << "3. Boy Meets World" << std::endl;
std::cout << "4. Seinfeld" << std::endl;
TvShows Netflix = TvShows();
Netflix.setShow("Friends");
Netflix.getEpisodes();
Netflix.printInfo();
Netflix.setShow("The Office");
Netflix.getEpisodes();
Netflix.printInfo();
Netflix.setShow("Boy Meets World");
Netflix.getEpisodes();
Netflix.printInfo();
Netflix.setShow("Seinfeld");
Netflix.getEpisodes();
Netflix.printInfo();
return 0;
}