The first line of an input file, called tons.txt, only contains a single number between 1 and 9.

Write a C++ program to input the number of tons from the input file

and print out the equivalent in pounds, ounces, kilograms, and grams, to an output file, called report.txt.

Also, print out the conversion factors to the output file.

You create the input file (tons.txt) to contain a single, positive integer less than 10.

The output file is created by running your program.

Recommended Answers

All 3 Replies

Can you please show us what you have tried so far to do this homework problem and exactly where you are stuck or confused?

I see you posted an attached file that has a screenshot of the first bit of your code. Can you post the entire thing please? You can use the code button in the wysiwyg editor (to the right of italic, third button from the left).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.