Write program that stores and retrieves structures in file

Assignment Help Programming Languages
Reference no: EM132253263

Intermediate Programming Assignment - Binary Files and Structures on Disk

The Problem - Your task is to write a program that stores and retrieves structures in a file on disk. The file of structures must remain on the disk once your program ends. You should be able to store structures to the file and retrieve from the file after restarting the program.

The record that you will be writing to file has the following structure:

struct contact {

unsigned long phone_number;

long first_name_posn;

long last_name_posn;

long company_name_posn;

long email_posn;

long next;

};

first_name_posn, last_name_posn, company_name_posn, and email_posn are the position in the file of the First Name, Last Name, Company Name, and Email variable strings. These "locations" will be required for writing and reading the information to be stored. This struct definition cannot be altered in any way.

When you write the structures on disk, you will need to store the First Name, Last Name, Company Name, and Email strings separately from the contact structure. In the file you will write the contact structure first followed by the First Name, Last Name, Company Name, and Email strings (if they exist). The only required information is the Phone Number - all other information is optional.

The position "next" stores the location in the file where the next contact record is stored. This will function similarly to a linked list data structure, but will use "next" variable to facilitate the linking of records.

The file can contain any number of records and associated strings. The name of the file will be myContactList.db (and must match this exactly). If the file does not exist then your program must create it.

Coding Guidelines and Testing -

Assignments which do not compile with your makefile on the SOCS server will receive a grade of 0. You must use the -ansi and -Wall flag.

Any changes to the struct definition will result in a grade of 0.

Your makefile must produce an executable named contactList. It must be placed inside the bin/folder. See the Project Structure section for more details.

Function prototypes and struct definitions are expected to be inside the .h files for your project, and function definitions must be in a file without a main() function (ie. you will need at minimum two .c files and at minimum one .h file).

Attachment:- Assignment Files.rar

Reference no: EM132253263

Questions Cloud

Skilled and unskilled and overall national share in steel : Explain Employment- skilled/unskilled and overall national share in Steel , Aluminium and Automobile ?
Replacing a hard drive on a desktop computer : What is the difference concerns between replacing a hard drive on a desktop computer vs a laptop computer?
Basic terms of object oriented programming : Explain, using basic terms of object oriented programming, the principles being applied for the simple code snippets we have been developing
Explore how you plan to alter the tone of your writing : Begin to explore how you plan to alter the tone of your writing so that it is less academic and more businesslike.
Write program that stores and retrieves structures in file : CIS2500 Intermediate Programming Assignment - Binary Files and Structures on Disk, University of Guelph, Canada. Write program that stores structures in file
Python statements for three math expressions : Then write three Python statements for the following three math expressions. Finally, calculate and print out the values of variables a, b, and c.
Prepare time-phased product structure : Prepare a time-phased product structure. How long does it take to Produce S? Construct a Materiel Requirements Plan (MRP) using the following on-hand inventory.
What is probability that stock will go up given percentage : An investment advisor recommends the purchase of shares in Infogenics, Inc as he expects that the stock of Infogenics would go up at least 20%.
Now that you''ve spent a little time with spreadsheets : Now that you've spent a little time with spreadsheets, can you think of how things were done before spreadsheets? What tools were used

Reviews

len2253263

3/11/2019 2:41:47 AM

Assignments which do not compile with your makefile on the SOCS server will receive a grade of 0. You must use the -ansi and -Wall flag. Any changes to the struct definition will result in a grade of 0. Your makefile must produce an executable named contactList. It must be placed inside the bin/ folder. See the Project Structure section for more details. Your submission must be named usernameA3.zip, where username is your Central ID. For example, if your username was rdara, you would submit a file name rdaraA3.zip.

len2253263

3/11/2019 2:41:26 AM

Sample inputs and expected output/binary file size will be posted within 1 week of the due date. No global variables will be allowed for this assignment. Usage of a global variable will result in an automatic zero for the assignment. Function prototypes and struct definitions are expected to be inside the .h files for your project, and function definitions must be in a file without a main() function (ie. you will need at minimum two .c files and at minimum one .h file)

len2253263

3/11/2019 2:41:21 AM

All required .c files must be placed in the src folder. You must have at least 2 .c files. All .h files required by your solution must be placed in the includes folder. You must have at least 1 .h file. All produced .o files and your executable must be placed in the bin folder. makefile is your functioning makefile. An empty project structure will be uploaded on Courselink for you to use. Any deviations from the expected structure will result in deductions of up to 30%. Your compiled program must be named contactList.

Write a Review

Programming Languages Questions & Answers

  Compute and display number of miles per hour

Once correct data has been entered, the program muts compute and display number of miles per hour over the speed limit that the driver was doing.

  Create program to determine the median grade

Modify that program to determine the median grade along with the average and the highest and lowest grades

  Explain big o notation

What does "n" represent in relation to big O notation?

  Write program to prompt for and accept current salary

Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases.

  Instantiate button group object-add radio buttons to panel

Do the following to add radio buttons to panel: Declare three objects small, medium, and large of type JRadioButton. Instantiate button group object and add buttons to it.

  Write function which takes string and returns vowels

Write a function which takes as a parameter an string and returns vowels (a, e, i, o, u). The function prototype should look like:

  Create an application that manipulates a billboard sign

Create an application that manipulates a billboard sign - Create an application that manipulates a billboard sign based on the guidelines

  Compare and evaluate procedural programming languages

Demonstrate an understanding of the basic principles of procedural programming using an appropriate programming language, including the use of variables, conditions, loops, subprograms - Compare and evaluate procedural programming languages.

  Create a program that meets the given requirements

You recently graduated college and you are applying for a programming job that requires the understanding of loops in Python. The manager you are interviewing.

  Design and implement program that creates exception class

Design and implement a program that creates an exception class called StringTooLongException, designed to be thrown when a string is discovered that has too many characters in it

  How many people are salaried and how many are hourly

Choose an employee from the employee table; delete this employee.

  Create structure chart-flowchart to store taxpayer-s name

Create the structure chart, also a flowchart and pseudocode, for following problem. Suppose that each input record contains taxpayer's name.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd