Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#pragma once | ||
class Inventory | ||
{ | ||
private: | ||
int itemNumber; | ||
int quantity; | ||
double cost; | ||
double totalCost; | ||
public: | ||
Inventory() // declare the Inventory object using the default constructor | ||
{ | ||
itemNumber = 0; | ||
quantity = 0; | ||
cost = 0; | ||
totalCost = 0; | ||
|
||
} | ||
Inventory(int newItemNumber, int newQuantity, double newCost) | ||
{ | ||
itemNumber = newItemNumber; | ||
quantity = newQuantity; | ||
cost = newCost; | ||
setTotalCost(quantity, cost); | ||
} | ||
|
||
void setItemNumber(int) | ||
{ | ||
itemNumber = itemNumber; | ||
} | ||
void setQuantity(int) | ||
{ | ||
quantity = quantity; | ||
} | ||
void setCost(double) | ||
{ | ||
cost = cost; | ||
} | ||
void setTotalCost(int, double) | ||
{ | ||
totalCost = quantity * cost; | ||
} | ||
|
||
int getItemNumber() | ||
{ | ||
return itemNumber; | ||
} | ||
int getQuantity() | ||
{ | ||
return quantity; | ||
} | ||
double getCost() | ||
{ | ||
return cost; | ||
} | ||
double getTotalCost() | ||
{ | ||
return totalCost; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
class player | ||
{ | ||
private: | ||
string name; | ||
float average; | ||
char team; | ||
public: | ||
player(string n, float a, char t) | ||
{ | ||
name = n; | ||
average = a; | ||
team = t; | ||
|
||
} | ||
void setname(string n) | ||
{ | ||
name = n; | ||
} | ||
void setaverage(float a) | ||
{ | ||
average = a; | ||
} | ||
void setteam(char t) | ||
{ | ||
team = t; | ||
} | ||
string | ||
|
||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "start.h" | ||
#include <iostream> | ||
#include <string> | ||
#include <windows.h> | ||
#include <chrono> | ||
#include <thread> | ||
#include <time.h> | ||
#include <ctime> | ||
#include <stdlib.h> | ||
using namespace std; | ||
|
||
int main() { | ||
char Adventure[] = "you are now in the house of all dispare with nothing but your wit and cunning to help get you out\n" | ||
"you will need to navigate your way from room to room completing tasks and collecting items to help free you\n"; | ||
|
||
for (int i = 0; i < sizeof(Adventure); i++) { | ||
cout << Adventure[i]; | ||
Sleep(100); | ||
} | ||
int i = 1; | ||
while (i < 5) { | ||
cout << "you find yourself in the passage on the 1st floor" << endl; | ||
Sleep(1000); | ||
cout << "you have a choice of room in all directions of you" << endl; | ||
Sleep(1000); | ||
cout << "you have a choice to go either north, east, south or west" << endl; | ||
cout << "which way will you go" << endl; | ||
string path; | ||
cin >> path; | ||
|
||
if (path == "east") { | ||
cout << "you are infront of the study" << endl; | ||
Sleep(100); | ||
cout << "enter or go somewhere else?" << endl; | ||
string path1; | ||
cin >> path1; | ||
|
||
if (path1 == "enter") { | ||
cout << "you have now entered the study "; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <iomanip> | ||
#include <iostream> | ||
#include <stdlib.h> | ||
#include <Windows.h> | ||
using namespace std; | ||
class timer | ||
{ | ||
int hours = 0; | ||
int minutes = 0; | ||
int seconds = 0; | ||
|
||
// function to display the timer | ||
void CounterClock() | ||
{ | ||
// system call to clear the screen | ||
system("clear"); | ||
|
||
cout << setfill(' ') << setw(55) << " TIMER \n"; | ||
cout << setfill(' ') << setw(55) << " --------------------------\n"; | ||
cout << setfill(' ') << setw(29); | ||
cout << "| " << setfill('0') << setw(2) << hours << " hrs | "; | ||
cout << setfill('0') << setw(2) << minutes << " min | "; | ||
cout << setfill('0') << setw(2) << seconds << " sec |" << endl; | ||
cout << setfill(' ') << setw(55) << " --------------------------\n"; | ||
} | ||
|
||
void countdown() | ||
{ | ||
while (true) { | ||
CounterClock(); | ||
|
||
Sleep(1); | ||
|
||
seconds++; | ||
|
||
if (seconds == 60) { | ||
minutes++; | ||
|
||
if (minutes == 60) { | ||
hours++; | ||
minutes = 0; | ||
|
||
} | ||
seconds = 0; | ||
} | ||
} | ||
} | ||
|
||
}; | ||
|