Tải bản đầy đủ (.pdf) (7 trang)

Assignment lists (group projects)

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (285.53 KB, 7 trang )

Course: Introduction to Programming Languages (C language)
Course ID: CO1003

Assignment 1: Customer Relationship Management
In this assignment, you are asked to write a customer relationship management program in an
enterprise.
A customer is defined as a person or another enterprise that has a commercial transaction with the
enterprise.
Each customer is described by the information recorded as: customer identifier, customer name,
contact phone, contact address, city, starting date.
- Customer identifier is a unique identifier defined by a sequence of 8 digits "1", "2", ..., "9". A valid
identifier is 34299218.
- Customer name is a written name defined by a sequence of characters "a" or "A", "b" or "B", ..., "z" or
"Z", and blank (space) characters if any. A valid name is "Nguyen Van An" or "PSV".
- Contact phone is a phone number defined by a sequence of 12 digits "1", "2", ..., "9". A valid phone
number is 840932725715.
- Contact address is a sequence of 200 characters, digits, blank (space), and comma (,) characters if any
in total. A valid address is "268 Ly Thuong Kiet Street, District 10, HCMC".
- City is the city or province where a customer is located. It is a sequence of characters "a" or "A", "b" or
"B", ..., "z" or "Z", and blank (space) characters if any. A valid city is "Ho Chi Minh".
- Starting date is the date when a customer had the first commercial transaction with the enterprise. A
valid date is "13/01/2017".
The enterprise records the commercial transactions of each customer as follows:
Each commercial transaction has its unique identifier, its customer identifier, its type, its value, its detail
list, its processing date.
- Unique identifier of each transaction is also a sequence of 8 digits.
- Customer identifier is a value referencing to the identifier of the customer conducting the transaction.
- Type is the transaction type including "whole", "retail", "other".
- Value is the total amount of money transferred in the transaction.
- Detail list includes the product details sold in the transaction.


1


- Processing date is the date when the transaction is made between the customer and the enterprise. If
the transaction is the first transaction between the customer and the enterprise, this date becomes the
starting date in the record of the customer.
Each product detail includes product identifier, product name, product model, quantity, unit price.
- product identifier is also a sequence of 8 digits.
- product name is a sequence of characters "a" or "A", "b" or "B", ..., "z" or "Z", and blank (space)
characters if any. A valid product name is "HP printer".
- product model is a sequence of 100 characters, digits, blank (space), and comma (,) characters if any in
total. A valid product model is "LaserJet Pro P1102".
- quantity is the number of the products sold.
- unit price is the price of each product sold.
With the given data about customers, transactions, and their products, the enterprise wants to retrieve
the following information for business:
(i). List the most valued customers who have the maximum number of the transactions with the
maximum values.
(ii). List the most valued products which were purchased in the transactions with the maximum values.
(iii). List the products which were purchased the most in terms of quantity.
(iv). List the most valued cities where there are the highest number of the most valued customers.
(v). Given a transaction type, list the details of all the transactions in this type, grouped by product
names in ascending order.
Requirements: Write a C program with the following subtasks for customer relationship management.
Each subtask needs to check the constraints appropriately for validity.
1. Define data structures for each object type in the program: customer, transaction, product.
2. Write a menu that supports users to populate sample data for each object type and their
connections. Their data can be input from files and need to be checked appropriately according
to their descriptions. After that, write a menu to support a user to select what information to be
retrieved for business. Process the user’s selection and output the results appropriately to the

user.
3. Write functions to support requirement (i).
4. Write functions to support requirement (ii).
5. Write functions to support requirement (iii).
6. Write functions to support requirement (iv).
7. Write functions to support requirement (v).
2


Group: 4 students. It is noted that we use the same groups in our in-class activities.
Grading:
-

Modularized program: 15%
Coding style: 10%
Report for teamwork activities and the work: 10%
Subtask 1: 15%
Subtask 2: 10%
Subtask 3: 5%
Subtask 4: 10%
Subtask 5: 5%
Subtask 6: 10%
Subtask 7: 10%

3


Assignment 2: Social graphs
In this assignment, your group is asked to support a user to discover knowledge hidden in social graphs.
A social graph is a graph including nodes and edges. Each social graph represents relationships between

members of a given community. Each member is represented as a node in a social graph. Each member
has a unique identifier, a name, a gender, and his/her hobbies. Hobbies are captured in terms of listed
keywords like “reading books”, “watching movies”, “playing tennis”, “chatting”, … If a member is a
friend of another member, there is a connection between these two members which is an edge in a
social graph. Each edge is associated with a positive integer number showing how many messages these
two members have exchanged. It is supposed that a social graph is implemented as a matrix of real
numbers. Each row or column represents a member. Each value at cell(i, j) in this matrix represents a
connection between member i and member j. Its value is equal to or greater than zero. A zero value
indicates that there is no friend relationship between member i and member j while a greater than zero
value indicates the number of messages that have been exchanged between member i and member j. In
addition, there is no need to capture the connection between member i and him/herself, leading to
zeros for the values at cell(i,i). It is realized that the matrix is symmetric. Knowledge hidden in a social
graph can be discovered as follows:
(i). Given a social graph represented by an aforementioned matrix, calculate and print the total sum of
the number of messages exchanged by the members in the community of the social graph, calculate and
print the connections that have the number of exchanged messages higher than the averaged one in the
community.
(ii). Given a social graph represented by an aforementioned matrix, calculate and print the information
of the members that have the highest number of connections with the other members in the
community, calculate and print the information of the members that have the highest number of
exchanged messages with the other members in the community.
(iii). Given a social graph represented by an aforementioned matrix, find the longest friend list in the
community. Print the information of each member in that longest friend list.
(iv). Given a social graph represented by an aforementioned matrix, find the friend list in the community
that has the highest exchanged messages between the members. Print the information of each member
and the number of exchanged messages in that list.
(v). Given a social graph represented by an aforementioned matrix, find the most influential members in
the community. The most influential member is defined as a member that is involved in the connections
with the highest number of exchanged messages in the community. Print the information of the most
influential members in the community.

(vi). Given a social graph represented by an aforementioned matrix and a given list of hobbies, find the
maximum connected groups of the members that share the same hobbies in the given list.

4


Requirements: Write a C program with the following subtasks for knowledge discovery in such social
graphs. Each subtask needs to check the constraints appropriately for validity.
1. Define the data structures to represent each member in the community and their social graph.
2. Write a menu to support a user to input the information of each member and their connections.
Their data can be uploaded from files. Validity of each input needs to be checked. After that,
write a menu to support a user to select what knowledge discovery requirement to be done.
Process the user’s selection and output the results appropriately to the user.
3. Write functions to support requirements (i) and (ii).
4. Write functions to support requirement (iii).
5. Write functions to support requirement (iv).
6. Write functions to support requirement (v).
7. Write functions to support requirement (vi).
Group: 4 students. It is noted that we use the same groups in our in-class activities.
Grading:
-

Modularized program: 15%
Coding style: 10%
Report for teamwork activities and the work: 10%
Subtask 1: 5%
Subtask 2: 10%
Subtask 3: 10%
Subtask 4: 10%
Subtask 5: 10%

Subtask 6: 10%
Subtask 7: 10%

5


Assignment 3: Library for sets of numbers
In this assignment, your group is asked to build a mathematical library for manipulations on sets of
numeric values of a given data type which is char, int, or double. The functions are required for this
library as follows:
(i). Given an array of numeric values, check if it is a valid set.
(ii). Given a valid set S of numeric values, print all the members of S in ascending order.
(iii). Given a valid set S of numeric values, print all the members of S in descending order.
(iv). Given a valid set S of numeric values and a number n, check if n is a member of S.
(v). Given two valid sets S1 and S2, check if S1 is equal to S2.
(vi). Given two valid sets S1 and S2, check if S1 is a true subset of S2.
(vii). Given two valid sets S1 and S2, find an union of S1 and S2.
(viii). Given two valid sets S1 and S2, find an intersection of S1 and S2.
(ix). Given two valid sets S1 and S2, find a difference of S1 from S2.
(x). Given a valid set S1 of numeric values and a number n, find a set S2 including all n members of S1. If
more than one set S2 can be generated from S1, find the maximum subset S2, which is the one that has
the greatest total sum of n members.

Requirements: Write a C program with the following subtasks for this library. Each subtask needs to
check the constraints appropriately for validity.
1. Build a menu to support a user to load the inputs of numeric values of one data type among the
three listed above data types and select what kind of calculation he/she wants to conduct on
these sets and numeric values. The program will return results to the user with respect to
his/her selection. You should be careful with equality comparisons on double values.
2. Write functions to support requirement (i).

3. Write functions to support requirements (ii) and (iii).
4. Write functions to support requirement (iv).
5. Write functions to support requirements (v) and (vi).
6. Write functions to support requirements (vii), (viii), and (ix).
7. Write functions to support requirement (x).
Group: 4 students. It is noted that we use the same groups in our in-class activities.
Grading:
-

Modularized program: 15%
Coding style: 10%
Report for teamwork activities and the work: 10%
6


-

Subtask 1: 10%
Subtask 2: 5%
Subtask 3: 10%
Subtask 4: 5%
Subtask 5: 10%
Subtask 6: 15%
Subtask 7: 10%

7




×