Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 #include #include #include using namespace std;

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:

image text in transcribed

It should like look this:

image text in transcribed

[:: 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions

Question

Distinguish among a union shop, a closed shop, and an agency shop.

Answered: 1 week ago