I am brand new to coding and am trying to learn it myself, Im a business major thinking about switching to computer science, I am stuck with an basic if else statement. if i input 10 hours for example, i get a huge number like 10 characters long. I dont know where i am messing up.
#include <iostream>
#include <string>
usingnamespace std;
int main ( )
{
double salary, rate, hours;
int keep_going;
cout << "how many hours you work driving this week?\n";
cin >> hours;
rate = '10.00';
if (hours > 40)
salary = (2 * rate * hours)
else
salary = (rate * hours);
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout << " god damnnnn. you made $" << salary << " dollers this week.\n";
cin >> keep_going; // added just so the program doesnt automatically close without output.
I think that is the error. because i am gettting a huge number for the answer. it does however compile though. How would i set it so the rate is equal to $10 ?