منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : كيفية حساب راتب العامل بلغة C++
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم و رحمة الله و بركاته
هل هذا الكود صحيح حسب هذا السؤال : و إذا كان هناك اي خطأ يرجى التصحيح مع الشكر

Write a program that asks the user to the number of hours an employee worked and his hourly wage, computes his weekly pay. Count any hours over 40 as overtime at time-and-a-half


Win32 console

PHP كود :
#include <iostream>
using namespace std;

int main()
{
    
double Hours,h_wage,Over_Time,Over_Time_Pay,Reg_Pay //   variables
    
cout << "kindelly enter the number of hours an employee worked: " << endl;
    
cin >> Hours// inputs from user
    
cout << "Please enter the hourly wage:  " << endl;
    
cin >> h_wage// inputs from user
    
Over_Time Hours 40;
    
Over_Time_Pay Over_Time h_wage 1.5;
    
Reg_Pay 40 h_wage;
    if (
Hours 40)
    {
        
cout <<  "Total of weekly pay:  " << Over_Time_Pay Reg_Pay << endl;
    }
    else 
    {
        
cout << "Total of weekly pay:  " << Hours h_wage << endl;
    }
    
    return 
0;


2.12.0.0
2.12.0.0
2.12.0.0
2.12.0.0
2.12.0.0
تم التأكد من الكود