[Solved] SOLVED:Assignment 1 solution

$25

File Name: SOLVED:Assignment_1_solution.zip
File Size: 263.76 KB

SKU: [Solved] SOLVED:Assignment 1 solution Category: Tag:
5/5 - (1 vote)

ObjectiveThis assignment aims to establish a basic familiarity with C++ classes.General Requirements Follow the common principles of OO programming when you design your classes Put your name, student number at the beginning of each source file/*Students Name:Students email address:Laboratory group (group code and time):Purpose of this assignment:-*/ Add comments to the source code to make your solution easier to follow Logical structures and statements are properly used for specific purposes

Design requirements:Write a program to read a list of students from a text file the name of which should be provided from a command line. Create a dynamic array to store the students records loaded from the file. The format of the data file is as follows:

Albert Einstein 52 67 63Steve Abrew 90 86 90 93David Nagasake 100 85 93 89Mike Black 81 87 81 85Andrew Van Den 90 82 95 87Joanne Dong Nguyen 84 80 95 91Chris Walljasper 86 100 96 89Fred Albert 70 68Dennis Dudley 74 79 77 81Leo Rice 95Fred Flinstone 73 81 78 74Frances Dupre 82 76 79Dave Light 89 76 91 83Hua Tran Du 91 81 87 94Sarah Trapp 83 98The first line has a number equal to the total number of records. Each line shows one students record with the name and marks for different subjects.Define a class Student in a file student.h according to the description below: The class has a private data member name of type char* The class has a private data member marks that store marks of all subjects (up to 4 subjects) The class has a private data member num that holds the number of subjects that have been chosen Define appropriate constructors and a destructor Define necessary public member functions that can get values of data membersand print out results Implement member functions of Student in a file student.cppWrite a program a1main.cpp to initialise the array of students by reading the students records from a text file. After all records have been read, the program shall print the marks for each student along with the total mark and average mark. After all records have been printed, the program shall print the total marks and the average marks for each subject. The program should have appropriate error detection and error recovery in case the data file is corrupted.You need to use dynamic memory allocation to store students name for this task. Make sure there is no memory leak. Do not forget to include namespace in your program files.You can use the command bcheck on banshee to check if there is any memory leak.

You need to follow good programming practices when you write the source code: meaningful identifiers for data members, member functions, classes no global variables appropriate indentation appropriate commentsTesting:Upload all source code files and the data file to your working directory on banshee.Compile the program in the working directory on banshee, byCC o assignment1 a1main.cpp student.cppRun the program using:task1 students.datThe input test file students.dat is provided and can be downloaded from the subjectweb site.Note: Your program should work (and will be tested) with different data files whichfollow the same file format. Do not define the file name as a constant inside yoursource code.The output of your program should be as follows:Name Mark1 Mark2 Mark3 Mark4 Total Average===================================================Albert Einstein 52 67 63 182 61Steve Abrew 90 86 90 93 359 90David Nagasake 100 85 93 89 367 92Mike Black 81 87 81 85 334 84Andrew Van Den 90 82 95 87 354 88Joanne Dong Nguyen 84 80 95 91 350 88Chris Walljasper 86 100 96 89 371 93Fred Albert 70 68 138 69Dennis Dudley 74 79 77 81 311 78Leo Rice 95 95 95Fred Flinstone 73 81 78 74 306 76Frances Dupre 82 76 79 237 79Dave Light 89 76 91 83 339 85Hua Tran Du 91 81 87 94 353 88Sarah Trapp 83 98 181 90===================================================Total 1240 1146 1025 866Average 82 76 68 57===================================================Submission:All assignments must be submitted electronically via the submit system. For thisassignment you must submit all the files via the command (in one line):submit -u your_user_name -c CSCI204 -a 1 a1main.cppstudent.h student.cppand enter your password.Make sure that you use the correct file names. The UNIX system is case sensitive. Youmust submit all files in one submit command line.After submit your assignment successfully, please check your email of confirmation.You should keep the email for the reference.NOTES:1. SUBMIT AS EARLY AS POSSIBLE. YOU CAN RESUBMIT LATER IF NECESSARY.Only the latest submission will be marked.3. SUBMISSION VIA EMAIL IS NOT ACCEPTABLE. YOU HAVE TO USE SUBMITCOMMAND TO SUBMIT YOUR WORK.4. ASSIGNMENT WITHOUT PROPERLY FILLED ASSIGNMENT HEADERS INSUBMITTED FILES WILL NOT BE MARKED4. The submitted file names must be the same as in the submission example. Files with othernames will not be tested by the submit system and therefore will not be marked.5. Enquiries about the marks can only be made within a maximum of 1 week after the assignmentresults are published. After 1 week the marks cannot be changed.6. The assignment is an individual assignment and it is expected that all its tasks will be solvedindividually without any cooperation with the other students. If you have any doubts,questions, etc. please consult your lecturer. Plagiarism will result in a FAIL grade being recordedfor that assessment task.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Assignment 1 solution
$25