Hello! I'm a beginner, and i'm starting to get the grasp of a lot of aspects. I'm trying to make a basic store. You have $20. This $20 is changeable, meaning you can add to it (by selling or buying). Red apples cost $2 and Green apples cost $3 (Shut up, green apples are better no matter what you say)
I want a menu that will allow a semi-"userface"
Im not wanting to code any GUI as of no, this is just pure c++ console
I want the basic layout to be;
Welcome! Please purchase some items
Red Apples cost $2
Green Apples cost $3
You have $20 <---- Update based on later input
Inventory
----------
[NUMBER YOU HAVE] xRed Apples
[NUMBER YOU HAVE] xGreen Apples
----------
Buy X Red Apples <---- Be able to switch between with "W" or "S"
Buy X Green Apples
Anyways, this is as far as i can get. Im not sure how to make the rest. Thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#include <iostream>
using namespace std;
int Wallet = 20;
int RedApp_P = 2;
int GreApp_P = 3;
int UsrInputR;
int UsrInputG;
int main (){
cout << "Welcome! Please purchase some items" << endl;
cout << "Red apples cost $2" << endl << "Green apples cost $3" << endl << endl;
cout << "You have: $" << Wallet << endl;
cout << "Inventory" << endl;
cout << "---------------" << endl;
cout << "Buy " << UsrInputR << " Red Apples" << endl;
cout << "Buy " << UsrInputG << " Green Apples" << endl << endl << endl << endl;
return 0;
}
|
in