. Threading question Create a typedef data struct called student that has the following members: Char[15] first name . •

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

. Threading question Create a typedef data struct called student that has the following members: Char[15] first name . •

Post by answerhappygod »

Threading Question Create A Typedef Data Struct Called Student That Has The Following Members Char 15 First Name 1
Threading Question Create A Typedef Data Struct Called Student That Has The Following Members Char 15 First Name 1 (68.68 KiB) Viewed 37 times
. Threading question Create a typedef data struct called student that has the following members: Char[15] first name . • Char[15] last name double money owed Created two student structs with the following initial values: first_name = Tommy, last_name = Douglas, money_owed = 0; first_name = Willie, last_name = O'Ree, money owed = 0; Create two routines called credit tuition and debit tuition that take the student struct and debit or credit 3000.00 to the money owed variable. Add a mutex lock around the code in both routines to prevent access to the student struct. • Write code to debit and credit both students 3000.00 and output the money owed by each student after transactions with their names student probleMLC > ... 1 #include <pthread.h> 2 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> 3 4 5 9 10 11 12 13 14 15 16 17 18 typedef struct Student { 21 22 23 24 25 26 27 student; void credit tuition(void *opt) ( 19 } 20 void debit_tuition(void *opt) { } int main(int argc, char argv[]) { }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply