Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am currently using c++ coding on xcode. Every time I try to run the program, it says linker command failed with exit code 1

I am currently using c++ coding on xcode. Every time I try to run the program, it says "linker command failed with exit code 1" and "unused variable 'result' ". I'm not sure what is wrong with what I am inputting.

#include

#define fiveFeetinInches 60

using namespace std;

int main()

{

int result, feet = 0, inches = 0, maleWeight, femaleWeight, totalInches ;

cout << "Please enter your height in feet and inches on separate lines. For Example: " << endl << "5" << endl << "3 " << endl;

cin >> feet;

cin >> inches;

totalInches = (feet * 12) + inches;

femaleWeight = ((totalInches - fiveFeetinInches) * 5) + 100;

maleWeight = ((totalInches - fiveFeetinInches) * 6) + 106;

cout << "Ideal Weight for Female of Height " << feet << "'" << inches << "\" : " << femaleWeight << endl;

cout << "Ideal Weight for Male of Height " << feet << "'" << inches << "\" :" << maleWeight << endl;

system("pause");

return 0;

}

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions