当前位置:天才代写 > C++/C代写,c语言代写代考-100%安全,包过 > 代写CS-C语言代写DATA STRUCTURES AND ALGORITHMIC PROBLEM

代写CS-C语言代写DATA STRUCTURES AND ALGORITHMIC PROBLEM

2018-07-27 08:00 星期五 所属: C++/C代写,c语言代写代考-100%安全,包过 浏览:1347

UCCD1024        DATA STRUCTURES AND ALGORITHMIC PROBLEM SOLVING

ASSIGNMENT 1 LINKED LISTS            DUE DATE: WEEK 9, MONDAY BEFORE 12.00PM


 

PLEASE READ THE QUESTION CAREFULLY BEFORE YOU START.

 

1. OBJECTIVE

(a) To review and strengthen concepts about linked lists through an application development.

(b) To review techniques of dynamic data structure creation and manipulation.

 

 

2. EQUIPMENT

Hardware: The PCs in the lab for conducting your practical.

Software: The Microsoft Visual Studio 2015. Your programming will only be tested by the markers using Visual Studio 2015.

 

 

3. INDIVIDUAL OR GROUP PROJECT:

 

Form a group of 1 to 2 persons (MUST BE FROM THE SAME PRACTICAL SESSION). Select one person to be the leader. Only one person need to upload the Assignment to WBLE for submission. However, please remember to  include your group member name in the readme.txt file.

 

 

4. DESCRIPTION OF PROJECT:

 

In this project, you need to write the functions given in the main() that will store and manage student information in FICT using linked lists. Three classes have been created, which are Student class, Exam class and Subject class. Student class is used to store student information and the Exam class is used to store information for past exam for a student in a trimester. The Subject class is used to store information for a subject taken by student. Refer to the Figure1.doc given for the representation of the types of linked list that you are going to create. Below are the details for each of the classes:


PLEASE DO NOT CHANGE (ADD/REMOVE) ANY ATTRIBUTES OR FUNCTIONS IN LIST, NODE, STUDENT, EXAM AND SUBJECT STRUCTS GIVEN TO YOU. MARKS WILL BE DEDUCTED IF YOU DO SO.

 

Student Struct:

 

Refer to the file Student.h for all the members in the struct. Refer to the table below for the format of the data stores for each attributes in Student struct.

 

Attributes

Format

name

A c-string with 30 characters

id

A c-string t represent id. Student id consists of 7 digits with the first 2 digit represent years enroll. E,g.: 1300345

course

Use 2 characters to represent: CS – Computer Science

IA – Information Systems Engineering IB – Business Information Systems CN – Communication and Networking CT – Computer Engineering

phone_no

A 7 digits number in the following

format: 123-4567

current_cpga

The latest cgpa for a student with 5 decimal places. E.g.: 3.51762

totalCreditsEarned

Total credits earned so far.

exam

An array to store past exam for a student according to trimester. This array can

store up to 10 trimester result.

exam_cnt

A counter to keep track of the number of past exam result store in exam array.

 

The following member functions are given in the struct:

 

1. Constructor Student() to initialized name, id, course and phone_no to empty string (use strcpy) and current_cgpa, exam_cnt and totalCreditsEarned to 0.

 

2. Function bool compareName1 (Student) to compare student name using >= operator. You can use this function to compare which student’s name come first according to alphabetical order. It is used in the second insert function.

 

3. Function bool compareID (Student) to compare student id using == operator. You can use this function to search for student in a linked list based on id.

 

4. Function void print(ostream &) to print Student struct variable. The argument pass to the function is used to determine which stream to print the output.

 

5. Function bool calculateCurrentCGPA() to calculate the current cgpa for a student.

 

 

Exam Struct:


 

Refer to the file Exam.h for all the members in the struct. Refer to the table below for the format of the data stores for each attributes in Exam struct.

 

Attributes

Format

trimester

Store the trimester of the exam using integer to represent the 3 trimester in a year as follow:

1 – January Trimester 5 – May Trimester

10 – October Trimester

year

A four digit integer to represent the year of the exam.

gpa

GPA obtained for a trimester. Use 5 decimal points to represent the value.

numOfSubjects

The number of subjects taken in that

trimester.

sub[]

The subject information taken in that trimester. Each element is an object of class Subject. Maximum only 6 subjects can be taken and minimum is 1 subject.

 

The following member functions are given in the Exam struct:

 

1. Constructor Exam() to initialized trimester, year, gpa and numOfSubjects to 0.

 

