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

[مخالف - طلب حل : ]Write A (c++) Program Using The Fork() System Call That That Compute The Pi Value In The Child Process. The Accuracy Number To Compute The Value Will

مغلق
بدأه Eng alaa في 23 نوفمبر 2009 · 1 رد · 515 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

ارجو مساعدنكم بحل ال assinment،،

المطلوب حل السؤالين التاليين بلغة سي بلس بلس

Part-1

Write a program (C++) that has a parent and child process. The parent process forks the child, then calls a function which prints out the parent and child process id (with a tag indicating which pid is which). The parent then waits for the child to complete.

Once forked, the child calls a function which sleeps for a period of seconds where the sleep time in seconds is (command line) input as a startup parameter to the program (data sharing between parent and child). Once the child wakes up, it prints out the date (do not use system to do the date, but find the underlying OS system call) and terminates. The printout should delineate between parent and child.

Part-2

The PI value is computed as the series is:

PI = 4.0 - 4.0/3 + 4.0/5 – 4.0/7 + 4.0/9

Write a (C++) program using the fork() system call that that compute the PI value in the child process. The accuracy number to compute the value will be inputted from user .

The PI output will be output by the child process. Because the parent and child processes have their own copies of the data, it will be necessary for the child to output the value. Have the parent invoke the wait() call to wait for the child process to complete before exiting the program. Perform necessary error checking to ensure that a non-negative number is passed on the command line.

#2

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

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

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

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

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

/index.php?showtopic=29343

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

banner_60_468.gif

NOTHING IS IMPOSSIBLE

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

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