[Solved] Variables and Assignment statements [closed]


Outside of the fact that you should probably be using an IDE to easily identify your mistakes…. Semi colon on main method, missing brackets, invalid variable types, etc.

All you have is two arrays with one string value each.

char stndCst[] = {"(sqftbrm + sqftdrm +sqfthal + sqftgrm + sqftstr)"/5};

char wtAvg[] = {"sqftbrm*bf" + "sqftdrm*df" + "sqfthal*hf" + "sqftgrm*gf" + "sqftstr*sf"} ;

If you want to do math with some variables, then remove the quotes.

For example,

double stndCst = (sqftbrm + sqftdrm +sqfthal + sqftgrm + sqftstr) / 5.0;

double wtAvg = sqftbrm*bf + sqftdrm*df + sqfthal*hf + sqftgrm*gf + sqftstr*sf ;

13

solved Variables and Assignment statements [closed]