2. Function bool calculateGPA() to calculate the gpa for an exam in a trimester based on the grade and number of subjects take. Refer to file Figure2.doc for the grade point based on the marks obtained.

 

3. Function void print(ostream &) to print the Exam struct variable. The argument pass to the function is used to determine which stream to print the output.

 

Subject Struct:


 

Refer to the file Subject.h for all the members in the Subject struct. Refer to the table below for the format of the data stores for each attributes in Subject struct.

 

Attributes

Format

subject_code

A string with 10 characters to represent a code for a subject. First four characters represent must be alphabet and last four

are digits.

subject_name

A string represents the subject names.

credit_hours

Number of credit hours for a subject.

marks

Marks obtained for a subject. Range is from 1 to 100.

 

The following member functions are given in the Subject struct:

 

1. Constructor Subject() to initialized subject_code and subject_name to empty string (use strcpy) and credit_hours, and marks to 0.

 

2. Function const char *getGrade() to return the grade (A+, A, B+, …) for a subject based on the marks. Refer to file Figure2.doc for the grade return based on the marks obtained.

 

3. Function double getGradePoint() to return the grade point for a subject based on the marks obtained. Refer to file Figure2.doc for the grade point return.

 

4. Function void print(ostream &) to print Subject struct variable. The argument pass to the function is used to determine which stream to print the output.

 

Main() Tasks:


 

You need to write the following functions in main().

 

1. Write a function bool ReadFile(char *filename, List *list) to read from a file  that store student information in a linked list. Ensure there is no duplicate record  of student stored in the list. The function will return true if successfully read and false otherwise. A sample of the textfile is in “student.txt”.

 

2. Write a function bool DeleteRecord(List *list, char *id) to delete a student from the linked list based on student id. The function will return true if successfully delete and false if student cannot be found in the list.

 

3. Write a function bool Display(List list, int source) that will display information to the screen. Function return false if list is empty and true otherwise. The source variable will indicate whether to display to screen (source = 1) or file (source = 2). If write to file, use the filename “student_result.txt” to write. A sample of each of the output option is given in text file in folder sample output. If the student’s exam_cnt = 0, then print “THIS STUDENT HAVEN’T TAKEN ANY EXAM YET”. You can design your own output format but the necessary details must be there.

 

4. Write a function bool InsertResult(char *filename, List *list) to insert student exam result to the linked list. Open the file with filename and read every record and find the student to insert the exam based on their id. A sample of the text file is in “exam.txt”. Read every record in the file and put the exam info in an exam struct variable. Then find the correct student based on id to insert the exam struct variable. You need to calculate the current cgpa every time you insert a new exam to a student.

 

5. Write a function bool printStatistic(List list) that will find and print the statistics for the student list as below. Average subject taken per semester is how many subjects are taken averagely for one student in one semester. Similar for average credit hours earned per semester. The function will return false for empty list and true otherwise.

 

Sample Output:

 

Total Students: 20 CS Students – 6 IA Students – 5 IB Students – 3 CN Students – 3 CT Students – 3

 

Average CGPA: 3.15670

Average Subjects Taken Per Semester: 3.23 Average Credits Earned Per Semester: 26.57

 

6. Write a function bool findEligibleFYPStudent(List list1, List *FYPlist) that  will identify student that can register for FYP (Final Year Project). A student is


eligible to register for FYP if he/she has earned at least 30 credits hours and the student has taken and passed (must obtain at least grade C) UCCD2502 Introduction to Inventive Problem Solving and UCCD2513 Mini Project. Call Display(FYPlist, 1) in main() after function call to display FYPlist. If FYPlist is empty print message “There is no student that is eligible to take FYP”. Assume that list FYPlist is empty when pass to function and list will not be changed after function call. The function will return false for empty list1 and true otherwise.

 

7. Write a function bool identifyGoodPoorStudent(List list1, List *goodList, List

*poorList) that will identify student with good result and poor result in list1. A student is considered to have good result if he/she can get gpa >= 3.50000 for at least 3 trimesters in all the exams and CGPA >= 3.50000 and no fail subject. A poor student is a student that get gpa <= 2.0000 for at least 3 trimester and CGPA

<= 2.0000. Copy all the good result students to list goodList and all the poor students to list poorList. Call function Display(goodList, 1) and Display(poorList,

1) in main() to print goodList and poorList in the screen after calling the function. Assume goodList and poorList are empty when pass to function and list1 content will not be changed after function call. If either the goodList or the poorList is empty after function all, then print message “There is no student in good list” or “There is no student in poor list”. The function will return false for empty list1 and true otherwise. (Note: If a student has taken < 3 exams then no need to check if the student belongs to good or poor list.)

 

