Q2) Write a python program that uses processes to edits a global variable. Your program should have: (8 Marks) • The glo
-
answerhappygod
- Site Admin
- Posts: 899604
- 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
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!