Question#4: Write a small program that has the "account_balance" as a global variable and the function "add_balance{floa

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

Question#4: Write a small program that has the "account_balance" as a global variable and the function "add_balance{floa

Post by answerhappygod »

Question 4 Write A Small Program That Has The Account Balance As A Global Variable And The Function Add Balance Floa 1
Question 4 Write A Small Program That Has The Account Balance As A Global Variable And The Function Add Balance Floa 1 (15.19 KiB) Viewed 21 times
paython language
Question#4: Write a small program that has the "account_balance" as a global variable and the function "add_balance{float amount)". The function reads the current balance value, adds an amount to it (which is entered by the user) and writes the new value to the balance variable. After that create 2 threads which will invoke the add_balance(float amount) function and add different values, Run the program and 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