Can you please help me with this coding question and help me understand it. Koya has shared his bank account with Cookie

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Can you please help me with this coding question and help me understand it. Koya has shared his bank account with Cookie

Post by answerhappygod »

Can you please help me with this coding question and
help me understand it.
Koya has shared his bank account with Cookie, Chimmy and Tata in
Hobi Bank. The shared bank account has $1,000,000. Koya deposits
$250,000 while Cookie, Chimmy and Tata withdraws $50,000, $75,000
and $125,000 respectively. Write programs (parent and child) in C
to write into a shared file named test where Koya’s account balance
is stored. The parent program should create 4 child processes and
make each child process execute the child program. Each child
process will carry out each task as described above. The
program can be terminated when an interrupt signal is received
(^C). When this happens all child processes should be killed by the
parent and all the shared memory should be deallocated. Implement
the above using shared memory techniques. You can use shmctl(),
shmget(), shmat() and shmdt(). You are required to use fork or
execl, wait and exit. The parent and child processes should be
compiled separately. The executable could be called parent. The
program should be executed by ./parent .
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply