Write a student enrollment system for a university

Assignment Help C/C++ Programming
Reference no: EM131915505

Advanced Programming

Aim:

- Design a solution to a problem from a partially complete framework.
- Gain some experience writing a database application in C++.
- Using binary I-O in C++ programs.

Instructions:

To receive 2 marks for the demo you must complete Step-1 and demonstrate it to your lab supervisor in week-3. The week-4 submission instructions are provided at the end of this document. Please read the Ass1 Q/As on moodle regularly in case suggestions are provided or changes are made to the assignment specification.

You are to write a student enrollment system for a university. For each student the system is to keep the following information:
a) First Name
b) Last Name
c) Number of Subjects
d) Subjects (Codes; Status, Marks;};

In the Ass1 folder you will find an incomplete implementation of the enrollment system and a datafile called ass1.txt for testing the program. Examine the data file to get a feel for the data in this system. You may assume that the file contains no errors. All work for this assignment should be done in the ass1.cpp file. Do not modify main.cpp or ass1.h. To compile on linux/unix: g++ main.cpp ass1.cpp. To run on linux: ./a.out. The file: "How to compile with DevCpp.pdf" explains how to compile all the files on DevC++.

(Marking: Step 1 is worth 4 marks (including the demo). Steps 2 and 3 are worth 3 marks each.)

Step 1 Implement the functions: ReadFile(), FindRecord(), DisplayRecord() and PrintRecord() according to the pseudo code provided. Information and example code on reading and writing text files can be found in the C++ Guide in the Wk 1 Lecture folder. Test that your program can correctly load the array from the data file and display records on the screen. Example output is given below:
13 records read Commands Available:
d - Display Record u - Update Record
q - Quit the program

Command: d
Enter student number: 4734455 Student No. 4734455
First Name Kieren
Last Name Legrande Subjects:
CSCI104 Provisional 65
IACT123 Enrolled 67
CSCI121 Enrolled 98

Step 2 Implement the UpdateRecord() and SaveFile() functions and test your program to ensure that it can amend student records and save all records to the file ass1.txt.
Command: u
Enter student number: 4734455 Student No. 4734455
First Name Kieren
Last Name Legrande Subjects:
CSCI104 Provisional 65
IACT123 Enrolled 67
CSCI121 Enrolled 98

Enter subject code: CSCI104 Select status or mark (s/m): s Select new status
e: enrolled
p: provisional w: withdrawn
Status: e
Record 4734455 Updated.

Step 3 Requires implementation of binary file I-O into the program. If you are unfamiliar with binary file I-O, information on this can be found in BinaryFiles.pdf and the C++ Guide available in the Lecture Notes folder. To implement binary file I-O follow these steps.
(a) Add four more private functions to ass1.cpp:
bool ReadTextFile(char Filename[]); //reads text data from file to gRecs[] array bool WriteTextFile(char Filename[]); //writes text data from gRecs[] to file
bool ReadBinaryFile(char Filename[]); //reads binary data from file to gRecs[] array bool WriteBinaryFile(char Filename[]); //writes binary data from gRecs[] to file

To do this, copy the code in the ReadFile() and SaveFile() functions to ReadTextFile and WriteTextFile() respectively. Modify this code so that it uses the passed filename and return false if the file or path is not found when opened. ReadBinaryFile() and WriteBinaryFile() should read/write the binary contents of gRecs[] to the passed filename (see lecture notes: BinaryFiles.pdf) (Note: the binary file should store the number of records followed by the record data.)

Rewrite the ReadFile() function so that it uses the above functions and attempts to read the binary file (named in global cBinaryFileName). If this fails, it then attempts to read the text file (named in global cTextFileName) and then writes the binary file. If ReadFile() fails to read the binary file and the text file it should print an appropriate error message and exit.

(b) Add one more private function named:
void WriteBinaryRecord(char Filename[], int Pos);

This function should:
open the binary file (named in global cBinaryFileName) seek() to the appropriate record at Pos
write the record to the binary file close the file

Then alter the UpdateRecord() function so that it also updates the binary file by calling the above function.

(c) Modify the SaveFile() function so that it attempts to write the gRecs[] array to the binary file. If this fails it then attempts to write the data to the text file.

(d) Test your program to ensure that the binary data is being appropriately saved to the file.

Attachment:- files.zip

Verified Expert

The task was to learn reading and writing from both text and binary files in C++.The first task was to read from text file, let user update record and finally save it to a file.The second task was to repeat the same but in binary mode.

