Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 3.15 KB

File metadata and controls

66 lines (53 loc) · 3.15 KB

C++ Practice Questions & Codility Proofs

Overview

This repository contains solutions to a set of C++ practice questions. Each question is implemented in its own source file (e.g., question1.cpp, question2.cpp, etc.) and is designed to help reinforce fundamental C++ programming concepts such as input/output, arrays, functions, control flow, and more. These exercises are ideal for beginners or anyone looking to strengthen their C++ basics.

Additionally, the repository includes a folder of screenshots as proof of completion of a separate Codility lesson focused on Data Structures and Algorithms (DSA). These screenshots are unrelated to the C++ practice questions but serve as evidence of DSA proficiency.

Project Structure

  • question1.cpp to question6.cpp: C++ source files, each containing a solution to a different practice question.
  • CMakeLists.txt: Build configuration for CMake.
  • cmake-build-debug/: Directory containing build outputs and executables.
  • codility-screenshots/: Contains screenshots as proof of completing a Codility DSA lesson (not related to the C++ questions).

Setup Instructions (Windows)

Prerequisites

  • CMake (version 3.10 or higher recommended)
  • A C++ compiler (e.g., MSVC, MinGW, or Clang)

Build Steps

  1. Open a terminal (PowerShell) and navigate to the project directory:
    cd C:\Users\janny\CLionProjects\CPP-DSA
  2. Create a build directory (if not already present):
    mkdir cmake-build-debug
    cd cmake-build-debug
  3. Run CMake to configure the project:
    cmake ..
  4. Build the project:
    cmake --build .

Running the Executables

After building, you will find executables (e.g., question1.exe, question2.exe, etc.) in the cmake-build-debug directory. To run a specific solution:

./question1.exe

Replace question1.exe with the desired executable.

File Descriptions

  • question1.cpp: Program to calculate the number of seconds in a user-specified number of days.
  • question2.cpp: Program to compute the volume of a sphere given its radius.
  • question3.cpp: Program using functions to compute the area and perimeter of a square.
  • question4.cpp: Program using functions to determine if a character is uppercase or lowercase.
  • question5.cpp: Program translating a pseudocode loop and arithmetic logic into C++.
  • question6.cpp: Program to input 5 values into an array and calculate their average.

Note: Each file contains a comment at the top describing the specific practice question it solves.

codility-screenshots Folder

This folder contains screenshots as proof of completing a Codility lesson focused on Data Structures and Algorithms. These are not related to the C++ practice questions but are included as evidence of DSA learning and achievement.

Additional Notes

  • The project is intended for educational purposes and C++ practice.
  • Ensure your compiler supports at least C++11 (C++17 recommended).
  • If you encounter build issues, verify your CMake and compiler installations.

Feel free to contribute or modify the solutions as needed!