Hi, I want to develop a code where the user has the decision to create an account or continue as a guest, but the "if" nerves get executed. I didn't continue the code because I couldn't pass this step, but to give more context, my idea is to create a shop menu. Also, I don't know if I'm complicating the code with the structs, but I just one to simulate an online store type.
[code]
#include <iostream>
#include <iomanip>
using namespace std;
cout << endl << endl;
cout << "\t****************************" << endl;
cout << "\t Welcome To Shop" << endl;
cout << "\t****************************" << endl;
cout << "\n \t Do you wnat to create an account before your pucharses?" << endl;
cout << "\t Type (Y/N)" << endl;
cout << "\t If N you will continue as a guest" << endl;
You've declared choice as an int. Make it a char instead.
I see you tried to use code tags, but it didn't work, please add [/code] to the end of your post. In the future, you can tag bits of code by highlighting them, and then clicking the "<>" button to the right of the edit window.
The struct will probably make the code easier, but it's too early to say for sure.
****************************
Welcome To Shop
****************************
Do you wnat to create an account before your pucharses?
Type (Y/N)
If N you will continue as a guest
Y
Account Details
Enter First Name:
Robert Smith
First name is Robert Smith
Program ended with exit code: 0
In the future, you can tag bits of code by highlighting them, and then clicking the "<>" button to the right of the edit window.
There is a bug that prevents this when creating a new topic. You either will have to add the tags manually, or submit the topic and then click edit which will allow you to use the format buttons.