Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This project is a part of my CSE 1101 course. In this project, I was asked to simulate a mobile recharge system using scratch cards. The admin will generate random cards for the existing packages. These cards will then be provided to the shops. Users will buy the cards by paying the required amount of money.

Notifications You must be signed in to change notification settings

idcnys/CSE1101_Assignment_2403142

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

68 Commits

Repository files navigation

CSE 1101 Assignment (1-1)

How to use?

  • demo.mp4 explains the user interface. See video
  • just compile and run app.c
  • Admin password is 61770

Resources

  • I used some ANSI COLORS to style the terminal output. #define RED "\x1b[31m" ... #define RESET "\x1b[0m" It's very simple to use printf("\n" GREEN "Colored String" RESET "\n "). Source

Folder structure

  • It should exactly look like this to make the programs work properly.
  • 404 command will automatically erase/update the files. We don't need to manually clear them.
  • Image

User Interface

- App
Image


-Admin Panel
Image


- User panel

This project is for educational purpose only.

Function Explanations

Core System Functions

  • _SETUP()
    Creates directories and files. Initializes default values. First-time setup.

Card Management

  • generateCardAndAppend()
    Generates random card numbers. Saves to appropriate file.
  • removeCard()
    Deletes specific card from FreshCards.
  • deleteCard()
    Finds and removes card by number.
  • deleteDialog()
    UI for card deletion options.

Admin Functions

  • unblock()
    Removes number from blocked list.
  • showBlockList()
    Displays all blocked numbers.
  • unlockAccount()
    Unblocks user account.
  • showStatistics()
    Displays sales and stock data.
  • showHistory()
    Shows all transactions.
  • searchUserTransaction()
    Finds transactions by phone number.

Transaction Processing

  • updateSold()
    Increments sold card count.
  • updateAdminBalance()
    Updates admin's balance.
  • commitRecharge()
    Validates and processes card recharge.

User Functions

  • showMinutes()
    Displays user's remaining minutes.
  • updateBalance()
    Updates user's minute balance.
  • isBlocked()
    Checks if user is blocked.
  • logOut()
    Clears current session.
  • clientPanel()
    Main user interface handler.

Utilities

  • formatDate()
    Converts timestamp to readable format.
  • resetCurrentNumber()
    Clears current user session.
  • checkIfBlocked()
    Verifies if current user is blocked.

Main Interfaces

  • adminPanel()
    Admin control interface.
  • showDialog()
    User menu interface.
  • main()
    Entry point with role selection.

About

This project is a part of my CSE 1101 course. In this project, I was asked to simulate a mobile recharge system using scratch cards. The admin will generate random cards for the existing packages. These cards will then be provided to the shops. Users will buy the cards by paying the required amount of money.

Topics

Resources

Stars

Watchers

Forks

Languages

AltStyle によって変換されたページ (->オリジナル) /