I have a large program i need help with, what my program does is makes a character and saves it as a text file i need i have a set variable for skill points here is my code (with most of it cut out for it has no relivance to my problem so ill make a small program that will have my problem in it
what i want it to do is when you choose magic i want it to subtract 4 from SkillPoints And then tell you you have 8 points left you can spend them on magic or weapons then subtract the right amount, when there are no more points to spend or not enough to spend i want it to print your choices ie. magic magic weapons. if i need to be clearer or put my actual program on i will its just i didn't want to fill this up with code not relivent to my problemCode:#include <fstream> #include <iostream> #include <string> using namespace std; int main() { string spend; int SkillPoints = 12, Switch; cout<<" You have "<<SkillPoints<<" Points to spend do you want to spend them?(yes or no): "; cin>>spend; if (spend == "Yes") { cout<<"\n(1)magic or (2)weapons\n\n weapons cost 2 skill points magic cost 4 skill points"; cin>>Switch; cin.ignore(); switch ( Switch ) { case 1: { SkillPoints = SkillPoints - 4; break; } case 2: { SkillPoints = SkillPoints - 2; break; } default: { cout<<"you can only type 1 or 2: "; cin>>Switch; break; } } cout<<"\nSpend More points? you have "<<SkillPoints<<" Points left(yes or no): "; cin>>Switch; cin.ignore(); } else { cout<<"\nGoodbye"; cin.get(); } return 0; } {