Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <cstdlib>
- #include <stdlib.h>
- using namespace std;
- //Global Var
- //Country Price:
- string country;
- //Prices
- float potPrice, oilPrice, fishPrice, woolPrice, velvetPrice, toolsPrice, spicePrice, ironPrice, flourPrice, dyesPrice, leatherworksPrice, furPrice, beerPrice, saltPrice, winePrice;
- //User
- float balance = 3000;
- int quantity=0;
- //Goods
- string trade_goods;
- string potStr = "Pottery", oilStr = "Oil", fishStr = "Fish", woolStr = "Wool", velvetStr = "Velvet", toolsStr = "Tools", spiceStr = "Spice", ironStr = "Iron", flourStr = "Flour", dyesStr = "Dyes", leatherStr = "Leatherworks", furStr = "Fur", beerStr = "Beer", saltStr = "Salt", wineStr = "Wine";
- float price;
- int inv;
- //Inventory
- int potInv=0, oilInv=0, fishInv=0, woolInv=0, velvetInv=0, toolsInv=0, spiceInv=0, ironInv=0, flourInv=0, dyesInv=0, leatherInv=0, furInv=0, beerInv=0, saltInv=0, wineInv=0;
- //End of Global Var //
- //Trade Goods
- void pottery(void);
- void oil(void);
- void fish(void);
- void wool_cloth(void);
- void velvet(void);
- void tools(void);
- void spice(void);
- void iron(void);
- void flour(void);
- void dyes(void);
- void leatherworks(void);
- void fur(void);
- void beer(void);
- void salt(void);
- void wine(void);
- //Countries
- void sweden(void);
- void poland(void);
- void russia(void);
- void crimea(void);
- void saudi(void);
- void ukraine(void);
- void china(void);
- //Action
- void trade(void);
- void trade2(void);
- void trade2P1(void);
- void trade2P2(void);
- void loc(void);
- //Main
- main(){
- loc();
- }
- //Trade Prices
- void pottery(void){
- //string potStr = "Pottery";
- //void potPrice;
- if (country=="Sweden") potPrice = 90;
- else if (country=="Poland") potPrice = 157.5;
- else if (country=="Russia") potPrice = 157.5;
- else if (country=="Crimea") potPrice = 99;
- else if (country=="Saudi") potPrice = 67.5;
- else if (country=="Ukraine") potPrice = 99;
- else if (country=="China") potPrice = 90;
- }
- void oil(void){
- //string oilStr = "Oil";
- //void oilPrice;
- if (country=="Sweden") oilPrice = 400;
- else if (country=="Poland") oilPrice = 300;
- else if (country=="Russia") oilPrice = 700;
- else if (country=="Crimea") oilPrice = 700;
- else if (country=="Saudi") oilPrice = 440;
- else if (country=="Ukraine") oilPrice = 440;
- else if (country=="China") oilPrice = 400;
- }
- void fish(void){
- //string fishStr = "Fish";
- //void fishPrice;
- if (country=="Sweden") fishPrice = 50;
- else if (country=="Poland") fishPrice = 55;
- else if (country=="Russia") fishPrice = 87.5;
- else if (country=="Crimea") fishPrice = 55;
- else if (country=="Saudi") fishPrice = 87.5;
- else if (country=="Ukraine") fishPrice = 55;
- else if (country=="China") fishPrice = 50;
- }
- void wool_cloth(void){
- //string woolStr = "Wool Cloth";
- //void woolPrice;
- if (country=="Sweden") woolPrice = 240;
- else if (country=="Poland") woolPrice = 180;
- else if (country=="Russia") woolPrice = 180;
- else if (country=="Crimea") woolPrice = 264;
- else if (country=="Saudi") woolPrice = 264;
- else if (country=="Ukraine") woolPrice = 264;
- else if (country=="China") woolPrice = 240;
- }
- void velvet(void){
- //string velvetStr = "Velvet";
- //void velvetPrice;
- if (country=="Sweden") velvetPrice = 950;
- else if (country=="Poland") velvetPrice = 1662.5;
- else if (country=="Russia") velvetPrice = 1662.5;
- else if (country=="Crimea") velvetPrice = 990;
- else if (country=="Saudi") velvetPrice = 712.5;
- else if (country=="Ukraine") velvetPrice = 990;
- else if (country=="China") velvetPrice = 950;
- }
- void tools(void){
- //string toolsStr = "Tools";
- //void toolsPrice;
- if (country=="Sweden") toolsPrice = 400;
- else if (country=="Poland") toolsPrice = 300;
- else if (country=="Russia") toolsPrice = 700;
- else if (country=="Crimea") toolsPrice = 440;
- else if (country=="Saudi") toolsPrice = 440;
- else if (country=="Ukraine") toolsPrice = 440;
- else if (country=="China") toolsPrice = 400;
- }
- void spice(void){
- //string spiceStr = "Spice";
- //void spicePrice;
- if (country=="Sweden") spicePrice = 800;
- else if (country=="Poland") spicePrice = 1400;
- else if (country=="Russia") spicePrice = 600;
- else if (country=="Crimea") spicePrice = 880;
- else if (country=="Saudi") spicePrice = 600;
- else if (country=="Ukraine") spicePrice = 880;
- else if (country=="China") spicePrice = 800;
- }
- void iron(void){
- //string ironStr = "Iron";
- //void ironPrice;
- if (country=="Sweden") ironPrice = 220;
- else if (country=="Poland") ironPrice = 365;
- else if (country=="Russia") ironPrice = 365;
- else if (country=="Crimea") ironPrice = 365;
- else if (country=="Saudi") ironPrice = 165;
- else if (country=="Ukraine") ironPrice = 242;
- else if (country=="China") ironPrice = 220;
- }
- void flour(void){
- //string flourStr = "Flour";
- //void flourPrice;
- if (country=="Sweden") flourPrice = 50;
- else if (country=="Poland") flourPrice = 37.5;
- else if (country=="Russia") flourPrice = 87.5;
- else if (country=="Crimea") flourPrice = 55;
- else if (country=="Saudi") flourPrice = 87.5;
- else if (country=="Ukraine") flourPrice = 55;
- else if (country=="China") flourPrice = 50;
- }
- void dyes(void){
- //string dyesStr = "Dyes";
- //void dyesPrice;
- if (country=="Sweden") dyesPrice = 180;
- else if (country=="Poland") dyesPrice = 198;
- else if (country=="Russia") dyesPrice = 135;
- else if (country=="Crimea") dyesPrice = 198;
- else if (country=="Saudi") dyesPrice = 198;
- else if (country=="Ukraine") dyesPrice = 198;
- else if (country=="China") dyesPrice = 180;
- }
- void leatherworks(void){
- //string leatherworksStr = "Leatherworks";
- //void leatherworksPrice;
- if (country=="Sweden") leatherworksPrice = 180;
- else if (country=="Poland") leatherworksPrice = 198;
- else if (country=="Russia") leatherworksPrice = 315;
- else if (country=="Crimea") leatherworksPrice = 135;
- else if (country=="Saudi") leatherworksPrice = 135;
- else if (country=="Ukraine") leatherworksPrice = 198;
- else if (country=="China") leatherworksPrice = 180;
- }
- void fur(void){
- //string furStr = "Fur";
- //void furPrice;
- if (country=="Sweden") furPrice = 390;
- else if (country=="Poland") furPrice = 429;
- else if (country=="Russia") furPrice = 292.5;
- else if (country=="Crimea") furPrice = 429;
- else if (country=="Saudi") furPrice = 429;
- else if (country=="Ukraine") furPrice = 429;
- else if (country=="China") furPrice = 390;
- }
- void beer(void){
- //string beerStr = "Beer";
- //void beerPrice;
- if (country=="Sweden") beerPrice = 100;
- else if (country=="Poland") beerPrice = 75;
- else if (country=="Russia") beerPrice = 175;
- else if (country=="Crimea") beerPrice = 175;
- else if (country=="Saudi") beerPrice = 175;
- else if (country=="Ukraine") beerPrice = 110;
- else if (country=="China") beerPrice = 100;
- }
- void salt(void){
- //string saltStr = "Salt";
- //void saltPrice;
- if (country=="Sweden") saltPrice = 220;
- else if (country=="Poland") saltPrice = 165;
- else if (country=="Russia") saltPrice = 385;
- else if (country=="Crimea") saltPrice = 165;
- else if (country=="Saudi") saltPrice = 165;
- else if (country=="Ukraine") saltPrice = 242;
- else if (country=="China") saltPrice = 220;
- }
- void wine(void){
- //string wineStr = "Wine";
- //void winePrice;
- if (country=="Sweden") winePrice = 200;
- else if (country=="Poland") winePrice = 220;
- else if (country=="Russia") winePrice = 150;
- else if (country=="Crimea") winePrice = 220;
- else if (country=="Saudi") winePrice = 220;
- else if (country=="Ukraine") winePrice = 220;
- else if (country=="China") winePrice = 200;
- }
- //Act
- void loc(void){
- int opt, opt1;
- //float balance;
- cout << endl << setprecision(2) << fixed << "Balance: " << balance << endl;
- cout << "1. Trade" << endl;
- cout << "2. Check Inventory" << endl;
- cout << endl << "What do you want to do? ";
- cin >> opt;
- if (opt==1){
- cout << endl << "Notes:" << endl;
- cout << "Sweden's exports and imports are well-met." << endl << endl;
- cout << "Poland's Imports and Exports" << endl;
- cout << "Exports: Oil, Beer, Flour, Tools" << endl;
- cout << "Imports: Velvet, Iron, Spice, Pottery" << endl << endl;
- cout << "Russia's Imports and Exports" << endl;
- cout << "Exports: Furs, Dyes, Spice, Wool" << endl;
- cout << "Imports: Oil, Fish, Salt, Velvet, Flour, Pottery, Beer, Tools, Iron, Leatherworks" << endl << endl;
- cout << "Crimea's Imports and Exports" << endl;
- cout << "Exports: Leatherworks, Salt, Wine" << endl;
- cout << "Imports: Iron, Oil, Beer" << endl << endl;
- cout << "Saudi Arabia's Imports and Exports . . . " << endl;
- cout << "Exports: Salt, Pottery, Velvet" << endl;
- cout << "Imports: Flour, Beer, Fish" << endl << endl;
- cout << "China's exports and imports are well-met." << endl << endl;
- cout << "Ukraine's exports and imports are slightly well-met." << endl << endl;
- cout << "1. Sweden" << endl;
- cout << "2. Poland" << endl;
- cout << "3. Russia" << endl;
- cout << "4. Crimea" << endl;
- cout << "5. Saudi Arabia" << endl;
- cout << "6. Ukraine" << endl;
- cout << "7. China" << endl;
- cout << endl << "Which countries do you want to trade with? ";
- cin >> opt1;
- if (opt1==1) sweden();
- else if (opt1==2) poland();
- else if (opt1==3) russia();
- else if (opt1==4) crimea();
- else if (opt1==5) saudi();
- else if (opt1==6) ukraine();
- else if (opt1==7) china();
- }
- else if (opt==2){
- cout << "Checking inventory . . . " << endl;
- cout << "You currently have . . . " << endl;
- cout << "1. Pottery: " << potInv << endl;
- cout << "2. Oil: " << oilInv << endl;
- cout << "3. Fish: " << fishInv << endl;
- cout << "4. Wool Cloth: " << woolInv << endl;
- cout << "5. Velvet: " << velvetInv << endl;
- cout << "6. Tools: " << toolsInv << endl;
- cout << "7. Spice: " << spiceInv << endl;
- cout << "8. Iron: " << ironInv << endl;
- cout << "9. Flour: " << flourInv << endl;
- cout << "10. Dyes: " << dyesInv << endl;
- cout << "11. Leatherworks: " << leatherInv << endl;
- cout << "12. Fur: " << furInv << endl;
- cout << "13. Beer: " << beerInv << endl;
- cout << "14. Salt: " << saltInv << endl;
- cout << "15. Wine: " << wineInv << endl;
- system("pause");
- loc();
- }
- }
- void trade(void){
- cout << endl << "1. Buy" << endl;
- cout << endl << "2. Sell" << endl;
- cout << endl << "3. Return to Start" << endl;
- }
- void trade2(void){
- cout << endl << "Buy Goods " << endl;
- cout << setprecision(2) << fixed;
- cout << "1. Pottery " << potPrice << endl;
- cout << "2. Oil " << oilPrice << endl;
- cout << "3. Fish " << fishPrice << endl;
- cout << "4. Wool Cloth " << woolPrice << endl;
- cout << "5. Velvet " << velvetPrice << endl;
- cout << "6. Tools " << toolsPrice << endl;
- cout << "7. Spice " << spicePrice << endl;
- cout << "8. Iron " << ironPrice << endl;
- cout << "9. Flour " << flourPrice << endl;
- cout << "10. Dyes " << dyesPrice << endl;
- cout << "11. Leatherworks " << leatherworksPrice << endl;
- cout << "12. Fur " << furPrice << endl;
- cout << "13. Beer " << beerPrice << endl;
- cout << "14. Salt " << saltPrice << endl;
- cout << "15. Wine " << winePrice << endl;
- }
- void trade2P1(void){
- string opt;
- trade2();
- cout << "Choose Trade Goods to Buy: ";
- cin >> opt;
- if (opt=="1"){
- trade_goods = potStr;
- price = potPrice;
- }
- else if (opt=="2"){
- trade_goods = oilStr;
- price = oilPrice;
- }
- else if (opt=="3"){
- trade_goods = fishStr;
- price = fishPrice;
- }
- else if (opt=="4"){
- trade_goods = woolStr;
- price = woolPrice;
- }
- else if (opt=="5"){
- trade_goods = velvetStr;
- price = velvetPrice;
- }
- else if (opt=="6"){
- trade_goods = toolsStr;
- price = toolsPrice;
- }
- else if (opt=="7"){
- trade_goods = spiceStr;
- price = spicePrice;
- }
- else if (opt=="8"){
- trade_goods = ironStr;
- price = ironPrice;
- }
- else if (opt=="9"){
- trade_goods = flourStr;
- price = flourPrice;
- }
- else if (opt=="10"){
- trade_goods = dyesStr;
- price = dyesPrice;
- }
- else if (opt=="11"){
- trade_goods = leatherStr;
- price = leatherworksPrice;
- }
- else if (opt=="12"){
- trade_goods = furStr;
- price = furPrice;
- }
- else if (opt=="13"){
- trade_goods = beerStr;
- price = beerPrice;
- }
- else if (opt=="14"){
- trade_goods = saltStr;
- price = saltPrice;
- }
- else if (opt=="15"){
- trade_goods = wineStr;
- price = winePrice;
- }
- cout << "How many " << trade_goods << " do you want to buy? ";
- cin >> quantity;
- cout << endl << "You bought " << quantity << " " << trade_goods << " for " << price*quantity << endl;
- balance -= price*quantity;
- //cout << endl << "Balance: " << balance << endl;
- if (opt=="1") potInv += quantity;
- else if (opt=="2") oilInv += quantity;
- else if (opt=="3") fishInv += quantity;
- else if (opt=="4") woolInv += quantity;
- else if (opt=="5") velvetInv += quantity;
- else if (opt=="6") toolsInv += quantity;
- else if (opt=="7") spiceInv += quantity;
- else if (opt=="8") ironInv += quantity;
- else if (opt=="9") flourInv += quantity;
- else if (opt=="10") dyesInv += quantity;
- else if (opt=="11") leatherInv += quantity;
- else if (opt=="12") furInv += quantity;
- else if (opt=="13") beerInv += quantity;
- else if (opt=="14") saltInv += quantity;
- else if (opt=="15") wineInv += quantity;
- loc();
- }
- void trade2P2(void){
- string opt;
- trade2();
- cout << "Choose Trade Goods to Sell: ";
- cin >> opt;
- if (opt=="1"){
- trade_goods = potStr;
- price = potPrice;
- }
- else if (opt=="2"){
- trade_goods = oilStr;
- price = oilPrice;
- }
- else if (opt=="3"){
- trade_goods = fishStr;
- price = fishPrice;
- }
- else if (opt=="4"){
- trade_goods = woolStr;
- price = woolPrice;
- }
- else if (opt=="5"){
- trade_goods = velvetStr;
- price = velvetPrice;
- }
- else if (opt=="6"){
- trade_goods = toolsStr;
- price = toolsPrice;
- }
- else if (opt=="7"){
- trade_goods = spiceStr;
- price = spicePrice;
- }
- else if (opt=="8"){
- trade_goods = ironStr;
- price = ironPrice;
- }
- else if (opt=="9"){
- trade_goods = flourStr;
- price = flourPrice;
- }
- else if (opt=="10"){
- trade_goods = dyesStr;
- price = dyesPrice;
- }
- else if (opt=="11"){
- trade_goods = leatherStr;
- price = leatherworksPrice;
- }
- else if (opt=="12"){
- trade_goods = furStr;
- price = furPrice;
- }
- else if (opt=="13"){
- trade_goods = beerStr;
- price = beerPrice;
- }
- else if (opt=="14"){
- trade_goods = saltStr;
- price = saltPrice;
- }
- else if (opt=="15"){
- trade_goods = wineStr;
- price = winePrice;
- }
- cout << "How many " << trade_goods << " do you want to sell? ";
- cin >> quantity;
- cout << endl << "You sold " << quantity << " " << trade_goods << " for " << price*quantity << endl;
- balance += price*quantity;
- //cout << endl << "Balance: " << balance << endl;
- if (opt=="1") potInv -= quantity;
- else if (opt=="2") oilInv -= quantity;
- else if (opt=="3") fishInv -= quantity;
- else if (opt=="4") woolInv -= quantity;
- else if (opt=="5") velvetInv -= quantity;
- else if (opt=="6") toolsInv -= quantity;
- else if (opt=="7") spiceInv -= quantity;
- else if (opt=="8") ironInv -= quantity;
- else if (opt=="9") flourInv -= quantity;
- else if (opt=="10") dyesInv -= quantity;
- else if (opt=="11") leatherInv -= quantity;
- else if (opt=="12") furInv -= quantity;
- else if (opt=="13") beerInv -= quantity;
- else if (opt=="14") saltInv -= quantity;
- else if (opt=="15") wineInv -= quantity;
- loc();
- }
- //Countries
- void sweden(void){
- string opt;
- country="Sweden";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- cout << endl << "You have chosen to trade with Sweden . . . " << endl;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
- void poland(void){
- string opt;
- country="Poland";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- cout << endl << "You have chosen to trade with Poland . . . " << endl;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
- void russia(void){
- string opt;
- country="Russia";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- cout << endl << "You have chosen to trade with Russia . . . " << endl;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
- void crimea(void){
- string opt;
- country="Crimea";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- cout << endl << "You have chosen to trade with Crimea . . . " << endl;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
- void saudi(void){
- string opt;
- country="Saudi";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- cout << endl << "You have chosen to trade with Saudi Arabia . . . " << endl;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
- void ukraine(void){
- string opt;
- country="Ukraine";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- cout << endl << "You have chosen to trade with Ukraine . . . " << endl;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
- void china(void){
- string opt;
- country="China";
- pottery();oil();fish();wool_cloth();velvet();tools();spice();iron();flour();dyes();leatherworks();fur();beer();salt();wine();
- quantity = 0;
- trade();
- cout << "Enter Input: ";
- cin >> opt;
- //buy/sell
- if (opt=="1"){
- trade2P1();
- }
- else if (opt=="2"){
- trade2P2();
- }
- else if (opt=="3"){
- loc();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement