Welcome to my C++ Projects Showcase! This repository is a collection of C++ projects that demonstrate my programming skills and abilities.
-
ArraySort
- Description: The
ArraySort
module is a C++ header file that contains a versatile template function namedMedian
. This function calculates the median value of an array of elements, making it useful for a wide range of data analysis tasks. - Difficulty: Moderate
- Folder:
/ArraySort
- Description: The
-
CircleMath
- Description: The "CircleMath" module provides a set of utility functions for performing calculations related to circles and points in a two-dimensional plane. These functions are designed to assist with common geometric tasks:
double Distance(double x1 = 0, double y1 = 0, double x2 = 0, double y2 = 0)
calculates the distance between two points(x1, y1)
and(x2, y2)
using the Euclidean distance formula.int OnCircle(double xCenter, double yCenter, double radius, double xPoint, double yPoint)
determines the relationship between a point(xPoint, yPoint)
and a circle with center(xCenter, yCenter)
and radiusradius
. It returns-1
if the point is inside the circle,0
if the point is on the circle, and1
if the point is outside the circle.bool OnLine(double x1, double y1, double x2, double y2, double x3, double y3)
checks if three points(x1, y1)
,(x2, y2)
, and(x3, y3)
are collinear (lie on the same straight line). It returnstrue
if the points are collinear andfalse
otherwise.
- Difficulty: Moderate
- Folder:
/CircleMath
- Description: The "CircleMath" module provides a set of utility functions for performing calculations related to circles and points in a two-dimensional plane. These functions are designed to assist with common geometric tasks:
-
DateValidator
- Description: The "DateValidator" module includes a collection of functions for date validation and manipulation. It offers the following features:
bool LeapYear(int year)
: Checks if a given year is a leap year.int LastDayOfMonth(int month)
: Returns the last day of a given month.int LastDayOfMonth(int month, int year)
: Returns the last day of a given month, accounting for leap years.bool ValidDate(int month, int day, int year)
: Validates a date, ensuring it falls within the expected range.void NextDate(int & month, int & day, int & year)
: Calculates the next date from a given date.void PreviousDate(int & month, int & day, int & year)
: Calculates the previous date from a given date.
- Difficulty: Moderate
- Folder:
/DateValidator
- Description: The "DateValidator" module includes a collection of functions for date validation and manipulation. It offers the following features:
-
FrequencyOfChars
- Description: The "FrequencyOfChars" module is a C++ program for analyzing the frequency of characters in text files. It provides the following functions:
int maxFrequency(int charFrequency[])
: Finds the maximum frequency of characters.int minFrequency(int charFrequency[])
: Finds the minimum frequency of characters.int numMinFrequencies(int charFrequency[])
: Counts the number of characters with the minimum frequency.int numMaxFrequencies(int charFrequency[])
: Counts the number of characters with the maximum frequency.void printMaxFrequencies(int charFrequency[])
: Prints characters with the maximum frequency.void printMinFrequencies(int charFrequency[])
: Prints characters with the minimum frequency.void printBarChart(int charFrequency[])
: Prints a bar chart representing character frequencies.void printFrequencyTable(int charFrequency[])
: Prints a frequency table in descending order.
- Difficulty: Moderate
- Folder:
/FrequencyOfChars
- Description: The "FrequencyOfChars" module is a C++ program for analyzing the frequency of characters in text files. It provides the following functions:
-
LengthUnitConversion
- Description: The "LengthUnitConversion" module provides a versatile C++ class named
Length
for performing unit conversions between inches and centimeters. This class allows you to:- Initialize a
Length
object with a value and units (default is 0 inches). - Set the units to either inches or centimeters.
- Convert between inches and centimeters.
- Perform addition, equality checks, and comparisons between
Length
objects.
- Initialize a
- Difficulty: Moderate
- Folder:
/LengthUnitConversion
- Description: The "LengthUnitConversion" module provides a versatile C++ class named
-
NumericalAndCharacterCounter
- Description: The "NumericalAndCharacterCounter" module is a C++ program that analyzes user input and counts the number of alphabetical and numerical characters entered. It also detects invalid characters and terminates when specific punctuation marks are encountered.
- Difficulty: Easy
- Folder:
/NumericalAndCharacterCounter
-
OperationalAndRelationalChecker
- Description: The "OperationalAndRelationalChecker" module is a C++ program that quizzes users on their knowledge of arithmetic and relational operators. It presents arithmetic and relational expressions and evaluates whether they are correct. Users can play multiple rounds and receive a score based on their performance.
- Difficulty: Moderate
- Folder:
/OperationalAndRelationalChecker
-
PointerProblem
- Description: The "PointerProblem" module demonstrates the use of pointers in C++ and includes two implemented functions:
void Merge(SortedDynamicArray * const array1, const SortedDynamicArray * const array2)
: Merges two sorted dynamic arrays while removing duplicates.void Print(const SortedDynamicArray * nums)
: Prints the elements of a sorted dynamic array.
- Note: The
Merge
function was implemented by nblevins, and thePrint
function was implemented by bhipp. - Difficulty: Moderate
- Folder:
/PointerProblem
- Description: The "PointerProblem" module demonstrates the use of pointers in C++ and includes two implemented functions:
-
QuestionalValidator
- Description: The "Question Validator" project is designed to validate various types of questions commonly used in educational assessments and quizzes. It provides a comprehensive toolset to verify the correctness and format of different question types, including:
-
True/False Questions: This component assesses whether a true/false question adheres to the correct format, ensuring that it has a clear statement and a valid answer of "True" or "False."
-
Short Answer Questions: The short answer question validator checks if the question contains a complete and well-structured prompt and validates student responses based on specific criteria, such as word count or keywords.
-
Multiple Choice Questions: For multiple choice questions, the validator confirms that each question has a precise and consistent format with clear answer choices. It also checks the validity of answer selections.
This project aims to assist educators, content creators, and students in ensuring the accuracy and quality of educational questions. By automating the validation process, it helps reduce errors and ensures that questions meet established standards for clarity and correctness.
- Difficulty: Moderate
- Folder:
/QuestionalValidator
- SetTesting
- Description: The "SetTesting" project involves a C++ template class named
Set
designed to represent a set of distinct objects. It supports various set operations, including union, intersection, and equality checks. TheSet
class is implemented with methods for managing and manipulating sets of any data type. The project also includes a comprehensive set of test cases to validate the correctness of theSet
class's functionality. - Difficulty: Moderate
- Folder:
/SetTesting
-
StatementFactCheck
- Description: The "StatementFactCheck" project introduces the
FactCheckedStatement
class in C++ for verifying and representing statements. This class ensures that statements begin with a capital letter and end with a period. It also allows users to assign a truth value (between 0.0 and 1.0) to the statement. The project includes overloads for the assignment operator and the output stream operator, enabling users to set and display fact-checked statements with their corresponding truth values. - Difficulty: Moderate
- Folder:
/StatementFactCheck
- Description: The "StatementFactCheck" project introduces the
-
StringFunctions
- Description: The "StringFunctions" project includes C++ functions for string manipulation. It provides functions for counting the number of digits in an integer, as well as finding and replacing specific digits within an integer. These functions ensure valid inputs and allow for the replacement of single or double-digit values in an integer. The project offers flexibility in digit replacement and can handle both positive and negative integers.
- Difficulty: Moderate
- Folder:
/StringFunctions
-
Weather and Time
- Description: The "Weather and Time" project encompasses two distinct components. First, it includes the implementation of the
Temperature
class in C++, allowing you to work with temperature values and units (Celsius, Fahrenheit, Kelvin). This class provides methods to set temperature values and units and print temperature information. Second, it features theTimeOfDay
class, which enables you to work with time values, including hours, minutes, and seconds. The class provides methods to set these components and print time in both 12-hour and military formats. It includes default values for initialization and customization options for displaying seconds and choosing between 12-hour and military time. - Difficulty: Moderate
- Folder:
/WeatherAndTime
- Description: The "Weather and Time" project encompasses two distinct components. First, it includes the implementation of the