Data Type Chooser Program

 

You have already been given a flow chart of how you can choose the best data type for a variable.  Using the IF structure, you can write a program that helps make this choice easier. 

 

In this program, the user should answer a series of yes/no questions about the data being stored.  Eventually, the program should give the best data to choose for the program.

 

Refer to the flow chart for the series of questions you will need to ask.  The first question should always be, “Could the stored data EVER be a decimal number.”

 

The user should answer either Y or N.  (Use char data type for their response.)  If the user answers Y, they are sent in the float direction.  If they answer N, they are sent in the integer type direction.  Their next question will have something to do with either digit precision (floats) or size of number (integers). 

 

Continue with this process until you can make a determination of which data type is most appropriate.  You will need to use nested IF structures.