FAST-NUCES · Fall 2022 · CS1002

Programming Fundamentals – Semester 1 (C++)

My complete first-semester collection for Programming Fundamentals – course and lab. Lecture slides, lab manuals, assignments, quizzes, solved exams, reference books, practice code and my final project, organised the same way I used them during the semester.

Language: C++ Semester: 1st FAST-NUCES Fall 2022 Latest release License: MIT
35Lectures
14Labs
17Home works
155PDF documents
26C++ source files
344Files in total

Overview

When I started BS CS my files were scattered across WhatsApp, Google Classroom, my laptop and a couple of USBs. This repository puts the whole Programming Fundamentals semester together – in the same folder layout I used – so anyone taking PF (or me, when revising) can find things quickly.

Course

CS1002 – Programming Fundamentals

35 lectures from “what is a program” to pointers and dynamic memory.

Lab

CL1002 – PF Lab

14 lab manuals, the lab quiz and the lab final exam.

Assessments

Assignments, quizzes & exams

Statements and solutions, Sessional 1 & 2, the final and past papers.

Project

Karachi Stock Market

A console stock market simulator written in plain C++.

Course Lectures 1–35

Open a group to see every file in it. Each file opens on GitHub, where PDFs preview right in the browser.

Lec 01–04Basic StructuresComputers and programs, program design, algorithms, flowcharts, first C++ programs, namespace std, linker notes and board photos.
Lec 05Data TypesPrimitive types, variables, constants, arithmetic operations and strings.
Lec 06Input / Output and Operatorscin and cout, assignment and compound operators.
Lec 07–08Formatting and Type CastingFormat manipulators like setw and setprecision, implicit and explicit casting.
Lec 09Relational & Logical OperatorsRelational, logical and bitwise operators with precedence.
Lec 10–12Control Structuresif, if-else, nested if, switch and an introduction to repetition.
Lec 13–18Loops & Increment Operatorfor, while, do-while, nested loops, number systems, memory map and negative numbers.
Lec 19–21FunctionsPrototypes, parameters, return values, pass by value and by reference, sorting.
Lec 22–27Arrays1D and 2D arrays, parallel arrays, searching, sorting, arrays with functions, character arrays.
Lec 28File Handlingifstream, ofstream and fstream for reading and writing text files.
Lec 29–31PointersPointer basics, pointer arithmetic, dynamic memory with new and delete, recursion.
Lec 32–35Number Systems & Memory MappingBinary, octal and hex conversion, memory map, addresses, two's complement.

Final Project – Karachi Stock Market

A console stock market simulator for the Karachi Stock Exchange, written in plain C++ with arrays, functions and file handling.

Live market board

Prices refresh with up/down markers and colours, plus high, low, top advancer, top decliner and total volume.

Personal portfolio

Add money, buy, sell and withdraw, with gain and loss shown in green and red.

Rules and validation

15% daily price cap, invalid symbol and insufficient balance checks.

File handling

Companies load from companies.txt and the portfolio is saved to portfolio.txt.

Practice Code

Small programs and dry-run sheets I worked through while learning loops, arrays, strings and functions, plus a small Visual Studio solution kept as it was.

36 filesPractice CodesC++ programs, notes and practice sheets

Folder Structure

Folder structure
PF_Repository/
├── Programming Fundamentals Course CS/
│   ├── Assignments/
│   ├── Exams/
│   │   ├── Final Exam Solution (Course)/
│   │   ├── Sessional # 01 Solution/
│   │   ├── Sessional # 02 Solution/
│   │   └── PF_Past_Papers.zip
│   ├── Final Project/
│   │   └── KarachiStockMarket_PF/
│   ├── Home_Works/
│   ├── Lecture # 01-04 (Basic Structures)/
│   ├── Lecture # 05 (Data Types)/
│   ├── Lecture # 06 (Input-output and Operators)/
│   ├── Lecture # 07-08 (Type_Casting)/
│   ├── Lecture # 09 (Relational & Logical Operators)/
│   ├── Lecture # 10-12 (Control Structures)/
│   ├── Lecture # 13-18 ( Loops & Increment Operator)/
│   ├── Lecture # 19-21 (Functions)/
│   ├── Lecture # 22-27 (Arrays)/
│   ├── Lecture # 28 (File Handling)/
│   ├── Lecture # 29-31 (Pointers)/
│   ├── Lecture # 32-35 (Number Systems & Memory Mapping)/
│   ├── PF Book/
│   ├── Practice Codes/
│   └── Quizes/
├── Programming Fundamentals Lab/
│   ├── LAB # 01 … LAB # 14/
│   ├── LAB QUIZ/
│   └── PF LAB FINAL EXAM/
├── assets/
├── docs/COURSE_OUTLINE.md
├── index.html
├── LICENSE
└── README.md

How to Compile and Run

Any modern C++ compiler works – g++, clang, MSVC, Dev-C++, Code::Blocks or Visual Studio.

Clone the repository

Command
git clone https://github.com/rohaan2802/PF_Repository.git

Compile a practice program with g++

Command
cd "Programming Fundamentals Course CS/Practice Codes/Practice"
g++ -std=c++17 Input_Matrix.cpp -o Input_Matrix
./Input_Matrix

Files ending in .c++

Command
g++ -x c++ Swapping.c++ -o Swapping

Final project (Windows)

Command
cd "Programming Fundamentals Course CS\Final Project\KarachiStockMarket_PF"
build.bat
run.bat

The final project uses the Windows console API, so it is meant to run on Windows. In Visual Studio, open Practice Codes/PRCTC/Project1.sln and press Ctrl + F5.

License

The C++ code I wrote (practice codes and the final project) is under the MIT License. Lecture slides, lab manuals, assignments and exam papers belong to their instructors at FAST-NUCES, and the books belong to their authors and publishers. They are shared here only for learning and revision.