I am writing a tax calculation program for class and am having trouble with two parts.
One: My output is being displayed in scientific notation, and I would like it not to be.
Two: One of my values is not showing the same return as the sample solution. Any direction would be greatly appreciated.
By putting a green check on your post you are telling everyone that you have an answer and are finished. I believe that you can use the "edit" button to change the icon.
Next "double" is the preferred floating point type these days. It is more accurate than the "float".
For your output include the header file "iomanip" and put this before your output: std::cout << std::fixed << std::showpoint << std::setprecision(2);. This only needs to be done once. "showpoint" will print ".00" if it appears. The number in "setprecision" is the number of decimal places that will print.
One of my values is not showing the same return as the sample solution.
So where is the sample data that you are looking at? Do not expect everyone to immediately know which calculation is incorrect. Those who work with calculations like this may see the problem the rest will need some idea about what is wrong, i.e., point out which calculation is not giving the right answer.