Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am working on a C program and one specific function is confusing me. The proce

ID: 3604570 • Letter: I

Question

I am working on a C program and one specific function is confusing me. The processBookCommand function consists of 2 subcommands "CHANGE" and "SHOW." Based on the subcommands, "CHANGE" will change the 2 float values associated with a line in an array and "SHOW" will let the new changes be seen in a new printout of the total array. I have included the picture of the output of bookcommands and it shows one Book id XXXXXX001 which is a faulty Id to associate with an error message. But the JAVADD Id is valid and needs to be changed and updated in the new printout of the array. Also, I included my code so far for the processBookCommand function. Also, a binary search function is used to find a Book Id and if it returns -1 the book is not found and if it returns >=0 the book is found and can begin processing the book commands.

The images are here.

https://imgur.com/a/Ic0n4

Explanation / Answer

Ans:For this error,in processBookCommand function we have to call change function with different parameters to create instance and assign values sothat the object can instantiate the values of class.Example: for book class we need to pass object of that class and retrieve book id,name etc and display in show method by passing as parameter in show function.In search function also we need to send the bookid to get the details.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote