This repository contains projects developed as part of Harvard's CS50 course. Each project showcases key programming concepts in C, including algorithms, data structures, and user interaction. Explore various applications, from credit card validation to games, to enhance your programming skills and understanding of computer science fundamentals. Harvard CS50 Projects
A collection of programming projects from Harvard's renowned CS50: Introduction to Computer Science course, which introduces foundational computer science concepts through hands-on programming challenges in C. Each project covers key programming concepts and problem-solving techniques, offering a practical approach to learning.
Projects Overview Hello – The first program, where users are introduced to the basics of C programming. This simple "Hello, World!" exercise is designed to teach the essentials of compiling and running C code, working with strings, and getting familiar with the development environment.
Mario – Inspired by the classic video game Super Mario Bros., this project challenges users to build a pyramid of bricks using nested loops and control structures. It introduces fundamental concepts in iteration and formatting output.
Cash – A program that calculates the minimum number of coins required to make change for a given dollar amount. This project applies greedy algorithms, exploring efficiency and optimal decision-making in programming.
Caesar – An implementation of the Caesar Cipher encryption technique, where users provide a plaintext and a key to output an encrypted message. This project covers the basics of encryption and modular arithmetic in string manipulation.
Scrabble Score – This project calculates scores for words as in the game Scrabble, based on the point value of each letter. Players input words, and the program calculates their scores, emphasizing arrays, loops, and conditionals.
Runoff – A simulation of an instant-runoff voting system. It manages multiple candidates and implements elimination rounds to determine a winner. This project focuses on data structures and algorithms for handling complex voting systems.
Plurality – Another voting system program, based on plurality voting rules. It tallies votes and identifies the candidate(s) with the most votes, introducing concepts in structuring and processing data arrays.
Credit – A program that checks the validity of credit card numbers using Luhn’s algorithm. It identifies card types like Visa, MasterCard, and American Express based on their structure and properties.
Key Concepts Covered Algorithms and Data Structures – Sorting, searching, and efficient data handling with arrays and custom structs. Encryption – Basic cryptographic techniques like the Caesar Cipher. User Input and Validation – Building programs that handle and validate user input. Loops and Conditionals – Mastery of control structures like if-statements, for-loops, and while-loops for iterative problem-solving. Modular Design – Emphasis on creating modular functions that handle specific tasks for reusable code. Getting Started Clone this repository and compile the code using a C compiler, such as clang. Note that some projects use CS50’s custom library, so installing this library may be necessary for certain input and string functions.
Each project folder contains detailed comments in the code, explaining the logic and approach to achieve the final result.
Acknowledgments These projects are part of the coursework from Harvard's CS50 course, designed and taught by David J. Malan. CS50 is globally recognized for its inclusive, comprehensive approach to teaching computer science, welcoming students from all backgrounds.