Q2) Write a python program that uses processes to edits a global variable. Your program should have: (8 Marks) • The glo

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

Q2) Write a python program that uses processes to edits a global variable. Your program should have: (8 Marks) • The glo

Post by answerhappygod »

Q2 Write A Python Program That Uses Processes To Edits A Global Variable Your Program Should Have 8 Marks The Glo 1
Q2 Write A Python Program That Uses Processes To Edits A Global Variable Your Program Should Have 8 Marks The Glo 1 (78.76 KiB) Viewed 18 times
Q2) Write a python program that uses processes to edits a global variable. Your program should have: (8 Marks) • The global variable: "account_balance" • The function "deposit_balance(amount)" which takes "amount" as a float parameter, and adds it to the global variable "account_balance". The function "withdraw_balance(amount)" which takes "amount" as a float parameter, and withdraws it from the global variable "account_balance". • Two processes that invoke the two functions above. Note that "amount" should be entered by the user and passed to the processes. • Make sure that the data is consistent (Use a proper lock on the variable).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply