In this article, I want to share the capstone project from my Introduction to Computer Science course in college.
We used C++ to explore the fundamentals of programming languages.
Reviewing the repository containing the project files will be incredibly useful for anyone taking their first steps with C++ and seeking a comprehensive project that integrates all the individual building blocks into a cohesive whole.
tigerbluejay
/
CPlusPlusDeveloperEssentialPackage
C++ Computer Science Fundamentals Projects: From Data Types to Object Oriented Architecture. Gerogetown University – Introduction to Computer Science I Project – Summer 2016
Introduction to Computer Science I (Georgetown University – Summer 2016)
This repository contains four C++ projects (and sample pseudocode for one of them).
Project 1 and Project 1 Pseudocode files cover:
basic data types, the C++ string class, variables and constants, input/output (cin/cout) operators,
assignment operators, arithmetic operators, conditional control structures
Project 2 files cover:
Topics in Project 1 + repetition control structures, basic file operations
Project 3 files cover:
Topics in Projects 1-2 + user-defined functions, value and reference parameters,
elementary software engineering principles, the vector class,
Project 4 files cover:
Topics in Projects 1-4, constructor, function and operator overloading, accessors, mutators, code optimization
The project is divided into four distinct files representing 25%, 50%, 75%, and 100% of the course progress. While the folders are named Project 1, Project 2, Project 3, and Project 4, each folder corresponds to a different stage of the same project. When I uploaded the files to GitHub, I referred to each stage as a “Project” for simplicity, but you can think of each successive folder as a stage that builds upon the previous one. Thus, Project 4 builds on Project 3, Project 3 builds on Project 2, and so on.
Feel free to review the files in each folder. Within each folder, the main code files are named jmi34P1.cpp for Project 1, jmi34P2.cpp for Project 2, jmi34P3.cpp for Project 3, and jmi34P4.cpp for the final project. You will also find additional ancillary files in each folder, but the core files listed above contain the central logic.
Summary Projects 1 and 2
This application serves as a comprehensive tool for processing, validating, and analyzing manufacturing orders for cones and frustums (used for lamp shades). It prompts the user to input a file containing shape order data, such as shape type, dimensions, color, and closure status. The program uses predefined constants and validation checks to ensure all inputs fall within acceptable ranges. Invalid inputs, such as incorrect shape codes, color codes, or dimension values, are flagged and reported, while valid records proceed to detailed geometric and cost-based calculations.
User-friendly messages and tables guide the user through the process, ensuring clarity and ease of use. For each valid shape record, the program calculates key geometric properties, including lateral surface area, top and base surface areas, total surface area, and derived parameters like slant heights and angles. It then computes the raw material cost and sales price based on these metrics, adding a markup for profit. Invalid records are excluded from these calculations but still documented in the output.
The program maintains cumulative totals for surface areas, costs, and sales prices, separately aggregating data for cones and frustums to generate summary statistics and averages. The application concludes by presenting a detailed summary report in a well-formatted table, showing total and average surface area, raw material costs, and sales prices for both cones and frustums. It also includes counters for the total number of records processed, the number of valid cone and frustum records, and the number of records containing errors.
Summary Projects 3 and 4
In Projects 3 and 4, the logic and structure are adjusted to incorporate more advanced concepts from the introductory computer science course. At the core of the application is the Shape class, which encapsulates information about each manufactured object. This includes order details, dimensions (radius1, radius2, height), shape code (C for cone, F for frustum), color code, and other relevant attributes. The class provides member functions to calculate geometric properties (such as surface area, generating functions, and angles), as well as cost and price.
The application presents a user-friendly menu with options to load data from a file, generate a summary report by region, and generate a summary report by shape. The loadData function reads data from the specified file, validates the input, and creates a vector of Shape objects. The summaryByRegion function calculates and displays the total surface area, cost, and price for each region (North, South, East, West, Other), along with averages across all regions. Similarly, the summaryByShape function calculates and displays the same metrics for cones and frustums separately.
Topics Covered in Each Project
Project 1: Covers basic data types, the C++ string class, variables and constants, input/output (cin/cout) operators, assignment operators, arithmetic operators, and conditional control structures.
Project 2: Builds on the concepts from Project 1, adding repetition control structures and basic file operations.
Project 3: Builds on the concepts from Project 2, introducing user-defined functions, value and reference parameters, elementary software engineering principles, and the vector class.
Project 4: Builds on the concepts from Project 3, adding constructors, function and operator overloading, accessors, mutators, and code optimization.