Best programming practices

Thank you first for reading my post. I have my final data structure and algorithms project coming up and I really want to do a great job and have this as something I can put on my resume to demonstrate my skills. The problem is I haven't really found any good resources in regards to structuring my code from start to finish. In this I am referring to (as an example) is it best to have a destructor before or after a constructor, having my accessors after or before my modifiers? I know there is a great book I haven't read yet "writing clean code" that would help me in this situation. I will post my guidelines and then my proposal I sent to my professor. Any advice or ways to make it better in terms of my choice in data structures, templates or anything would be greatly appreciated.

Final Project
Your final project is to create a program using multiple data structures and algorithms learned during the semester. The program should either solve a problem or simulate something in the real world. For example, we have written programs to simulate a store and to play a game. Your program must be more extensive than any single assignment to date.
Deadlines
Turn in your program (all source code) by the end of the final exam period (Tuesday, May 14th, 9:00PM). During the final exam period, you will give a presentation on the problem you chose and how you solved it using data structures and algorithms.
Type up and submit a short description of what you plan to do for your project by the end of Wednesday, April 17th for the instructor's approval. It should include the purpose of the program and how you might use data structures/algorithms (see requirements below) in that program.
Additional milestones may be added and given as assignments.
Requirements
Following are requirements for your final project:
Include at least one class you create to represent object(s) critical to your application. For example, we have used classes to represented a product, game board, etc.
Store data in both dynamic arrays and linked lists.
Include at least one template class that you write.
Use at least one of the following data structures: stack, queue or tree*.
Use at least one container from the Standard Template Library (STL).
Use at least one template function from the STL (header <algorithm>).
Involve both searching and sorting.
Be broken up into .h and .cpp files appropriately.
Be well documented (explain any calculations and algorithms that are not immediately obvious).
*Substitutions can sometimes be made, especially if you wish to use a more sophisticated data structure.
You may use code from the book, lectures or assignments in your data structures and algorithms, but you must write the class needed to represent critical objects (item 1. above) on your own. Reference the source of any code used. A "sufficient" amount of the code should be completely your own (i.e., not borrowed from somewhere); however, an exact percentage cannot be given. As usual, students are not allowed to collaborate with others.
Submission
You must complete the C++ program in Visual Studio 2017 or Visual Studio Express 2017 (the latter is downloadable from microsoft.com). Name your project something appropriate in Visual Studio and rename the outermost folder to Final Project (What-You-Decide-To-Call-It) Your Name. Turn in the entire project folder (bring on your flash drive) during the final exam period.
Grading
The project will be graded on a 20-point scale (this final project is 15% of your course grade). Your presentation will be a portion of that grade. You are encourage to go beyond what we learned in class. Projects that show valuable extra work may receive bonus points.
Final Project - CSI218 - Spring 2019
Quincy College - Robert I. Pitts


Jason Glenn
Data Structure and Algorithms
Project Proposal

“Showcase DeGlenn”

My project will be based off a simulation of a movie theater experience. The goal is to simulate the process of going to the movies with a grouping of their own choose. I will implement different data structure and algorithms to help realize and bring this experience to a somewhat real world basis. I will describe my preliminary outline of what I will use and how they will be implemented within my program.
Since my program will be based of a movie theatre location so shall my class name be called “Showcase”. I will use pointers to implement a dynamic array that the user will set as the size of their party. The objects will hold the person’s age group (child, adult, senior) which will also have the accurate amount of money for each grouping. This is where my own template class will be used “Concession(naming is a work in progress)”. The next part of the program will go through and allow each person to go to the concession stand and order various food items. In each instance the order will always be repeated back in a linked list. This will allow the person to add or take of from their respective order. Going through this so far the group as a whole will be going through a queue to simulate being in line. I would love to implement a timer that would eliminate the use of the user to press anything to go through the line, however if not I will put in the feature to manually go through the line.
Vectors will be used to make the seating plan for the theatre. This may be too ambitious to make a variable size arrangement to dictate a deluxe, to regular seating plan. With that I will like to try and randomly put in available and unavailable seating so the user will have to pick around the seating accordingly. I think random seating will make each experience for this part unique. This leads me into using the distance template function in STL algorithms to count the seating to check if there is enough room or no for the whole group. Once again this may be a little ambitious but if the group can not fit allow the separation of the group to different seating. I am not sure if this qualifies for the searching criteria of the project, if not I will revise. The sorting will be based off of either name, time, or rating.
This is the scope that I would like to do as the culmination of my programming experience to date. I truly think that this will test me in being able to creatively start a project from beginning to end while learning how to best structure and layout proper code. Obviously feedback is always welcome and appreciated, out of all my professors you know my skills the best and can properly judge my goal to my current skill level.


Once again thank you for any advice, recommendations or any information/resources you think would help to make this as professional looking as possible
The Zeroeth suggestion: Write some code that attempts to solve the assignment criteria. Have problems or questions? Post the code, ask questions and tell us what is going wrong.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <cctype>
#include <limits>

int main()
{
   std::cout << "Do you want someone to do all the work for you? ";
   char answer{};
   std::cin >> answer;

   std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

   if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; }

   else { std::cout << "Show what you have coded so far.\n"; }

   std::cout << "Good luck.\n";
}
Professional looking comes after getting it working. Give yourself some time to clean it up afterwards.

have some fun with the seating. What do people do at the movies? The majority go for the center, not the sides, and about 1/3 of the way back so they don't have to look up to see the screen. Looks like a bell curve from statistics... an normal distribution.. maybe...?
They also avoid sitting next to other people if it isnt crowded, but a group that comes in together sit together...

you have time, so do it right. Design your objects and flow on paper first. Identify what you want from the problem description. Then build / stub it together to see if the flow and objects work as expected. Then start filling in details, solving one part of the problem at a time, from the inside out based off what is needed ... that is, if x needs y, you make y first.

Last edited on
is it best to have a destructor before or after a constructor, having my accessors after or before my modifiers?
"Process" is a seductive, but poor, substitute for "competence." It's oh-so-easy to worry about where to put your accessors/constructors/destructors and which case to use for variables and just how to indent your code etc. etc., but in the end, these things don't matter and they just serve to help you procrastinate. So concentrate on getting the code designed right.

For the concession stand, you need one class/collection that describes the items and their prices. You need a separate collection that describes an individual's order.

Searching for places to seat the group will be an interesting problem. I'd try to describe this algorithm on paper before you write code. Consider some of the edge cases like when the group size exceeds the number of seats in a single row. Also consider edge cases like when the number of seats available is less than the size of the group.
These are great suggestions thank you. I do know I am procrastinating, I also know it's because I'm afraid of failure and maybe the realization that I as a programmer am not where I should be and that I have much more to learn and understand. I am going to paper prototype first, keeping in mind like you said about edge cases and figuring out the objects, data that is needed, then start coding the parts I know I can get working before some of the harder problems I have to solve. Once again thank you to everyone!!
Topic archived. No new replies allowed.