Regis University CC&IS CS362 Data Structures

Similar documents
Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists

CpSc 1111 Lab 9 2-D Arrays

Word and Excel Assignment Assessment

CS 142 Style Guide Grading and Details

CpSc 1111 Lab 5 Formatting and Flow Control

Chapter 10 Introduction to Classes

Using C++, design an Abstract Data Type class named MyGrades. The class must have the following private members :

IT 650 Final Project Guidelines and Rubric

CS261: HOMEWORK 2 Due 04/13/2012, at 2pm

CS 215 Fundamentals of Programming II Spring 2018 Project 5

AP Computer Science A

CS 2604 Minor Project 1 Summer 2000

Assignment Manager. Change Edit Mode to On if it is not already by clicking on the option at the top right of the window.

Control Statements: Part Pearson Education, Inc. All rights reserved.

Lecture 18 Tao Wang 1

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

CS 2604 Minor Project 1 DRAFT Fall 2000

CS 215 Fundamentals of Programming II Spring 2010 Project 6. Dnode<T> structure. Specifications for Document Class. 30 points

Registration and Login

CS 103 The Social Network

MWF 9:00-9:50AM & 12:00-12:50PM (ET)

CpSc 1111 Lab 4 Formatting and Flow Control

Decision Logic: if, if else, switch, Boolean conditions and variables

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting

CSCI 1301: Introduction to Computing and Programming Spring 2019 Lab 10 Classes and Methods

CpSc 1011 Lab 4 Formatting and Flow Control Windchill Temps

CS 2316 Individual Homework 4 Greedy Scheduler (Part I) Due: Wednesday, September 18th, before 11:55 PM Out of 100 points

CSCI 1301: Introduction to Computing and Programming Spring 2018 Project 3: Hangman 2.0 (A Word Guessing Game)

Spring 2017 CMSC 140 Programming Project 7: Payroll

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

Programming Assignments

UNIVERSITY OF MASSACHUSETTS LOWELL Department of Electrical and Computer Engineering. Program 9 EECE.3220 Data Structures Fall 2017

Syllabus. Course Number: CS 361 Course Title: Control Structures. Course Description: Prerequisite Courses: Course Overview

COWLEY COLLEGE & Area Vocational Technical School

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018

CS 2704 Project 3 Spring 2000

PIC 10B Lecture 1 Winter 2014 Homework Assignment #2

CS101 Homework 4: Social Network

SAM Settings and Reports for System 44 Next Generation

CS 1044 Program 6 Summer I dimension ??????

CMSC 201 Fall 2016 Homework 6 Functions

Important Notes: For this course you must check the Regis Bookstore: for the most current online course material information.

Full file at C How to Program, 6/e Multiple Choice Test Bank

CpSc 1011 Lab 5 Conditional Statements, Loops, ASCII code, and Redirecting Input Characters and Hurricanes

CS 2704 Project 2: Elevator Simulation Fall 1999

A A B U n i v e r s i t y

Computer Programming C++ Classes and Objects 6 th Lecture

You must pass the final exam to pass the course.

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

PROGRAM 2- Implementation Specifications

CS 215 Fundamentals of Programming II Fall 2017 Project 7. Morse Code. 30 points. Out: November 20, 2017 Due: December 4, 2017 (Monday) a n m

EECE.2160: ECE Application Programming Spring 2017

Fall CS 101: Test 2 Name UVA ID. Grading. Page 1 / 4. Page3 / 20. Page 4 / 13. Page 5 / 10. Page 6 / 26. Page 7 / 17.

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

Fundamental Concepts: array of structures, string objects, searching and sorting. Static Inventory Maintenance Program

Note : Your program must contain the following 6 functions :

IT 204 Final Project Guidelines and Rubric Database Proposal and Implementation Plan Report

CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards

Programming Assignment - 1

Recommended Group Brainstorm (NO computers during this time)

COURSE ELEMENTS / DROPBOX

AP Computer Science A

Chief Reader Report on Student Responses:

AP Computer Science A

Faculty WebAdvisor Manual

CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus

Continuing Education

AP Computer Science A

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point?

Introduction to C++ Coding Style How to Program Beautifully?

Introduction to C Programming

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

Cmpt 135 Assignment 2: Solutions and Marking Rubric Feb 22 nd 2016 Due: Mar 4th 11:59pm

Assessment Tools in D2L, Part 2: Dropbox

Assignment Marking Criteria

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

CS 1803 Pair Homework 4 Greedy Scheduler (Part I) Due: Wednesday, September 29th, before 6 PM Out of 100 points

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

Assessment details for All students Assessment item 1

San José State University Computer Science CS 122 Advanced Python Programming Spring 2018

CSE 5A Introduction to Programming I (C) Homework 4

The Linux Command Line: A Complete Introduction, 1 st ed., by William E. Shotts, Jr., No Starch Press, 2012.

CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 4

Computer Programming C++ (wg) CCOs

EECE.2160: ECE Application Programming Spring 2018 Programming Assignment #6: Using Arrays to Count Letters in Text Due Wednesday, 4/4/18, 11:59:59 PM

How to: Revised 8/22/2016 Copyright 2016 by Region 7 Education Service Center. All rights reserved. Page 1

PROGRAM 1- Implementation Specifications

Documentation Requirements Computer Science 2334 Spring 2016

Student Performance Q&A:

CMPT 117: Tutorial 1. Craig Thompson. 12 January 2009

Data Structures and OO Development II

CSSE2002/7023 The University of Queensland

Instructions for Accessing the Outreach Trainer Portal

CSCI 1301: Introduction to Computing and Programming Summer 2018 Lab 07 Classes and Methods

TxEIS txconnect Training Guide August, 2012

Zimmer CSCI 330 Fall 2018 (191) PROGRAM 4- Implementation. Program Implementation... Nov 29, 2018 (printed for class 11/30)

LACCD ON-LINE FACULTY SERVICES CLASS ROSTERS

ONLINE COURSE INFORMATION:

Computer Science 210: Data Structures

Transcription:

Regis University CC&IS CS362 Data Structures Programming Assignment #5 (covers classes and objects) Due: midnight Sunday of week 6 A college wants to you to write a test program for tracking their course sections. Classroom capacities on campus range from a minimum of 1 student to a maximum of 30 students. Data stored about each course includes: the course number, the course title, the capacity (number of seats) for the course, the number of students enrolled in the course, and a list of student ids for students enrolled in the course. Class Details The following data members must be declared as part of the new class, course. Data Field Data Type course number string (2 uppercased letters followed by 3 digits) course title string capacity integer (between 1 and 30) number students enrolled integer (between 0 and capacity) student id list array of 5-digit student ids (size = maximum course capacity) The following member functions must be declared as part of the new class, course. Two constructor functions (one without parameters, and one with parameters) Constructor without parameters will set the initial values to: course number to course title to capacity to minimum capacity of a classroom number students enrolled to 0 Constructor with parameters will provide the following parameters and default values: course number (no default must be supplied) course title (no default must be supplied) capacity = (default = maximum capacity) The number students enrolled will not be a parameter, and this constructor will set it to 0. Mutator functions (assign values to data members) setcoursenum setcoursetitle setcapacity Accessor functions (access values from data members) getcoursenum getcoursetitle getcapacity getnumenrolled

Facilitator functions: printcourse printstudentids addonestudent droponestudent Operator overloading functions: operator++ operator<< (display course data) (display all student ids on student id list) (add one student to course) (drop one student from course) (increment capacity by one) (displays object data) NOTE: Data members within the course type class may only be accessed via the above member functions. You will also need to define several functions outside of the class, for reading and error checking user input and managing the courses. Program Details When the program begins, it will create three course type objects as follows: course1 Create using the constructor with parameters to set the course number and course title to CS361, Control Structures (will use the default capacity). course2 Create using the constructor with parameters to set the course number and course title to CS362, Data Structures, and set the capacity to 10. course3 Create using the constructor without parameters. After course3 is created, prompt the user for the course number and course title, and assign them to the object data fields. When all three courses objects have been created, the program will allow the user to manipulate the objects. The program will access the course number and course name in each of the course objects to present a Choose Course menu to the user for choosing a course to manage. The Choose Course menu must be implemented so that the user enters either a course number or E to exit. Choose a course to manage: CS361 Control Structures CS362 Data Structures MT415 Linear Algebra Enter the course number (e.g. CS200) or E to exit: After the user chooses a course to manage, the program will display a Course Management menu of action choices, as detailed on the next page. The actions will be applied to the course that was chosen to be managed.

