Hey
I've started to learn c++ using "C++ Primer by Stephen Prate" and I'm currently trying to complete one of the exercises. I am wondering if I should declare arc_to_minute & arc_to_degree as float or cast them as float as I've done already. Any tips welcome!
#include <iostream>
int main()
{
using namespace std;
cout.setf(ios_base::fixed, ios_base::floatfield);
const int arc_to_minute = 60;
const int arc_to_degree = 60;
float degrees;
float minutes;
int seconds;
cout << "Degrees: ";
cin >> degrees;
cout << "Minutes: ";
cin >> minutes;
cout << "Seconds: ";
cin >> seconds;
//convert seconds to minutes and add
minutes = minutes + seconds / float (arc_to_minute);
//covert minutes to degrees and add
degrees = degrees + minutes / float (arc_to_degree);
cout << degrees;
}