8. Write a int menu() function that contain menu with choice from 1 to 8 above to  let user choose that task. Function will return the choice chosen. Make sure user can continuously choose for the menu until exit choice is chosen. Sample menu is displayed below:

1. Read file.

2. Delete record.

3. Insert past exam result.

4. Display Output

5. Print Statistic

6. Find Eligible FYP Student

7. Identify Good and Poor Result Student

8. Exit.

 

Test run

 

 

Although each of the above tasks is to be implemented as a single function, you can create additional sub-function(s) to handle portions of the function if it’s necessary. This is especially true if the original function is too long or contains more than one functionally related group of statements. You must test for all conditions that might possibly arise; print out error messages as needed.

 

A sample of text files student.txt and exam.txt can be downloaded from WBLE. The content of text file will be changed (while still adhering to the same data format) during grading in order to test your programs' robustness. The objective is to ensure that you do not hardcode your program to work exclusively for the given sample


student records. PLEASE CREATE YOUR OWN OR ADD MORE DATA TO THE SAMPLE TEXT FILES GIVEN TO YOU TO MAKE SURE YOU HAVE TESTED YOUR PROGRAM FOR ALL POSSIBLE CASES THAT YOU CAN THINK OF. MAKE SURE THE FORMAT OF YOUR OWN TEXT FILES MUST BE SAME FORMAT AS THE ONE GIVEN HERE TO ENSURE YOUR PROGRAM CAN READ THE SAME FORMAT WHEN WE MARK YOUR PROGRAM.

 

Format of text file EXAM.TXT are as follow:

 

id    trimester     year     numOfSubjects     list    of    subjects    (for    every subject store unit code, unit name, credit hours and marks obtained)

 

 

 

5. ERROR HANDLING

We will first test your work with error-free inputs from files. It would be ideal if your programs can also do appropriate error handling like

 

· Input file cannot be found

· Duplicate records are read in

 

Duplicate records should be ignored and appropriate error statement should be printed. Apart from these, you do not need to worry about other types of errors. For all errant situations, the program should recover and still run as usual.

 

 

6. REPORT

(a) This assignment is due according to the due date posted on WBLE. You must do the submission through WBLE. You should create one folder using the group leader name and then copy all your source code files (*.h, and *.cpp) into this folder. You should also provide a readme file (see description below) and extra data input files that you create to test your program. In the readme file, write down all your group members’ name. Apart from these, you should not have irrelevant source files in the folder. Compress this folder into a zip file and submit only this zip file to WBLE. ONLY ONE MEMBER NEEDS TO UPLOAD THE ZIP FILE IN WBLE FOR SUBMISSION.

 

(b) The readme file should contain the following information:

 

(i) All group member name, id and course.

(ii) Known errors and bugs of your code (if any).

(iii) Limitation of the types of inputs that your program can handle (if any).

 

 

(c) The grading of your work will be based on the following criteria:


· Correctness of program (whether the functions work according to specifications);

· Structure, organization, presentation of codes;

· Documentation of codes (how easy to understand your codes); avoid excessive comments, such as commenting every line of your code.

· Comprehensiveness of the test cases.

 

 

 

7. ACADEMIC HONESTY AND COLLABORATION

Cooperation is recommended in understanding various concepts and system features. But the actual solution of the assignments, the programming and debugging must be your individual work, except for what you specifically credit to other sources. (Your grade will be based on your own contribution.) For example, copying without attribution any part of someone else’s program is plagiarism, even if you modify it  and even if the source is a textbook. You can document the credit to other sources at the start of your program code listing. The University takes acts of cheating and plagiarism very seriously: first time violators may fail the coursework component of UCCD1024. Any wholly (or partly) copied (or being copied) programs will receive zero mark.

 

9. REFERENCES

[1] Text and reference books for UCCD1024.

[2] http://msdn.microsoft.com/en-us/visualc/aa336395

代写CS&Finance|建模|代码|系统|报告|考试

编程类:C代写JAVA代写 , 数据库代写WEB代写Python代写Matlab代写GO语言R代写

金融类统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理

服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导

天才写手代写CS 代写finance 代写statistics 考试助攻

E-mail:850190831@qq.com 微信:BadGeniuscs 工作时间:无休息工作日-早上8点到凌晨3点


如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

1513067809116994.png

 

    关键字:

天才代写-代写联系方式