This programming assignment will test your ability to design an algorithm to solve the

following problem and to implement your algorithm in an efficient C++ program, including

proper program documentation.

Angles are often measured in degrees ( ° ), minutes ( ' ), and seconds ( " ). There are 360 degrees

in a circle, 60 minutes in one degree, and 60 seconds in one minute. Design an algorithm to read

two angular measurements given in degrees, minutes, and seconds and then calculate and print

out their sum. Repeat this four times to do the following computations:

74° 29' 13" + 105° 8' 16" = 179° 37' 29"

7° 14' 55" + 5° 24' 55" = 12° 39' 50"

20° 31' 19" + 0° 31' 30" = 21° 2' 49"

122° 17' 48" + 237° 42' 12" = 0° 0' 0"

Use an input file (MyData.dat) that contains the values of the angular measurements given in

the above examples and print out their sums into an output file (MyOutput.txt) in the same

format as shown in the examples above.

now I did the first part... but the second part which is the file thing.. I have great defect in this part "the fstream part".. so can anyone help please... thank you...

following problem and to implement your algorithm in an efficient C++ program, including

proper program documentation.

Angles are often measured in degrees ( ° ), minutes ( ' ), and seconds ( " ). There are 360 degrees

in a circle, 60 minutes in one degree, and 60 seconds in one minute. Design an algorithm to read

two angular measurements given in degrees, minutes, and seconds and then calculate and print

out their sum. Repeat this four times to do the following computations:

74° 29' 13" + 105° 8' 16" = 179° 37' 29"

7° 14' 55" + 5° 24' 55" = 12° 39' 50"

20° 31' 19" + 0° 31' 30" = 21° 2' 49"

122° 17' 48" + 237° 42' 12" = 0° 0' 0"

Use an input file (MyData.dat) that contains the values of the angular measurements given in

the above examples and print out their sums into an output file (MyOutput.txt) in the same

format as shown in the examples above.

now I did the first part... but the second part which is the file thing.. I have great defect in this part "the fstream part".. so can anyone help please... thank you...

Topic archived. No new replies allowed.