Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Jason and Kevin
- #include <iostream>
- #include <string>
- #include <iomanip>
- #include <random>
- #include <limits>
- #include <ios>
- using namespace std;
- int score = 0;
- string q;
- void end() { // ending function
- cout << "===============================\n"
- << "Your Final score is " << score << "/10" //prints score
- << " or " << (score * 10) << "%\n" // Multiplies by 10 to get percent
- << "===============================\n";
- exit(0); // ends
- }
- void question10() { //comments for questions below:
- cout << "\nQuestion 10:\n"
- << "Which member of Monty Python is dead?\n"
- << "a) Eric Idle\n"
- << "b) Graham Chapman\n"
- << "c) John Cleese\n"
- << "d) Terry Jones\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "b") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: B\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- end();
- }
- void question9() {
- cout << "\nQuestion 9:\n"
- << "The evil villan Andross is a: \n"
- << "a) Monkey\n"
- << "b) Crocodile\n"
- << "c) Tiger\n"
- << "d) Pig\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "a") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: A\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question10();
- }
- void question8() {
- cout << "\nQuestion 8:\n"
- << "What is 666th Pokémon in the National Pokédex?\n"
- << "a) Talon Flame\n"
- << "b) Persian\n"
- << "c) Flareon\n"
- << "d) Vivillon\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "d") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: D\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question9();
- }
- void question7() {
- cout << "\nQuestion 7:\n"
- << "What material is Dark Samus made of?\n"
- << "a) Adaptanium\n"
- << "b) Uridium\n"
- << "c) Phazon\n"
- << "d) Cromainium\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "c") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: C\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question8();
- }
- void question6() {
- cout << "\nQuestion 6:\n"
- << "What is the relationship between the ICE CLIMBERS?\n"
- << "a) Brother and Sister\n"
- << "b) Husband and Wife\n"
- << "c) Boyfriend and girlfriend\n"
- << "d) Nephew and Aunt\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "d") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: D\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question7();
- }
- void question5() {
- cout << "\nQuestion 5:\n"
- << "What philosophical thoery is present in Bioshock?\n"
- << "a) Objectivism\n"
- << "b) Dawrinism\n"
- << "c) virtue Ethic\n"
- << "d) Utilitarianism\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "a") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: A\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question6();
- }
- void question4() {
- cout << "\nQuestion 4:\n"
- << "What is the #1 selling game of all time?\n"
- << "a) GTA V\n"
- << "b) Wii sports\n"
- << "c) The Witcher 3\n"
- << "d) Super Mario Bros\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "b") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: B\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question5();
- }
- void question3() {
- cout << "\nQuestion 3:\n"
- << "How many levels are in Super Mario World's star world??\n"
- << "a) 3\n"
- << "b) 4\n"
- << "c) 5\n"
- << "d) 6\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "c") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: C\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question4();
- }
- void question2() {
- cout << "\nQuestion 2:\n"
- << "What is the name of Links boat in the wind waker?\n"
- << "a) The Red tiger\n"
- << "b) Sail of Hyrule\n"
- << "c) king of red ganon\n"
- << "d) King of red lions\n\n"
- << "Your awnser: ";
- cin >> q;
- if (q == "d") {
- cout << "\nCORRECT!\n";
- score += 1;
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else {
- cout << "\nWRONG. The correct awnser is: d\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question3();
- }
- void question1() { // Each function is a question
- cout << "--------------------\n"
- << " TEST \n"
- << "--------------------\n\n";
- cout << "Question 1:\n"
- << "Where is Kirby from?\n"
- << "a) Candy land\n"
- << "b) Kloud Kingdom\n"
- << "c) Dream land\n"
- << "d) Robotnic's Kingdom\n\n"
- << "Your awnser: ";
- cin >> q; // inouts awnser
- if (q == "c") { // If the input is the correct awnser
- cout << "\nCORRECT!\n";
- score += 1; // adds one to correct counter
- cout << "----------------------------------------\n";
- cout << "Your score is: " << score << " out of 10\n";
- cout << "----------------------------------------\n";
- }
- else { // else it will not add anything
- cout << "\nWRONG. The correct awnser is: C\n"
- << "----------------------------------------\n"
- << "Your score is: " << score << " out of 10\n"
- << "----------------------------------------\n";
- }
- question2(); //Goes to next question and it is the same for rest
- }
- void starttest() {
- int start;
- cout << "Ready to take test?\n1. Yes\n2. No\n\n";
- cin >> start;
- switch (start) {
- case 1 : question1();
- break;
- case 2: cout << "\nOk good bye";
- exit(0);
- break;
- default : question1();
- }
- }
- int main() {
- string arr [] = {"Jason","Kevin"}; //Usernames in system
- string username, password, jasonPassword = "password", kevinPassword = "password";
- int x, userpass;
- cout << "-----------Test Tron------------\n"
- << "Enter test username and password\n"
- << "--------------------------------\n"
- << "Username: ";
- cin >> username;
- for (x = 0 ; x < 2 ; x++) { //for loop
- if (username == arr[x]) { //checks if the username is in any spot of the array
- cout << "\nWelcome " << username << "\n";
- if (username == arr[0]) {
- userpass = 1;
- }
- break;
- }
- if (x == 1) {
- cout << "User name not found. Please try again";
- exit(0);
- }
- }
- cout << "\n" << "Your Password: "; //asks for password
- if (userpass == 1) { //password for me as added to counter before
- for (x = 0 ; x < 5 ; x++) {
- cin >> password; //inputs password
- if (password == jasonPassword) { //Checks if eqaul to my password
- starttest(); //if so, starts questions
- }
- else {
- cout << "Incorrect password try again: "; //Trys again until 5 attemps are up
- }
- }
- cout << "\nToo many tries, you are locked out"; //locks out after 5
- }
- else {
- for (x = 0 ; x < 5 ; x++) { //same for kevin
- cin >> password;
- if (password == kevinPassword) {
- starttest();
- }
- else {
- cout << "Incorrect password try again: ";
- }
- }
- cout << "\nToo many tries, you are locked out";
- }
- }
Add Comment
Please, Sign In to add comment