A new popular app tracks the activities performed by its users and grants them rewards based on each individual's total activities performed in a year. This data is maintained in a database table (activitesinfo), with the following columns: userid, totalactivities, reward. This year, due to fundraising activity, the company has decided to further reward its users by enhancing the reward as per the following formula: If reward < = 4000, increase it by 2%, If 4000 < reward <= 8000, increase it by 4%, If reward > 8000, increase it by 6%.
The tech team has written three different scripts to calculate increment for each slab, each script is to run as a separate transaction. Here are the three scripts: