// room_service.c // // Written by YOUR-NAME (YOUR-ZID) // on TODAYS-DATE // // Delivers snacks to Sasha's and Henry's hotel rooms. // // This program should scan in a number of snacks to deliver to Sasha and // a number of snacks to deliver to Henry, add them to the correct rooms, // then print how many snacks are in each room. // // However, this program has a bug! Find and fix it so it works as // intended. #include // Deliver num_snacks snacks to a room. void deliver(int room, int num_snacks) { room += num_snacks; } int main(void) { int sashas_room = 2; int henrys_room = 4; int num_snacks_for_sasha; int num_snacks_for_henry; printf("Enter the number of snacks to deliver to Sasha's room: "); scanf("%d", &num_snacks_for_sasha); printf("Enter the number of snacks to deliver to Henry's room: "); scanf("%d", &num_snacks_for_henry); deliver(sashas_room, num_snacks_for_sasha); deliver(henrys_room, num_snacks_for_henry); printf("Sasha's room now has %d snacks.\n", sashas_room); printf("Henry's room now has %d snacks.\n", henrys_room); return 0; }