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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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