-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
218 lines (172 loc) · 7.37 KB
/
main.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
// main.cpp
// GARA Score
// Created by Number Twenty Eight on 8/3/14.
// Copyright (c) 2014 Güez S. All rights reserved.
#include <iostream>
double getAverage(double* myArray, int myArrayLength){
double sum = 0;
for (int i = 0; i < myArrayLength; i++) {
sum += myArray[i];
}
return sum / myArrayLength;
}
int main(int argc, const char * argv[])
{
// Welcome message
std::cout << "WELCOME TO THE GARA SCORE CALCULATOR\n" << "*********************\n" << std::endl;
// Background information
std::cout << "This program offers a tool to assess a music artist's pop culture relavance.\n" << "*********************\n" << std::endl;
// PART I
// USER VARIABLE INPUT
std::cout << "Please enter your...\n" << std::endl;
std::cout << "NAME: ";
std::string userName;
std::getline(std::cin, userName);
std::cout << "NUMBER OF WEEKLY RADIO SPINS: ";
double weeklyRadioSpins;
std::cin >> weeklyRadioSpins;
if (weeklyRadioSpins > 8944.444){
weeklyRadioSpins = 8944.444;
}
std::cout << "NUMBER OF YOUTUBE/VEVO VIEWERS: ";
double youtubeAgg;
std::cin >> youtubeAgg;
if (youtubeAgg > 1005555.556){
youtubeAgg = 1005555.556;
}
std::cout << "NUMBER OF RECORDS SOLD: ";
double recordSales;
std::cin >> recordSales;
if (recordSales > 19937500.000){
recordSales = 19937500.000;
}
LOOP1:std::cout << "\nAre you signed to a major label with distribution in place, (1 = Y, 0 = N)?: ";
int hasDeal = 0;
std::cin >> hasDeal;
if (hasDeal > 1){
std::cout << "\nPLEASE ENTER EITHER '1' FOR 'YES' OR '0' FOR 'NO'!!!\n";
goto LOOP1;
}
// BILLBOARD ALGORITHM
double *pointer = NULL;
std::cout << "\nHow many songs do you currently have on the BILLBOARD charts?: ";
int input;
std::cin >> input;
pointer = new double[input];
int temp;
for (int counter = 0; counter < input; counter++) {
std::cout << "CHART POSITION " << counter+1 << ": #";
std::cin >> temp;
pointer[counter] = temp;
}
double average = getAverage(pointer, input);
std::cout << "AVERAGE CHART POSITION: " << average << std::endl;
double wtd_chartAverage;
if (average <= 10) {
wtd_chartAverage = 8.333;
}
else if (average > 10 && average <= 20){
wtd_chartAverage = 7.333;
}
else if (average > 20 && average <= 40){
wtd_chartAverage = 6.333;
}
else if (average > 40 && average <= 100){
wtd_chartAverage = 5.333;
}
else if (average > 100 && average <= 200){
wtd_chartAverage = 4.333;
}
else{
wtd_chartAverage = 0;
}
delete []pointer;
std::cout << "\nNUMBER OF TWITTER FOLLOWERS: ";
double twitterFollowers;
std::cin >> twitterFollowers;
if (twitterFollowers > 4888888.889){
twitterFollowers = 4888888.889;
}
std::cout << "NUMBER OF FACEBOOK LIKES: ";
double facebookLikes;
std::cin >> facebookLikes;
if (facebookLikes > 17222222.222) {
facebookLikes = 17222222.222;
}
std::cout << "NUMBER OF SOUNDCLOUD FOLLOWERS: ";
double soundcloudFollowers;
std::cin >> soundcloudFollowers;
if (soundcloudFollowers > 641111.111) {
soundcloudFollowers = 641111.111;
}
std::cout << "NUMBER OF ANNUAL VENUE SHOWS: ";
double venueShows;
std::cin >> venueShows;
if (venueShows > 29.889){
venueShows = 29.889;
}
std::cout << "NUMBER OF PRESS ARTICLES (IN LAST 12 MONTHS): ";
double pressArticles;
std::cin >> pressArticles;
if (pressArticles > 13.889) {
pressArticles = 13.889;
}
std::cout << "NUMBER OF TELEVISION APPEARANCES (IN LAST 12 MONTHS): ";
double tvAppearances;
std::cin >> tvAppearances;
if (tvAppearances > 10.778) {
tvAppearances = 10.778;
}
std::cout << "NUMBER OF PAID PRODUCT ENDORSEMENTS: ";
double productEndorsements;
std::cin >> productEndorsements;
if (productEndorsements > 2.111) {
productEndorsements = 2.111;
}
std::cout << "NUMBER OF ARTIST CO-SIGNS: ";
double artistCosigns;
std::cin >> artistCosigns;
if (artistCosigns > 2.111) {
artistCosigns = 2.111;
}
// PART IIA
// ALOGRITHM CALCULATION
// (ITEMIZED)
std::cout << "\nThe itemized GARA SCORE (not shown to user) is as follows: " << std::endl;
double wtd_weeklyRadioSpins = (((weeklyRadioSpins / 8944.444) * 100) * .15);
std::cout << "\nRADIO SPIN SCORE: " << wtd_weeklyRadioSpins << " out of 15.000" << std::endl;
double wtd_youtubeAgg = (((youtubeAgg / 1005555.556) * 100) * .16333);
std::cout << "YOUTUBE/VEVO SCORE: " << wtd_youtubeAgg << " out of 16.333" << std::endl;
double wtd_recordSales = (((recordSales / 19937500.000) * 100) * .16556);
std::cout << "RECORD SALES SCORE: " << wtd_recordSales << " out of 16.556" << std::endl;
// Insert code to calculate weight chart score (must go over logic)
std::cout << "BILLBOARD SCORE: " << wtd_chartAverage << " out of 8.333" << std::endl;
double wtd_twitterFollowers = (((twitterFollowers / 4888888.889) * 100) * .08667);
std::cout << "TWITTER SCORE: " << wtd_twitterFollowers << " out of 8.667" << std::endl;
double wtd_facebookLikes = (((facebookLikes / 17222222.222) * 100) * .05444);
std::cout << "FACEBOOK SCORE: " << wtd_facebookLikes << " out of 5.444" << std::endl;
double wtd_soundcloudFollowers = (((soundcloudFollowers / 641111.111) * 100) * .05778);
std::cout << "SOUNDCLOUD SCORE: " << wtd_soundcloudFollowers << " out of 5.778" << std::endl;
double wtd_venueShows = (((venueShows / 29.889) * 100) * .06000);
std::cout << "LIVE PERFORMANCE SCORE: " << wtd_venueShows << " out of 6.000" << std::endl;
double wtd_pressArticles = (((pressArticles / 13.889) * 100) * .05000);
std::cout << "PRESS SCORE: " << wtd_pressArticles << " out of 5.000" << std::endl;
double wtd_tvAppearances = (((tvAppearances / 10.778) * 100) * .10333);
std::cout << "TV APPEARANCE SCORE: " << wtd_tvAppearances << " out of 10.333" << std::endl;
double wtd_productEndorsements = (((productEndorsements / 2.111) * 100) * .01889);
std::cout << "PRODUCT ENDORSEMENT SCORE: " << wtd_productEndorsements << " out of 1.889" << std::endl;
double wtd_artistCosigns = (((artistCosigns / 2.111) * 100) * .006670);
std::cout << "ARTIST CO-SIGN SCORE: " << wtd_artistCosigns << " out of .667" << std::endl;
// PART IIB
// ALOGRITHM CALCULATION
// (TOTAL)
// Don't forget to add the chart position variable once the logic is sorted out above
double totalGARAScore = (wtd_weeklyRadioSpins + wtd_youtubeAgg + wtd_recordSales + wtd_chartAverage +wtd_twitterFollowers + wtd_facebookLikes + wtd_soundcloudFollowers + wtd_venueShows + wtd_pressArticles + wtd_tvAppearances + wtd_productEndorsements + wtd_artistCosigns);
std::cout << "\n" << userName << "," << "YOUR FINAL G-SCORE IS... " << std::endl;
if (hasDeal == 1){
std::cout << "\n********************* " << (totalGARAScore * 8) << "/800" << " *********************" << std::endl;
}
else
std::cout << "\n********************* " << ((totalGARAScore * 8) * 1.618) << "/800" << " *********************" << std::endl;
return 0;
}