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

Status
Not open for further replies.

-CLAY-

Fanatic
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

  • received_327261264700130.webp
    received_327261264700130.webp
    48.4 KB · Views: 35
  • received_1983319858378138.webp
    received_1983319858378138.webp
    48.1 KB · Views: 19
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.

About this Thread

  • 5
    Replies
  • 692
    Views
  • 4
    Participants
Last reply from:
Matsiako_07

Trending Topics

Online now

Members online
354
Guests online
608
Total visitors
962

Forum statistics

Threads
2,279,398
Posts
28,990,462
Members
1,226,869
Latest member
Owengheart
Back
Top