Ugh.
Please indent your code and use [co
de][/code] tags.
First:
1 2 3
|
#include "stdafx.h"
#include "iomanip"
#include "iostream"
|
For header files that are in the include directory of the compiler, you need to use <angular brackets>:
#include <iostream>
, not "quotation marks". You can also turn off precompiled headers or just create an empty project or something like that (I usually just tell it not to use them).
After fixing that, it compiled for me. When I type in 'I' at over 5 years, I got $2400. Here's where I think you went wrong:
if ((Member_Type = 'F') && (Years >= 3))
a)
if (var == val)
A single = sign signifies assignment, double == is a conditional operator. That is what you should use (someone already covered this, but I'm really slow at typing, so I have to reload the page after typing this all out to see if someone beat me to something, so I will give nano511 the credit here)
b) You never tell it anything else, you merely check to see if it is a family or not, then give one of two values, as opposed to the four that you give at the start.
You also fail to ensure that the user enters 'I' or 'F'. If I type in 'r' at one year, I get $2400.
There are more issues (nano511 covered some and I'll let him/ her cover the global variable/ function argument thing), but I really think you should try and figure it out, that's usually the best part (for me), sitting down and hammering out why it won't work. It's also better to learn how to solve problems on your own, especially if you plan on making a living doing it (any field of work, computers, the automotive industry, carpentry, plumbing etc...). Otherwise your boss will laugh at how useless you are and fire your ass. Try compiling it, read (and understand to the best of your ability) the compiler errors and warning, find what is causing the error/ warning (I try to avoid VC like the plague (personal preference), but there should be a thing at the bottom with the warnings and such and if you click on the message, it should, doesn't mean it will, but it should take you to that line in the source).