QuestionQuestion

Homework 2
For the purposes of this grade book you should still provide a menu with the following options:
1. Add a new course
2. Add a new student
3. Add a student to a course
4. Add grades for a student in a course
5. Print a list of all grades for a student in a course 6. Print a list of all students in a course
7. Compute the average for a student in a course 8. Print a list of all courses
9. Print a list of all students
10. Compute the average for a course
11. Store Grade book (to a disk file)
12. Load Grade book (from a disk file)
Each of these menu items should correspond to a function you will write.
Each student and course is, of course, now represented by a structure.
Modify your grade book so that it uses dynamic memory allocation to eliminate the need for upper bounds on the number of classes, students, students per class and classes per student. You may still use fixed size arrays for the strings representing class names and student names. The grades for each student and each class should also be dynamically allocated. Also use Linked lists for the collections of data.

Things to consider:
1. How will you know how many classes there are?
2. How will you know how many students there are?
3. How will you know how many students are in a course?
4. How will you know how many grades there are for each student? 5. How will you maintain relationships between students, courses and
grades?
Be sure to create a written algorithm, or recipe, for each of these functions and the main program. You will submit this in a Word or PDF document as well.
Be sure to attend class lectures as we will discuss some of the questions listed above!
Program Requirements
Your program will be written in C/C++. You may use C or C++ styles for I/O., dynamic memory allocation and comments. You may use C++ String class, but not the Standard Template Library or any other C++ Libraries.
You will include the steps in your algorithm in your code. You may, of course, paraphrase them if you like.
Your program will be graded based largely upon whether it works correctly on a CSE Department Linux machine.
Your program will also be graded upon your program style. At the very least your program should include:
A consistent indentation style as recommended in the textbook and in class.
Meaningful variable names.
A block header comment section that includes: Your Name and Email Address, and a brief description of the program.

Be sure to create appropriate test data and execute tests for proper and improper data on all functions.
You will submit your program source file to the Moodle website under the "Homework 2" drop box. Make sure you submit your program before the due date and time. You must also submit your design, or recipe file, and a short report about your efforts. In total you will submit 6 files (1 report, 1 design 2 *.c and 2 *.h) You may end up with only 1 .h file which is also fine. Under no circumstances should you have more that a total of 8-10 files including the design and the report PDF files. Your files should all reside in a flat directory structure and only require a single and simple gcc compile line.

Please be sure and test your program to make sure it is calculating the result properly. You can either do this by hand (calculating some test values on paper to see if they match what your program says), or temporarily display various intermediate values you're calculating in the process and desk check the results to make sure they are correct. The more test cases you try and you get correct answers, the more certain you will be that when the grader uses his own test cases that your program will produce the correct result.

Homework 3
For this assignment we are going to create a makefile that will manage the code and header files created for Homework 2.
The assignment is relatively simple:
1. Create a properly formatted and working Makefile for the program files in Homework 2
2. Use the makefile to properly compile and link the files fom homework 2.
3. Make sure the makefie operates correctly when changes are made to only one of the files

Program Requirements
You will not need to create a design file for this assignment. You will still need to create a report discussing the problem, the experience you had in solving it, and evaluating the results.
You will submit your makefile to the "Homework 3" drop box, along with the source and header files from homework 3 and your report. Make sure you submit your files before the due date and time. In total you will submit a minimum of 6 files (1 report, 1 makefile, 2 *.c and 2 *.h)
Please be sure and test your makefile to ensure that it works correctly.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

#include "header.h"
#include "node.h"
#include <string.h>


using namespace std;

/**
* create new student
* @param name
* @param id
* @return a student object
*/
Student newStudent(string name, int id){   
    Student s;   
    s.id = id;   
    strcpy(s.name,name.c_str());   
    //s.name = name;   
    return s;   
}

/**
* create new course
* @param name
* @param id
* @return a new course object
*/


#include "header.h"
#include "node.h"
#include <string.h>


using namespace std;

/**
* create new student
* @param name
* @param id
* @return a student object
*/
Student newStudent(string name, int id){   
    Student s;   
    s.id = id;   
    strcpy(s.name,name.c_str());   
    //s.name = name;   
    return s;   
}

/**
* create new course
* @param name
* @param id
* @return a new course object
*/
Course newCourse(string name, int id){   
    Course c;      
    c.id = id;   
    strcpy(c.name,name.c_str());   
    //c.name = name;   
    return c;   
}

/**
* create new registry
* @param studentID
* @param courseID
* @return a new register object
*/...

By purchasing this solution you'll be able to access the following files:
Solution1a.docx, Solution1b.docx, Solution2.docx and Solution.zip.

$68.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats