Question
In C ++ plus plus: I am almost finished writing this program but need help aligning everything together can someone help me? I have the
In C ++ plus plus: I am almost finished writing this program but need help aligning everything together can someone help me? I have the code I wrote below and need help making it look like the sample below mine looks weird. Thanks!
#include
int main() { char user_gender, user_smoker; string user_eyecolor; int user_minAge, user_maxAge, user_minHeight, user_maxHeight;
cout > user_gender;
cout > user_minAge;
cout > user_maxAge;
cout > user_minHeight;
cout > user_maxHeight;
cout > user_smoker;
cout > user_eyecolor;
cout
cout
//Now read the file data. ifstream fin("records.txt");
if (fin.is_open()) { while (!fin.eof()) { string firstname, lastname, eyecolor, phoneno; char gender, smoker; int age, height; fin >> firstname >> lastname >> gender >> age >> height >> smoker >> eyecolor >> phoneno;
if (gender == user_gender) { countGender++;
//Now check to see if the age and height are between the maximum and minum preferences. if ((age >= user_minAge && age = user_minHeight && height
//Then check to see if the smoking preference and eye color are also a match. if (user_smoker == smoker && user_eyecolor == eyecolor) { fullMatch++;
cout
else if (eyecolor == user_eyecolor) { partialMatch++;
cout
fin.close(); } else { cout
return 0; }
I keep getting this:
It should like look this:
[:: Microsoft Visual Studio Debug Console What is the gender of your ideal match (M,F,N) ? M What is the minimum age? 20 What is the maximum age? 90 What is the minimum height (in inches)? 40 What is the maximum height (in inches)? 100 Smoker (Y/N) ? N What is the eyecolor (Blue, Green, Grey, Brown)? Brown Sample Output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started