السلام عليكم ورحمة الله وبركاته
لدي اسايمنت طلبو مننا الدكتور لكن للاسف انا بدات متاخر في الدراسة فللاسف ماعندي معلومات كفاية لحل الاسايمنت
ارشدني احد الاصدقاء لهذا المنتدى على امل انكم راح تساعدوني في محنتي
الاسايمنت عبارة عن 4 برامج بلغة C++
البرنامج اللي نستخدمه في كتابة الاكواد Crimson Editor
والكومبايلر G++
اما بالنسبة للاسايمنت انا قرات الربعة البرامج وقدرت القسمها واحللها لكن ماعرفت اكمل الباقي
انا بكتبلكم البرامج المطلوبة مع التحليل اللي سويته ما ادري ان صح ولا لا
وياريت تساعدوني في كتابة الاكواد موعد تسليم الاسايمنت يوم الخميس واختبار المادة يوم الجمعة
للاسف الوقت مرة قريب يادوب ادرس للاختبار
انا اليوم سجلت في الموقع وشفت مواضيع وكتب ودروس كثيرة ماشاء الله المنتدى مررة عجبني وراح استمر على تصفح الموقع وقراءة الدروس الموجودة كلها باذن الله
===============
Question 1 (5 marks)
Write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity. The program will read in the maximum room capacity and the number of people to attend the meeting. If the number of people is less than or equal to the maximum room capacity, the program announces that it is legal to hold the meeting and tells how many additional people may legally attend. If the number of people exceeds the maximum room capacity, the program announces that the meeting cannot be held as planned due to fire regulations and tells how many people must be excluded in order to meet the fire regulations.
عندنا غرفة اجتماعات ونود معرفة قانون الحريق
ونود معرفة كحد اقصى لعدد الاشخاص
مدخلات = سعة غرفة الاجتماعات وعدد الاشخاص اللي يحضرون الاجتماع
المخرجات = نتيجة مسموح لعقد الاجتماع اولا
التحليل : 1) اذا كان عدد الاشخاص اقل من او يساوي لسعة الغرفة
اذن يعطي نتيجة مسموح لعقد الاجتماع وكم شخص ممكن ينضافوا الى الاجتماع
2) اذا كان عدد الاشخاص اكثرمن سعة الغرفة
اذن يعطي نتيجة غير مسموح لعقد الاجتماع وكم شخص ممكن يستبعدوا من الاجتماع
Question 2 (5 marks)
Write a program that asks the user to enter a number of seconds
- There are 86400 seconds in a day. If the number of seconds entered by the user is greater than or equal to 86400, the program should display the number of days in that many seconds.
- There are 3600 seconds in an hour. If the number of seconds entered by the user is less than 86400, but is greater than or equal to 3600, the program should display the number of hours in that many seconds.
- There are 60 seconds in a minute. If the number of seconds entered by the user is less than 3600, but is greater than or equal to 60, the program should display the number of minutes in that many seconds.
المدخلات = عدد الثواني
المخرجات = تحديد كم عدد الايام او الساعات او الدقائق من الثواني
بشرط
اليوم = 86400 ثانية ، اذا كان الرقم المدخل اكبر او يساوي 86400 سوف تظهر كم عدد الايام
الساعة =3600 ثانية اذا كان الرقم المدخل اقل من86400 ولكن اكبر اويساوي 3600سوف تظهر كم عدد الساعات
الدقيقة = 60 ثانية اذا كان الرقم المدخل اقل من 3600 ولكن اكبر من اويساوي 60 سوف تظهر كم عدد الدقائق
Question 3 (5 marks)
Assuming the level of the Earth’s oceans is currently rising at about 1.5 millimetres per year; write a program that displays a table showing the total number of millimetres that the oceans will have risen each year for the next 25 years.
افترض انه مستوى محيطات الارض تغرق بمعدل 1.5 مل في السنة
المخرجات السنة الاولى * 1.5
السنة الثانية = مجموع السنة الاولى * 1.5
السنة الثالثة = مجموع الثانية * 1.5
.
.
.
.
.
وهكذا
Question 4 (5 marks)
In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:
KE = ½ mv2
The variables in the formula are as follows: KE is the kinetic energy in joules, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second.
Write a function named kineticEnergy that accepts an object’s mass (in kilogram) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Demonstrate the function by calling it in a program that asks the user to enter values for mass and velocity. >
برنامج تستخدم المعادلة اللي فوق
المدخلات الحجم وحاجة ثانية ما اعرف معناها في الفيزياء
والمخرجات KE
============================
اتمنى منكم المساعدة العاجلة
أخوكم \ أحمد
