We don't know what the instructions are. It looks like the values for fifth and sixth are swapped. Maybe you should change the order you read fifth and sixth from cin?
Thank you Peter! That helped out with the values not being the same, but I still have a negative value on line five when the instructor's value is positive.
My first thought was to use abs() but that is not output manipulation and the answer value will be negative sometimes (since first -> sixth are not fixed numbers)
It's also is giving me the output of the internal manipulator being used when internal is not being used on the line.
It's also is giving me the output of the internal manipulator being used when internal is not being used on the line.
It doesn't matter if you do it on the same line/statement. cout is an object and remembers everything you have previously done. If you have told it to use internal it will use it until you tell it otherwise.
We are not that far into the class. I looked on the Cplusplus internal manipulator page to see what I forgot to insert, but it did not show any type of closing statement or bracket.
How do you make the internal operator exclusive to one line?
How do you make the internal operator exclusive to one line?
There is no way to do that, as there is no difference between outputting everything on same line or different lines. All manipulators are pessitent except odd setw() one. You need to pass different manipulator which will cancel std::internal. It seems that you need std::right here.
To understand why lines are not relevant you should know that << is a binary operator (just like + and *). It takes two arguments and return something.
The first argument is the stream object, in this case cout. The second argument can be a number of things (strings, numbers, manipulator functions). The return value is a reference to the first argument and this is what makes it possible to chain multiple << in the same statement.
Small example:
cout << a << b << endl;
This line of code could be written as (((cout << a) << b) << endl);
First thing to run is (cout << a), which outputs a and returns a reference to cout.
This leaves us with ((cout << b) << endl).
Second thing to run is (cout << b), which outputs b and returns a reference to cout.
This leaves us with (cout << endl) and it's the last thing that happens.