Course list http://www.c-jump.com/bcc/
In this assignment you write a GUI application that converts Radians to Degrees and back:
The Trigonometry handout provides sample code and formulas that you might find helpful. Alternatively, it is okay to search for samples on the internet, but please be sure to reference your sources in the program comments.
Use Lab 4 as the starting point for your project. Make a copy of the project and rename it as Hwk_02_radians. Use FLUID to design the user interface. Add callback functions for your buttons to implement the conversions and display results.
You must use double data type when computing the values in your formulas.
Use std::stringstream to convert from character data to double and vice-versa. The following sample demonstrates this kind of data manipulation:
#include <iostream> #include <string> #include <sstream> #define PI 3.14159265 double string_2_double( std::string const& str ) { std::stringstream buffer( str ); double value = 0.0; buffer >> value; return value; } std::string double_2_string( double dbl ) { std::stringstream buffer; buffer << dbl; return buffer.str(); } // Use standard main to have console background: int main() { for (;;) { std::cout << "Enter a number to convert degrees and radians: "; std::string str_input; std::cin >> str_input; double degrees = string_2_double( str_input ); double radians = degrees * PI / 180; std::cout << degrees << " degrees == " << double_2_string( radians ) << " radians\n"; } }
You must submit the entire project in a single ZIP file.
Importtant! Before creating your ZIP archive:
Delete Debug, Release, and ipch subfolders.
Delete the .SDF file.
Log on to CIS-255 online
On the Main Menu, follow the link to Submit Homework, select Project 2: Radian-degree conversion app, and upload your file.
Note: the system will display an 8-digit confirmation number once the file is successfully uploaded. You can save the confirmation number for your own records, but this is not a required step and no further action is needed on your part.