مرحبا شباب
لقد قمت بكتابة هذا البرنامج, والذي يقوم بتخييرك بين حساب مساحة مستطيل أو مساحة مثلث, ثم يعطيك النتيجة, و إذا قمت بإدخال أي خيار آخر, يخبرك بأن العملية غير موجودة...
لكن أنا لا أعلم أين أضع الأقواس الخاصة بـ "if statements"
ذهبت لمنتدى إنجليزي, ولكنهم لم يقدموا المساعده, بل إكتفوا بالإستهزاء و الكلام الفارغ.
فأتمنى منكم المساعده الفعليه, مع الشرح البسيط لو سمحتم, و شكرا لكم مقدما!
ملاحظة: حتى ترى الكود بالطريقة الصحيحه, قم بقصه و لصقه في الكومبايلر.كود:#include <iostream> #include <cstdlib> using namespace std; int main() { int choice, width, length, RecArea, base, hight, TriArea; float h; cout << " Area Calculator\n (Beta Version)\n\n" << endl; cout << "The available operations are:\n" << endl; cout << "1.Rectangle Area." << endl; cout << "2.Cirlce Area.\n" << endl; cout << "Please enter the operation number:"; cin >> choice; if (choice == 1) cout << "\nPlease enter width:"; cin >> width; cout << "\nPlease enter length:"; cin >> length; RecArea = (width * length); cout << "\nThe rectangle area is:" << RecArea << endl; if (choice == 2) cout << "How many cm's is the base?:" << endl; cin >> base; cout << "How high is the triangle?:" << endl; cin >> hight; TriArea = (0.5 * base * hight); cout << "The triangle area is:" << TriArea << endl; else cout << "That operation is not available!" << endl; system ("pause"); return 0; }






