Course Management menu choices: P - Print course data (to the screen) Use the overloaded << operator to display the course data as follows: N Modify course Number CS361 - Control Structures: 1 seats taken, out of 15 total seats Call a function to read, error check, and return a valid course number. Course numbers must be 2 letters followed by 3 digits. If a course number entered by the user is invalid, issue an error message stating why it is invalid. Loop and re-prompt for the course number, until it is valid. The function should uppercase the letters, if user enters them in lowercase, before returning the value. Then use setcoursenum to store the new value, and then confirm the change. New course number is CS430 T - Modify course Title Call a function to read, error check, format, and return a valid course title (i.e. course name). Course titles can contain only letters and spaces. If a title entered by the user is invalid, issue an error message stating why it is invalid. Loop and re-prompt for the title, until it is valid. NOTE: In order to read the title, you will need to use getline (covered in text Chapter 3) because the extraction operator (>>) will only read strings up to the first whitespace. After error checking the title characters, format the title. The first letter and each letter following a space will be uppercased, and the rest will be lowercased. Return the valid formatted title. Then use setcoursetitle to store the new value, and confirm the change. New course title is Operating Systems C - Modify course Capacity Call a function to read, error check, and return a valid course capacity. The function should insure that the new capacity is within the minimum and maximum allowable capacity. Using the returned value, check to insure the new capacity is not less than the current student enrollment (use getnumenrolled to check the current enrollment).

If the new value is below the current number of students enrolled, issue a message saying that students must be dropped from the course first. Error - cannot change capacity to 20 unless 2 students are dropped, because 22 students are already registered. Otherwise, use setcapacity to store the new value and confirm the change. Capacity is now 11 I - Increment course Capacity Use the overloaded ++ operator to increment the course capacity by one, as long as it does not exceed the maximum capacity allowed, and then confirm change. Capacity is now 12 S Student Management Display a Student Management sub-menu (display student ids, add one student, drop one student, and return back to the Course Management menu). The options should be implemented as follows: P Print Student IDs (to the screen) Use printstudentids to display the ids of students enrolled in the course, one student per line. 2 students enrolled in CS361 77777 87228 A - Add one student If course is full, issue an error message. Course is full. Cannot add any more students. Otherwise, use addonestudent to add one student to the course, as follows: Call an input function to read, error check, and return a valid student ID (must be a 5- digit integer, no leading zeros allowed). Then store the student id number in the list, increment the student enrollment, and confirm the change. Added student id 34567

D - Drop one student If the course is empty, simply display a message stating there are no students enrolled. Cannot drop a student -- no students are enrolled. Otherwise, use droponestudent to drop one student from the course, as follows: a) Display the student ids b) Ask the user for the student id number of the student to drop c) Find the student id number in the list d) If the student id number is found, delete the id from the list and decrement the enrollment. Reminder: Deleting from unordered arrays was covered in online content sections 3.4.3 and 3.4.4. e) Display a message confirming which student id number was dropped, or stating that the student id number could not be found. B Back to Course Management menu Exit the Student Management menu and return to the Course Management menu. Loop around the Student Management menu options, until the user chooses B. [END of Student Management menu options] B - Back to Choose Course menu Exit the Course Management menu and return to the Choose Course menu. Loop around the Course Management menu options, until the user chooses B. The program will loop around the Choose Course menu, until the user chooses Exit. NOTE: For each menu, when a menu choice is entered, the program will error check the user has entered a valid choice, and will issue an error message if the choice is not valid. Before exiting the program, use the overloaded << operator again to display the course data for all three courses. Program Notes: 1. Your program must conform to all CS362 Coding Standards specified in Content section 1.7. - The program should include a file header at the top of each program file - Each function should include a function header. 2. This program should be of modular design (minimum of FIFTEEN functions/methods). - The breakdown of the code must be logical, not arbitrary!

- The main function should do little more than call other functions. - The other functions/methods should each perform ONE well-defined task. 3. Your program should be thoroughly tested, and test data files should be submitted. Submission Submit: - your program code file(s) - a description of how you tested your code to the Wk 6 Assn 5 folder in the Dropbox area of the online course, by midnight, Sunday. WARNING: Your program will NOT be accepted if it: does not compile uses any global variables is not adequately modular (i.e. contains fewer than the required number of functions) Before attaching your files to the assignment submission, please NAME them as follows: LastnameAssn#.cpp LastnameTestDescription.docx (or.doc, or.txt) For example: SmithAssn5.cpp SmithTestDescription.docx Grading The rubric that will be used to grade your program is included on the next pages.

