تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
كيفية حساب راتب العامل بلغة C++
#1
السلام عليكم و رحمة الله و بركاته
هل هذا الكود صحيح حسب هذا السؤال : و إذا كان هناك اي خطأ يرجى التصحيح مع الشكر

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
الرد }}}
تم الشكر بواسطة:
#2
تم التأكد من الكود
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم