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

  Find the factorial of a given integer

Write C programs that use both recursive and non-recursive functions. i) To find the factorial of a given integer.

  Write a program to be used as a math tutor

Display the menu-Accept user input on the operation to be performed - Display the numbers and accept the users answers from the keyboard on whether they perform addition, subtraction, multiplication or division

  Use the lengthof the side as a member variable of the class

write a class including four member functions to compute the areas of an equilateral triangle ,square,hexagon and octagon respectively .Use the lengthof the side as a member variable of the class.

  Program to read the numbers and add certain digit

Write a program that will read in 5 numbers and add 10 to the first number, 20 to the second number, and 30 to the third number, 40 to the fourth and 50 to the 50th.

  Implement a rotate function

Write and test the following function: void rotate(int a[], int n, int k); The function "rotates" the first n elements of the array a, k positions to the right.

  Convert the following infix expressions to postfix

Convert the following infix expressions to postfix

  Discuss the different c++ loops and their characteristics

Discuss the different C++ loops, their characteristics

  Describe the probability of the moves

Write a program in C++ to describe the Probability of the moves

  Write a program to create circular link list

Write a program to create circular link list (CLL1) by inserting following elements: 10, 20, 30, 40, 50, -60, -70, 60, 50, 40, 30, 20, and -10. Display the contents of CLL1. Later create a function to delete an element say 40 from CLL1. While dele..

  Ohio phonebook has gotten mixed up

In an accident, the Ohio phonebook has gotten mixed up. The names are now really out of order. You and your enthusiastic, but naive, assistant Carl must fix the problem. No one can use the phonebook while you are sorting it, so every extra second of ..

  Prepare the weighted scoring model for three exams

Prepare the weighted scoring model. Final grades are based on three exams worth 15%, 20%, and 25%, respectively; homework is worth 20%.

  A palindrome is a number

A palindrome is a number or text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 34543 and 11611. Write a program that reads in a five-digit integer and determines ..

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