Malaysia > Kulalalumper
LMAO.
|
|

Just did this shit at college for 5 marks lol.
Code:/* Author: Rameez Raza(A1379) || Revil. */ #include "stdafx.h" #include <iostream> #include <string> using namespace std; int MathQ(); int GeoQ(); int main() { //identifier declaration int score1 = 0, score2 = 0, highM = 0, highG = 0; int option = 0; cout << "Would you like to play either the 1.Math Quiz or 2.Geography Quiz: "; cin>>option; if (option==1) { //call function score1 = MathQ(); } else if (option==2) { //call function score2 = GeoQ(); } else cout << "unknown"; if(option==1) highM=score1; else if(option==2) highG=score2; //display score cout <<"Math Score: " <<highM <<endl; cout <<"Geography Score: " <<highG <<endl; return 0; } //---Fuction Definition int MathQ() { int ans, count = 0, score = 0; cout <<"2 + 2 = "; cin>>ans; if (ans == 4) { score+=10; count++; } cout <<"3 x 3 = "; cin>>ans; if (ans == 9) { score+=10; count++; } cout <<"10 / 2 = "; cin>>ans; if (ans == 5) { score+=10; count++; } cout << "Your Score is: " <<score <<endl; cout << "You have answered " <<count <<"questions correct." <<endl; return score; } int GeoQ() { int count = 0, score = 0; string ans; cout <<"What is the Capital of Pakistan?"; cin>>ans; if (ans == "Islamabad") { score+=10; count++; } cout <<"What is the Capital of Florida?"; cin>>ans; if (ans == "Tallahassee") { score+=10; count++; } cout <<"What is the Capital of Malaysia?"; cin>>ans; if (ans == "KualaLumpur") { score+=10; count++; } cout << "Your Score is: " <<score <<endl; cout << "You have answered " <<count <<"questions correct." <<endl; return score; }

Malaysia > Kulalalumper
LMAO.
switch statements are cool, so's using OOP if you're going to bother using C++ over C!

![]()
Led Zeppelin - The Very Best Of
Tracks: 13+10 | Year: 2003 |Quality: Mp3|320kbps | Size: 184.4 MB
Genre: Rock, Metal
Tреклист:
CD1
01 good times gone bad 02:46
02 babe im gonna leave you 06:42
03 dazed and confused 06:27
04 communication breakdown 02:28
05 whole lotta love 05:34
06 what is and what should never be 04:44
07 immigrant song 02:27
08 since ive been loving you 07:24
09 black dog 04:55
10 rock and roll 03:40
11 the battle of the evermore 05:52
12 when the levee breaks 07:10
13 stairway to heaven 08:02
CD 2
01 the song remains the same 05:31
02 no quater 07:00
03 houses of the holy 04:03
04 trampled underfoot 05:36
05 kashmir 08:29
06 ten years gone 06:32
07 achilles last stand 10:23
08 nobodys fault but mine 06:18
09 all my love 05:52
10 in the evening 06:51
Download unibytes.com
Download letitbit.net
Download turbobit.net
I woulda Aced that test.

^ me too! THnx!
| « C++ and models | [HUGE &FREE] C/C++ E-Books Collection - Over 200MB - 39 Books! » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |