Sei sulla pagina 1di 14

C/C++ Mini Projects

Objectives:
After finishing the project, students are expected to be capable of:
 Utilizing basic control structures of C/C++ to implement algorithms for specific
problems.
 Initializing, manipulating and utilizing arrays / multi-dimensional arrays in
modeling data for solving problem.
 Manipulating strings of characters.
 Read and write from files.

Instructions
Mini projects are performed individually. Class will be split into teams; however, each
member is responsible for their own assigned questions. At the end of the class, mini
projects are merged by team into one working application.
Each mini project consists of a requirement and smaller questions to guide the
development effort. Try to solve these smaller questions first before tackling the
requirements.

Problem 1: Matrix Calculator


(Note to lecturer: This set of 8 mini projects focuses on testing the skills of students
on array manipulation and algorithms on array)
Matrix of order 𝑛 × 𝑚 is a table with n rows and m columns as follow:

Example:
Matrix has many different uses in science and engineering. For example, they can be
used to solve systems of equations. To make matrix calculation easier, develop a
simple matrix calculator that can perform following operations:

Mini project 1:
Input a matrix from file and check whether it is a diagonal matrix; given that diagonal
matrix is a square matrix with following form:

The matrix in input file has following structure:

Nga LT., 09/3/2019


Mini project 2:
Input a matrix from file (as in mini project 1) and check whether it is an upper
triagonal matrix; given triangonal matrix has following form:

Mini project 3:
Input a matrix from file (as in mini project 1) and check whether it is a lower triagonal
matrix; given that triangonal matrix has following form:

Mini project 4:
Input a matrix from file (as in mini project 1) and check whether it is a symmetric
matrix; given that symmetric matrix has following form:

Mini project 5:
Input a matrix from file (as in mini project 1) and check whether it is an anti-
symmetric matrix; given that anti-symmetric matrix has following form:

Mini project 6:
Input two matrices from file (each matrix follows the form in mini project 1), perform
the matrix addition between them and write results back to a text file; given that
matrix addition is perform as follow:

Nga LT., 09/3/2019


Mini project 7:
Input matrix from file (following the form in mini project 1) and a scalar value,
perform the matrix scalar multiplication between them and write results back to a text
file; given that matrix scalar multiplication is perform as follow:

Mini project 8:
(Note to lecturer: this question is more difficult than other ones)
Input two matrices from file (each matrix follows the form in mini project 1), perform
the matrix multiplication between them and write results back to a text file.
Matrix multiplication results in a scalar value as follow:

=>

Problem 2: ATM Machine


(Note to lecturer: This set of 4 mini projects focus on testing the skills of students
on file input-output and algorithms. This problem also gives student a glimpse of
relational database, through a simulation on files)
ATM (Automatic Teller Machine) is an electronic telecommunications device that
enables customers to perform financial transactions without the need for a human
cashier (bank teller). In this project, we will implement some core software
functionalities of an ATM with C/C++ programs.
Our ATM software uses three files to operate. These files will be provided.
Account information: account.txt file with following form.

ATM information: atm.txt file with following form. It shows the amount of money bills
that ATM is currently holding.

Nga LT., 09/3/2019


Transaction information: transaction.txt file with following form. It stores the
information about transactions (withdrawal and deposits) performed by users.

*Note that user IDs appearing in transaction file match with user ID in account.txt*

Mini project 1:
Provide mechanisms to build user account database and login function. User account
should be input from GUI or console interface and stored in the “account.txt” file with
stated structure. The login function will be performed through GUI or console interface;
and username and passwords will be checked with content in the “account.txt” file.
Bonus: perform the encryption on password by inversing order of text.

Mini project 2:
Provide a function to process the transaction file and calculate the account balance of
each user in the system. Noted that account balance equals to deposit amount minus
withdrawal amount.

Mini project 3:
Assume that account balance of user is sufficient to perform the transfer; provide a
GUI or console interface to let user specify the transfer and store the transaction inside
the transaction file.

Mini project 4:
(Note to lecturer: this is a lengthy and fairly difficult function)
Assume that account balance of user is sufficient to perform the withdrawal; create a
function to perform the withdraw activity. The function must check the requested

Nga LT., 09/3/2019


withdrawal amount to ensure that it is divisible by 50000. Function must also check
whether the amount of cash in ATM machine is sufficient to satisfy the request. The
ATM must select a way to return the money that maximize the number of high-value
bills.
For example: request for 1500000 VND should be satisfy with 3 x 500k bills, not 15 x
100k bills for 30 x 50k bills; unless there is not enough 500k bills.

Problem 3: Online Shopping


(Note to lecturer: This set of 6 mini problems focuses on testing the skill of students
with basic of C/C++ and file manipulation. It can also serves as an introduction to
relational database through simulation on file system)
Online shopping management is a common type of information system, especially with
students in Computer Science and Information Technology fields. In this problem, we
will build a very simple C/C++ programs to implement some functionalities of an online
shopping management system. To simplify the system, we will only store information
about orders of users and hide warehousing-related data.
Information in online shopping system is stored in 3 files.
User Information: account.txt

Product Information: product.txt. Note that “In-store” equals to the amount of product
available in the warehouse of the store.

Order Information: order.txt. Note that buyer ID matches with user ID in account.txt
and product ID matches with product ID in product.txt. The price of the product at the
time when order is placed is also stored in the order information.

Nga LT., 09/3/2019


Mini project 1:
Provide mechanisms to build user account database and login function. User account
should be input from GUI or console interface and stored in the “account.txt” file with
stated structure. The login function will be performed through GUI or console interface;
and username and passwords will be checked with content in the “account.txt” file.
Bonus: perform the encryption on password by inversing order of text.

Mini project 2:
Provide mechanisms to add a product into database and list all the products. Product
information should be input from GUI or console interface and stored in the
“product.txt” file with stated structure. Program must be able to list all products in the
product.txt to the user interface on demand.

Mini project 3:
Provide mechanisms to list all products in the database (product.txt file) and allow
user to delete a product from the system.

Mini project 4:
Provide mechanisms to list all products in the database (product.txt file) and allow
user to modify the price and in-store amount of a product.

Mini project 5:
Provide mechanisms to list all products in the database (product.txt file) and allow
users to add products and specify the amount into a new order. This new order must
be stored in order.txt file.

Mini project 6:
(Note to lecturer: This is a lengthy and fairly difficult question).
Provide a mechanism for store owner to modify content of an UNPAID order. Owner
should be able to see content of the order, with the product ID translated into product
information (for example: 1 – 2 – 50000 in order.txt should be shown as “Toy plane –
amount: 2 – price: 50000”). Owner should be able to add and remove items from the
order.

Nga LT., 09/3/2019


Problem 4: Quiz System
(Note to lecturer: This set of 6 mini problems tests the skills of student in file
management and algorithms involving arrays. It also gives a glimpse of relational
database through simulation on file system)
Quizzes consisting of multiple-choice questions are a common way to assess the
performance of students in a class. In this problem, we will implement a simple
electronic quiz system to make quiz taking easier and the scoring faster. To simplify
the development, we assume that no time limit will be imposed on the quiz.
Data in Quiz System is stored in 4 files
Student List: student.txt.

Question List: questions.txt

Quiz: quizzes.txt. Note that question IDs match with ID in question list (questions.txt)

Student Solution: solutions.txt. This file store the solution to quizzes submitted by
students. Note that the content has the form <question ID> - <student solution>

Nga LT., 09/3/2019


Mini project 1:
Provide mechanisms to build user account database and login function. User account
should be input from GUI or console interface and stored in the “student.txt” file with
stated structure. The login function will be performed through GUI or console interface;
and username and passwords will be checked with content in the “student.txt” file.
Program must be able to distinguish between student and lecturer.
Bonus: perform the encryption on password by inversing order of text.

Mini project 2:
Provide lecturer the mechanism to list all questions and add new question into the
list. Content of this question can be input from console or from a file.

Mini project 3:
Provide lecturer the mechanism to list all questions and modify an existing question.
Content of this question can be input form console or from a file.

Mini project 4:
Provide lecturer the mechanism to search for a question from test bank using a
phrase and remove it from the database.

Mini project 5:
Provide lecturer the mechanism to list all questions in the database and add them
into new a new quiz.

Mini project 6:
(Note to lecturer: This is a fairly lengthy and complex question)
Provide student a mechanism to answer a quiz. The quiz can only be selected before
the deadline. Submitted quiz cannot be done again. System should be able to show
the question to interface one-by-one and accept solutions from students. The results
are stored in solutions.txt file.

Nga LT., 09/3/2019


Problem 5: Library System
(Note to lecturer: This set of 5 mini problems tests the skills of student in file
management and algorithms involving arrays. It also gives a glimpse of relational
database through simulation on file system)
Library System is an information system managing books, book placement,
membership, book borrowing and various other aspects to ensure the normal
operation of a library. In this problem, we will develop basic C/C++ programs to
implement some core functionality of a library system. To simplify the development,
we will make assumptions that shelves in our library are identified by an integer ID,
and placement of books into shelves are not managed by our system.
Library System stores data in 4 files
Account information: account.txt. Each user of library must have an account in our
library system to borrow books. An account.txt file has following structure

Book title information: booktitle.txt. This file stores information about book titles
available in our library system. Note that this file does not store information about
individual copy of the book in the library.

Placement information: placement.txt. This file stores the placement of individual


copy of the book into shelves of our library. It also store information whether the book
is stored in the library or borrowed already.

Nga LT., 09/3/2019


Borrow information: borrow.txt. This file stores information about book borrowing of
user. Note the book ID in borrow information matches with book ID in book placement
information.

Mini project 1:
Provide mechanisms to build user account database and login function. User account
should be input from GUI or console interface and stored in the “account.txt” file with
stated structure. The login function will be performed through GUI or console interface;
and username and passwords will be checked with content in the “account.txt” file.
Bonus: perform the encryption on password by inversing order of text.

Mini project 2:
Provide mechanism for library manager to add list all book title available in the system
and add a new title into the list. This list of book title is stored in booktitle.txt file with
stated structure.

Mini project 3:
Provide mechanism for library manager to remove a book title from library, along with
all the books of that title in the library.

Mini project 4:
(Note to lecturer: this is a lengthy and fairly complex problem)
Provide a mechanism to store information about book borrowing. Assume that the
deadline to return a book for every user is two weeks. Each user can only borrow two

Nga LT., 09/3/2019


books at once. If user has an overdue book (hasn’t returned after the deadline), user
cannot borrow new book.

Mini project 5:
Provide a mechanism to store information about returning book. After a book is
returned, the corresponding entry in borrow.txt must be updated with “Returned: 1”.
Moreover, if the book is returned after the deadline, a note must be created to show
that user has violated the policy and must be fined.

Project 6: Caro Game


Material: Lanuage: C#

Mini project 1:
Creare caro board:
Video: https://www.youtube.com/watch?v=rnrNL1CT7TM
(Hint Using panal to create frame…)
Sourcode: http://www.howkteam.vn/course/lap-trinh-game-caro-voi-c-winform/tao-ban-co-game-
caro-c-winform-112

Mini project 2:
Change player:
Video: https://www.youtube.com/watch?v=zLML7SgxJ9M
Hint: how to store current player, change symbol of player…change background image, how
to find image?
http://www.howkteam.vn/course/tao-ban-co-game-caro-c-winform/xu-ly-doi-nguoi-choi-game-
caro-c-winform-113

Mini project 3:
Play game
How to know win/lost? Idea, check?: store all button in a matrix (2D??/ how to check in 2D
matrix?? Difficult?  No:) proposal: list in list?? Matix: 17x17: list in list? Index of list to 1D…
each button is stored which row???  https://www.youtube.com/watch?v=fJzhoE1NEr4
Source code: https://www.howkteam.vn/course/xu-ly-doi-nguoi-choi-game-caro-c-
winform/xu-ly-thang-thua-game-caro-c-winform-114

Mini project 4:
Timer countdown
How to use process bar? Combine time? How to use event?
https://www.youtube.com/watch?v=ebCGjYEnp4E
Source code: http://www.howkteam.vn/course/xu-ly-thang-thua-game-caro-c-winform/dem-
nguoc-thoi-gian-game-caro-c-winform-116

Mini project 5:
Create menu and Hotkey:

Nga LT., 09/3/2019


Video: https://www.youtube.com/watch?v=h67xGaPFgzY
Menu consists of New, Undo, and Quit? MenuStrip…
Sourcode: http://www.howkteam.vn/course/dem-nguoc-thoi-gian-game-caro-c-winform/them-
menu-va-hotkey-game-caro-c-winform-117

Mini project 6:
Undo task
Video: https://www.youtube.com/watch?v=OiMgB8RIqtU
How to store in stack?
Change player when active undo.
Sourcode: https://www.howkteam.vn/course/chuc-nang-di-lai--undo-trong-game-caro-c-
winform/chuc-nang-di-lai--undo-trong-game-caro-c-winform-118

Mini project 7:
Setup connect client and server and transmit a simple message
Video: https://www.youtube.com/watch?v=cEakhhjvP0k
How to check connection, transmissiont? IPv4? How to import library?using ipconfig to get
ip?
Using SerializeData  store string in byte (memoryStream)  return bytearray
Using DeserializeData  byte array to object.
SocketManager: create IP address, Port (iep), AddressFamily, SocketType, how to use try
catch …connect
Socket Server: server.bind(iep), listen(10), thread acceptClient( client=server.accept
create private link not public: …) using Thread( argument is object and return void)
accept.Clinet.IsBackground…. .Start…
Client connect: using public bool
Server connect
Private bool SenData (socket, byte): return target.Send(data)==1? true:false;
Private bool ReceiveData()
Source code: https://www.howkteam.vn/course/chuc-nang-di-lai--undo-trong-game-caro-c-
winform/tao-ket-noi-lan-2-nguoi-choi-game-caro-winform-120

Mini project 8:
Transmit chess in LAN: client to server and vice versa.
Transmit locate (x,y) client to server  board’s server
Transmit locate (x,y) server to client  client’s server
Video: https://www.youtube.com/watch?v=sFO59FuDtng
Source code: https://www.howkteam.vn/course/tao-ket-noi-lan-2-nguoi-choi-game-caro-
winform/hien-thi-quan-co-doi-phuong-mang-lan-game-caro-c-winform-121

Nga LT., 09/3/2019


Project 7: Candy crush game
Similar to Caro game, need 8 students.

Project 8:
Genetic algorithms
The objective of this algorithm is to provide optimisation over large space state. Unlike
traditional AI, they do not break on slight change in input or presence of noise. Application of
GA is: recurrent Neural Network, Mutation testing, Code breaking, Filtering and signal
processing, Learning fuzzy rule base

Mini project 1:
Fitness Score [https://www.geeksforgeeks.org/genetic-algorithms/]
A Fitness Score is given to each individual which shows the ability of an individual to
“compete”. The individual having optimal fitness score (or near optimal) are sought.

Mini project 2:
Asymptotic Analysis and comparison of sorting algorithms
[https://www.geeksforgeeks.org/asymptotic-analysis-comparison-sorting-algorithms/]

The compared following algorithms: 1.Insertion sort: The traditional algorithm with
no modifications/optimisation. 2.Merge sort: the divide-and-conquer approach. For
input sizes of the order 10^5 this algorithm is of the right choice. It renders insertion
sort impractical for such large input sizes. 3. Combined version of insertion sort
and merge sort. 4.Quick sort: This is the library function qsort() which is available,
etc.

Project 9:
Linked list [https://www.geeksforgeeks.org/data-structures/linked-list/]

Mini project 1:
Singly Linked list

Mini project 2:
Circular Linked list

Mini project 3:
Doubly Linked List

Mini project 4:
Misc

Mini project 5:
Quick Links

Project 10: Detection/Blur


Mini project 1:
Face Detection [https://www.geeksforgeeks.org/opencv-c-program-face-detection/]

Nga LT., 09/3/2019


Mini project 2:
Coin Detection [https://www.geeksforgeeks.org/opencv-c-program-for-coin-detection/]

Mini project 3:
Blur an image [https://www.geeksforgeeks.org/opencv-c-program-to-blur-an-image/]

Mini project 4:
PortScanner [https://www.geeksforgeeks.org/creating-a-portscanner-in-c/]

Project 11: indoor localization


Real system: hardware and software: Language: C and Python. Need 3 students.
(IoT club and supported device by instructor).

Nga LT., 09/3/2019

Potrebbero piacerti anche