What's new

Closed Confused on what to do. [using if else]

Status
Not open for further replies.

-CLAY-

Honorary Poster
Joined
Jun 29, 2018
Posts
133
Reaction
304
Points
165
Di ko po kasi mapalabas yung computation palaging 0 lumalabas
Here is my code.

#include <iostream>

using namespace std;

int main() {
double wages;
double workinghours;
double rate;
cout << "Enter an working hours: ";
cin >> workinghours;

if (workinghours < 40)
{
wages = (rate * 40)+(1.5*rate)*(workinghours-40);
cout<<"Your wages is: " << wages << endl;

}
else if ( workinghours > 40) {
wages = rate*workinghours;
cout << "Your wages is: " << wages << endl;
}
}
 

Attachments

not sure if naresolve mo na yan, pero pano kung ilagay ko e saktong 40 hehe, like workinghours==40? less and greater than 40 lang ang conditions mo e.
 
Status
Not open for further replies.

Similar threads

Back
Top