Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include<iostream>
#include<vector>
#include<string>
#include<windows.h>
#include<iterator>
using namespace std;
string Apt1, Apt2, Apt3, Road, smlH, medH, lrgH, eT1, eT2, eT3, gT1, gT2, gT3, wT1, wT2, wT3;
int Price_Apt1, Price_Apt2, Price_Apt3, Price_Road, price_smlH, price_medH, price_lrgH, price_eT1, price_eT2, price_eT3, price_gT1, price_gT2, price_gT3 , price_wT1, price_wT2, price_wT3;
int Population_Apt1, Population_Apt2, Population_Apt3, population_smlH, population_medH, population_lrgH;
string Apartment1_MapSize, Apartment2_MapSize, Apartment3_MapSize, Road_Mapsize, smlH_mapSize, medH_mapSize, lrgH_mapSize, eT1_mapSize, eT2_mapSize, eT3_mapSize, gT1_mapSize, gT2_mapSize, gT3_mapSize, wT1_mapSize, wT2_mapSize, wT3_mapSize;
int Tax_Definition;
int counter = 0, maximum = 10;
int demand;
int supply;
int pollution;
class housingdefine
{
private:
/* Count the amount of buildings we have currently */
int cnt()
{
if (counter == maximum) { return maximum };
else
{
++counter; return counter;
}
}
/* Appartments */
void definitionApt1()
{
Apt1 = "Small size apartments";
Price_Apt1 = 100;
Population_Apt1 = 30;
Apartment1_MapSize = ("a");
demand = 1;
};
void definitionApt2()
{
Apt2 = "Medium size apartments";
Price_Apt2 = 300;
Population_Apt2 = 120;
Apartment2_MapSize = ("A");
demand = 2;
}
void definitionApt3()
{
Apt3 = "Large size apartments";
Price_Apt3 = 500;
Population_Apt3 = 400;
Apartment3_MapSize = ("AA");
demand = 3;
}
/* Road */
void RoadSystem()
{
Road = "Road";
Price_Road = 50;
Road_Mapsize = ("R") * 5;
}
/* Houses */
void smallHouse()
{
smlH = "Small house";
price_smlH = 250;
population_smlH = 50;
smlH_mapSize = ("h") * 2;
demand = 1;
}
void mediumHouse()
{
smlH = "Medium house";
price_smlH = 400;
population_medH = 200;
medH_mapSize = ("H") * 2;
demand = 2;
}
void largeHouse()
{
smlH = "Large house";
price_smlH = 750;
population_lrgH = 550;
lrgH_mapSize = ("HH") * 2;
demand = 3;
}
/* Utility Buildings */
/* Electricity */
void elecT1()
{
eT1 = "Wind turbine";
supply = 6;
eT1_mapSize = ("E\n");
price_eT1 = 650;
}
void elecT2()
{
eT2 = "Coal Fueled Power Plant";
supply = 10;
eT2_mapSize = ("EE\n");
price_eT2 = 950;
pollution = 5;
}
void elecT3()
{
eT3 = "Solar Farm";
supply = 15;
eT3_mapSize = ("EEEE\n");
price_eT3 = 1750;
}
/* Gas */
void gasT1()
{
gT1 = "Gas Holder\n";
supply = 6;
gT1_mapSize = ("G\n");
price_gT1 = 650;
}
void gasT2()
{
gT2 = "Gas Factory\n";
supply = 10;
gT2_mapSize = ("GG\n");
price_gT2 = 950;
pollution = 5;
}
void gasT3()
{
gT3 = "Oil Rig\n";
supply = 15;
gT2_mapSize = ("GGGG\n");
price_gT2 = 1750;
}
/* Water */
void waterT1()
{
wT1 = "Water Pumping Station\n";
supply = 5;;
wT1_mapSize = ("W\n");
price_wT1 = 650;
}
void waterT2()
{
wT2 = "Water Purification Factory\n";
supply = 10;;
wT2_mapSize = ("WW\n");
price_wT2 = 950;
}
void waterT3()
{
wT3 = "Industrial Water Pumping Factory\n";
supply = 15;;
wT3_mapSize = ("WWWW\n");
price_wT3 = 1750;
}
public:
float NumberofHousing, Tax = 0.2;
bool SideRoad;
NumberofHousing = cnt();
housingdefine() /* A basic constructer for the code that explains the default settings , COULD BE ANYTHING HERE*/
{
cout << "Welcome to the city housing services.\nTax has been set to 20 percent to all the families in the apartment\n We currently hold " << NumberofHousing << " Apartments"
}
};
class housing_update : public housingdefine
{
public:
/*EVERYONE CAN PUT THEIR CODE HERE AND ACCESS STUFF FROM THE DEFINITION . IF ANYONE DOESNT KNOW HOW TO WORK WITH CLASS JUST LET ME KNOW"*/
};