Skip to content

SwiftTuition/Structures_and_File_Processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CP143: Structures and File Processing - Practice Exercises

Open in GitHub Codespaces

Swift Tuition Practice Exercises

This repository contains 5 practice exercises for learning Structures and File Processing in C programming.

πŸš€ Quick Start

Option 1: Open in GitHub Codespaces (Recommended)

  • Click the badge above to launch a fully configured development environment
  • Compiler and all tools pre-installed
  • Start coding immediately in your browser

Option 2: Clone Locally

git clone https://github.com/SwiftTuition/CP143-Structures-Exercises.git
cd CP143-Structures-Exercises

πŸ“¦ Exercises Included

  1. Exercise_01: Product Inventory System (Easy)

    • Structure basics and syntax
    • Arrays of structures
    • Searching and updating records
  2. Exercise_02: Student Database (Medium)

    • Sequential file I/O with structures
    • Reading and writing text files
    • Statistical calculations
  3. Exercise_03: Bank Account Manager (Medium)

    • Random-access file processing
    • Binary file I/O
    • Direct record access with fseek
  4. Exercise_04: Contact Book System (Medium)

    • CRUD operations (Create, Read, Update, Delete)
    • Menu-driven interface
    • File persistence
  5. Exercise_05: Library Management System (Hard)

    • Complete integrated system
    • Multiple data structures
    • Transaction processing

πŸ’‘ How to Use

  1. Read the README in each exercise folder
  2. Open the .c file and locate the TODO comments
  3. Implement the required functions
  4. Compile and test:
    cd Exercises/Exercise_01
    gcc exercise_1.c -o exercise_1
    ./exercise_1

πŸ› οΈ Compilation

Using GCC:

gcc exercise_X.c -o exercise_X
./exercise_X

Using Codespaces:

  • Terminal is already set up with GCC
  • Just compile and run as shown above

πŸ“ Tips for Success

  • Start with Exercise 1 and progress sequentially
  • Test frequently as you write code
  • Don't forget to close files with fclose()
  • Always check if fopen() returns NULL
  • Use sizeof() for structure sizes in file I/O

✨ Good day, good people - Happy Coding!

Created by Swift Tuition for CP143 students at Stellenbosch University.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages