الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

[ مخالف ] ممكن المساعدة بس

مغلق
بدأه احمد رشوان في 7 ديسمبر 2007 · 3 رد · 562 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

في برنامج انا حليته بس في طلب لسه وهو انو البرنامج فكرته انو في عنا عامل اذا اشتغل 40 ساعة قيمة الساعة 10$

واذا اشتغل اقل من اربعين قيمة الساعة 9$

هدول حليتهم

المطلوب المهم

اذا اشتغل اكتر من 40 ساعة نحسب الاربعين ساعة الاولى ب40$ والساعات الاضافية ب15$ للساعة

احترامي

MATRIX

#2

هات محاولاتك هنا وسنساعد بالباقي ..

banner_60_468.gif

NOTHING IS IMPOSSIBLE

#3

هاي البرنامج

#include <iostream.h>

void main(void)

{

int choice, hours,charges;

cout << "1. He work 40 hour.(hour=10$)\n";

cout << "2. He work above 40 hour.(hour=15$)\n";

cout << "3. He work lower 40 hour.(hour=9$)\n";

cout << "4. Quit the Program\n\n";

cout << "Enter your choice: ";

cin >> choice;

cout.setf(ios::fixed | ios::showpoint);

cout.precision(2);

if (choice == 1)

{

cout << "\nFor how many hours? ";

cin >> hours;

charges =hours * 10.00;

cout << "The total charges are {:content:}quot; << charges << endl;

}

else if (choice == 2)

{

cout << "\nFor how many hours? ";

cin >> hours;

charges = hours * 15.00;

cout << "The total charges are {:content:}quot; << charges << endl;

}

else if (choice == 3)

{

cout << "\nFor how many hours? ";

cin >> hours;

charges = hours * 9.00;

cout << "The total charges are {:content:}quot; << charges << endl;

}

else if (choice != 4)

{

cout << "The valid choices are 1 through 4. Run the\n";

cout << "program again and select one of those.\n";

}

}

بدي اياه في الاختيار التاني يحسب الساعات الى بعد الاربعين بس ب15$ والاربعين ب10$

ياريت المساعدة بسرعة

تم تعديل هذه المشاركة بواسطة احمد رشوان في 7 ديسمبر 2007 في 23:13

MATRIX

#4
#include "stdafx.h"
 #include <iostream>
 using namespace std; 

 void main(void)
 {
 int choice, hours,charges;
 cout << "1. He work 40 hour.(hour=10$)\n";
 cout << "2. He work above 40 hour.(hour=15$)\n";
 cout << "3. He work lower 40 hour.(hour=9$)\n";
 cout << "4. Quit the Program\n\n";
 cout << "Enter your choice: ";

 cin >> choice;
 cout.setf(ios::fixed | ios::showpoint);
 cout.precision(2);
 cout << "\nFor how many hours? ";
 cin >> hours;
 int price;

 switch(choice)
 { case 1: price=10; break;
   case 2: price=15; break;
   case 3: price=9; break;
   case 4: cout << "The valid choices are 1 through 4. Run the\n"; break;}

   charges = hours*price;  
   cout << "The total charges in $ are: " << charges << endl;
   system("PAUSE");
 }

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…