Rating Category Documentation Data Storage Object Creation / Constructors Accessors / Mutators Operator Overloading CS 362 Data Structures Programming Assignment #5 Rubric Rating Exemplary Partially Proficient Basic (needs work) Not Demonstrated Documentation includes complete and accurate file and function headers, as detailed in the CS362 coding standards, along with additional in-line comments at appropriate locations. Constants used for all fixed values. Classes members and objects declared as specified. All constants and variables defined using correct data types, within correct program scope, following CS362 coding standards. Both constructors defined as specified. Three objects instantiated as specified, and filled with required data. All accessor and mutator functions defined as specified. Both the << and ++ operators were successfully overloaded for use with the class as specified. Documentation includes all required headers, but lacks some clarity or details, OR violated minor details of CS362 coding standards for comments, OR code is over commented. Minor errors in data declaration scope, data typing or assignment, OR missing a couple of necessary constants, OR some identifier names not descriptive enough, OR violated minor details of CS362 coding standards for data. Both constructors defined, but minor issues in definitions and/or three objects instantiated, but not as specified. All accessor and mutator functions defined, but minor issues in definitions. Both the << and ++ operators were overloaded, but minor issues in definitions. Documentation is incomplete and/or incorrect and/or formatted incorrectly and/or violated multiple rules within the CS362 coding standards for comments. Many errors in data declaration scope, data typing or assignment, AND/OR many missing constants, AND/OR violated multiple rules within the CS362 coding standards for data. Multiple problems with constructor definitions and/or object creation. Multiple problems with accessor and mutator functions OR not all required functions defined. Multiple problems with operator overloading functions OR only one operator was overloaded. Only a few (or no) comments in program. Major errors in most or all of the constant/variable definitions or assignments AND/OR did not follow most of the CS362 coding standards for data. No constructors defined. No accessor or mutator functions defined. No operator overloading functions defined.

Menus Modifying Functions / User Input Functions 9% Facilitator: Adding One Student 7% Facilitator: Dropping One Student Facilitator: Display Functions Displays menus options for choosing a courses, course management, and student management as specified. Prompts for user choice. Error checks choice, loops correctly, and exits correctly via menu choice. Prompts for all other (nonmenu) user input are clear. Error checks all user input, issues descriptive error messages, and re-prompts when necessary. Returns valid, correctly formatted values. Modifies data correctly. Checks if class is full before adding. Adds student data and increments count. Displays roster. Unless empty, prompts for id and verifies id entered is valid format. IF id found, deletes student from roster, decrements count, and displays confirmation message. Error message given if id is not in roster or course is empty. Functions to display course data and to display student ids implemented as specified. Minor issues with menu display, prompting, choice error checking, or looping. Minor issues with display, prompts, user input, error checking user input, error messages, formatting, or data modification. Minor issues with checking if full or adding student. Choices not displayed, OR format not validated, OR confirmation message not given, OR error message not given, OR other minor error. Minor issues with display functions. Many minor issues or one or more major issue(s) with menu display, prompting, choice error checking or looping. Many errors with display, prompting, user input, error checking user input, error messages, formatting, or data modification. Many errors with checking if full and/or adding student OR not implemented as a member function. Multiple problems with dropping a student OR not implemented as a member function. Major issues with display functions OR not implemented as member functions. Many major issue(s) with menu display, prompting, choice error checking or looping, which prevent correct usage. Program was not able to correctly read any user input or modify any data fields. Student could not be added. Students could not be dropped. Program does not produce any display from display functions.

Modularity (functional breakdown) 7% C++ Constructs / Readability / Miscellaneous Testing 5% Program is efficient, modular (at least 15 functions/methods), and logically organized. Each module performs ONE welldefined task and is defined and called correctly. main function does little more than call other functions. Demonstrates understanding of control, data, and file structures, and OOP classes and objects. All parameters passed correctly. Code is exceptionally well organized, easy to follow, and adheres to all CS362 coding standards for code usage (e.g. no use of break/return to exit a loop) Test description and data files allow for complete validation of the program code. Program is mostly efficient and modular in design, with most of the code logically organized. Contains minimum required number of functions, but may have an unnecessary function, a function that performs too many tasks, and/or a function that is incorrectly defined or called. A parameter or two was passed incorrectly (value vs. reference), OR unnecessary parameter(s) was passed, OR minor improper control or data structure or object usage, AND/OR some occasional spacing, indentation, and/or other minor organizational issues. Missing a couple of necessary tests. Multiple modules are unnecessary or perform too many tasks, OR parts of the program are not efficient and/or logically organized, OR one required function is missing, OR multiple problems with module definitions/calls. One or more major error(s), to include lots of incorrect parameter definition and usage, improper control or data structure or object usage, AND/OR substantial spacing, indentation, and/or other organizational issues. Missing many necessary tests. Program is somewhat modular, but the module breakdown is not at all efficient and/or logically organized. Demonstrates minimal understanding of object/control/data structures and/or proper parameter passing AND/OR major coding standard violations throughout, AND/OR other major organization, construct, or readability issues. Only used test data from assignment requirements, or no tests submitted. NOTE: Deductions for late submissions will be applied (-2% per day late) But programs will not be accepted if they are submitted more than 5 days late (0).