Help with Function Program

1. Opens a file called \input.txt"
2. It’ll read in a string and up to two numbers.
3. Based on what the string is, you’ll add, subtract, multiply, divide, or
convert the number from decimal to binary.
4. For the add, subtract, multiply, and divide functions, you’ll be return
ing a value from the function and only passing by value (This takes in
two numbers).
5. For the convert function, you’ll be passing by reference (This takes in
one number from the file.

the contents of input.txt are as follows:
add 6 2
subtract 8 1
convert 29
multiply 8 7
convert 82
multiply 7 7
multiply 7 7
divide 3 1

any help would be greatly appreciated. I guess im supposed to just read from the file, as opposed to having the user type in the values, and do what each line says. so for example I want to know how to read one line from the file and based on the first word or string use a particular function.
Violentpasta could you post what you have done so far?
Topic archived. No new replies allowed.