Hey guys, i am very new to C++ but i know some little things about it.
I am trying to make a simple dos program with simple arithmetic but i forgot how to do some things since it has been ages since i last coded.
I am trying to make a game sort of thing where you can buy houses, and when you buy a house, the cost of the house is taken away from your balance. I am also thinking about somehow making the value of the houses randomly rise and drop by its self.
Here is some unfinished code, i am going to make it better, but yeah.
#include <iostream>
using namespace std;
int main() {
int balance;
int House1;
balance = 500,000;
House1 = 150,000;
cout << "Hi, Welcome to the game!\n";
cout << "Your balance is $500,000.\n";
cout << "Type 'House1' for The $150,000 house\n";
cout << "\n";
cin.get();
return 0;
}
I also have a problem where, when i press enter, it closes the program, and the
cin.get()
is the only thing that is stopping it from closing automatically without me being able to read anything.
I forgot how to make it so when i type something and press enter, it displays what i wanted it to.
Thanks for any help.