Subject Code : IPC144
Assignment Task :

Introduction 

In this assignment, you are asked to examine and debug a piece of code which is near completion. You  can download the code for the project from: 

The code in the project reads the information for an entry in an address book application. All of the  information is stored in structs, declared in the file contacts.h. The file contacts.c provides functions  which aid in the reading of the data. The main function is in a1ms4.c and directs the operation of the  other functions. Once you have downloaded the code, spend some time reading it over so that you get a good understanding of it. 

 

In order to find the bugs in the program, you will need to use the debugging techniques  described in the notes and might need to use different test data to help you locate the bugs.  After you have located and fixed the bugs in the program, you should complete the reflection and  submit your work (the fixed source code files and reflect.txt file) as detailed below. The reflection  represents the majority of the marks for the assignment and therefore should be written  carefully and thoughtfully. You should expect to write 300 – 500 words to properly address the  reflections. They should be written in a text document called reflect.txt. 

Reflections (60%) 

1. For each of the bugs you corrected in the code, write the original code and the corrected code and then explain what was wrong and how you corrected it. 

2. The Contact struct contains other structs embedded within it. Explain how this looks when the  data is laid out in memory. 

3. The code in contacts.c contains some repetition of the same code several times. Can you  identify the repeated code and design a function to replace it? Show the prototype for the  function you designed and explain its purpose, the parameters it requires and what it will  return. 

4. There are several places in the code where the scanf format strings end with “%*c”. Explain  what this does and why it needs to be there. 

5. Most of the strings are read with the format code “%[^\n]”. Explain why this is used and why  “%s” cannot be used in these situations.

 

This Computer Science Assignment has been solved by our Computer Science Experts at UniLearnO. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Eureka! You've stumped our genius minds (for now)! This exciting new question has our experts buzzing with curiosity. We can't wait to craft a fresh solution just for you!

  • Uploaded By : Grace
  • Posted on : November 19th, 2018

Whatsapp Tap to ChatGet instant assistance