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

[مخالف - طلب حل : ]مجموعة اسئلة عجزت ايجاد حلّها . . ارجو المساعدة . .

مغلق
بدأه haia في 8 مايو 2009 · 5 رد · 511 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Write a program to read a score and assign a grade based on the following table:

picjpgaea0c.jpg

Your program, in addition to the main function, must contain the following functions:

- A logical function wrongScore that receives a score and returns 1 if it is outside the range i.e. less than 0 or greater than 100. If the score is within the range, it will return 0.

- A function getScore that, using do-while and a call to the function wrongScore, will keep reading the score from the user until he enters a correct score. The correct score will be returned by the function.

- A function assignGrade that receives a score and returns a grade (A or B or C or D or F).

A sample execution of the program is shown below:

picjpgf5cd9.jpg

Question 2: (30 points)

Write a program that uses Taylor series expansion to compute picjpga1a22.jpg as shown below:

picjpgdd7fd.jpg

Write a function taylorexp to compute the approximate value of picjpga1a22.jpg based on 2 input arguments; the value of x and the number of terms to include in the summation.

In the main function, your program will use a loop to compute the approximate value of picjpga1a22.jpg by calling taylorexp. The loop will stop when the percentage error is less than 0.1 percent.

picjpgd1541.jpg

The factorial can be computed in the loop or use the factorial function defined in the slides but make the rerun type double or long.

A sample run of your program is shown below:

picjpgda994.jpg

Question 3: (40 points)

Create a text file "observations.txt" to contain an unknown number of observations (in floating point), then write a program that uses a function named 'statistics' which takes the address of "observations.txt" as an input and returns 4 values; the max, min, count, and range of these observations.

From the main function, print all returned values on the screen.

Note: range = max – min

Read the first value before the loop and initialize your max, and min variables with this first value. Then while you read the remaining values, update you max variable once you find a new value larger than your max and update your min variable once you find a new value smaller than your min.

بـ صراحة حاولت بـ الاول عدة محاولات لكن للاسف ماعرفت طريقة عمل الفانكشن ! . . والسؤال الثاني لم افهم فكرته . . اما الثالث فـ لا اعرف من الاساس كيفية فتح ملف txt من C++ . .

وشاكر لكم ومقدر . .

#2

شباب بليز ياليت تشوفون لي الحل سريعاً :{ . .

#3

تم حل السؤال الاول .. بحمد الله وعونه ..

واخفقت بالبقيه .. شكرا لمن سـ يمر من هنا .. !

كما اتمنى منكم المساعده ..

#4

up

#5

up

#6

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته.

مرحباً بكم في منتدى الفريق العربي للبرمجة

تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات، فقرة طلب حل الواجبات والتمارين.

قواعد طرح المشاركات

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

llback.jpg

اشهد ان لا إله إلا الله وان محمدا ً رسول الله

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

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

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

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

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

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