Reference no: EM131915505

Questions Cloud

Describe member services and incentives : Examine provider network and outreach. Explain the insurance company's commitment to excellence and quality.Discuss new/current/upcoming technology.
What is the beta for procter and gamble : Nature Beauty primarily sells its products through a wholesaler who distributes the products through its network of retailers throughout the country.
Explains how you will measure the impact of intervention : Explains how you will measure the impact of your intervention and explains the importance of evaluation as a part of any organizational intervention plan.
Define impact on the health care delivery system : Select a public health issue and write a 750- 950 word policy brief that provides a brief summary of the issue, options to solve the issue, and the best way.
Write a student enrollment system for a university : CSCI251/851 - Advanced Programming Design a solution to a problem from a partially complete framework and Gain some experience writing a database application
What developments are important for viable business to know : What developments are important for a viable business to know? What traits would you be looking for in a business engaged in your chosen profession?
What is the main idea or point of the article : What is the main idea or point of the article? Why do you think Kolbert wrote this article? Does she want readers to behave in a different way?
What did you learn from your cultural group : What did you learn from your cultural group and your community about who you are as an individual and where you fit in the world?
Can the fox islands electrical company be a low-cost : How can Chaparral Steel's commitment to both its internal and external customers be used by The Fox Island Electrical Company?

Reviews

len1915505

3/26/2018 2:33:29 AM

Before submitting check the format of your source files to ensure tabs, spaces and newlines appear correct on an editor like nedit or notepad++. Submit your files using the submit facility on UNIX ie: $ submit -u login -c CSCI251 –a 1 ass1.cpp main.cpp ass1.h where 'login' is your UNIX login ID. Deductions will be made for untidy work or for failing to comply with the submission instructions. Requests for alternative demo or submission arrangements will only be considered before the due date. An extension of time for the assignment submission may be granted in certain circumstances. Any request for an extension of the submission deadline must be made to the Subject Coordinator before the submission deadline. Supporting documentation should accompany the request for any extension. Late assignment submissions without granted extension will be marked but the points awarded will be reduced by 1 mark for each day late. Assignments will not be accepted if more than four days late.

len1915505

3/26/2018 2:33:24 AM

Need soultion of step 2 and 3 and plz dont send which u have send already another student in australia turnit in gonna match 100 % and i ll get 0 marks plus could be big problem. Assignment 1 (Due: 11.59pm, Week 4, Friday) 10 marks (Week-3: demo 2marks. Week-4: submission 8 marks)

Write a Review

C/C++ Programming Questions & Answers

  Create the program which converts fahrenheit to celsius

Create the program which converts Fahrenheit to Celsius -  Read integer Fahrenheit temperatures from the user. You need to check whether the input is the correct one or not. If the user enters the incorrect number, ask it again.

  The access attributes, list and describe

Without considering the access attributes, list and describe which base class members may not be inherited by a derived class and provide a rationale for why this is?

  Implement a class address

Implement a class Address. An address has a house number, a street, an optional apartment number, a city, a state, and a postal code.

  A password must have at least eight characters

A password must have at least eight characters. A password must consist of only letters and digits. A password should contain at least one uppercase letter. A password must contain at least two digits.

  Program to report on the roots of a quadratic equation

Write a complete C++ program to report on the roots of a quadratic equation ax2 + bx + c = 0, a ≠ 0. compute the roots.

  Write a program that will read from a file a series of lines

Write a program that will read from a file a series of lines that contain an individuals first and last name followed by a colon, then three integers.

  File system with login authentication

Implement a simple file system with login authentication and access control - Construct a hash/salt/shadow based user/password creation system.

  Create a new variable, and prompt the user

Input variables are often used to capture, store, and often perform operations within software execution. Collect input from the user, add an operation to this collected data, and output the results to the screen. Utilize the provided resources to as..

  Define a cpp function that has two integer inputs

Define a C++ function that has two 2 integer inputs (N) and returns a double output y, where y=∑sqrt(n+0.5)/(2n+1) n=1 the value of n s'd be positive.

  Write a function which adds the two numbers

In C write a function which adds the two numbers. Test this function by calling from the main. In main, the user should be asked to provide the two numbers.

  Unit conversions

Unit Conversions. The following problem generate tables of unit conversions. Include a table heading and column headings for the tables. Choose the number of decimal place based on the values to be printed.

  Find the truth table of a three-variable exclusive-or(odd)

Find the truth table of a three-variable exclusive-OR(odd) function

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