Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

EM2301. Practical Class 2

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

INTRODUCTION TO APPLIED COMPUTING FOR

BUSINESS AND ECONOMICS


Practice Class 2
Save file as: Prac2.Hovaten.MSSV.Thu
Ex 1:

Dates Year Month Day of month Day of week


1/29/2003
12/22/1919
6/12/1973
8/3/1914
2/15/1983
11/11/1992
11/8/1940
8/9/1944
1/17/1986
1/3/1996
7/19/1925
6/8/1969
12/3/1941
3/4/1911
1/8/1936
8/2/1982
10/26/1966
1/13/1958
11/15/1908

Requirement:
1. Determine the month, year, day of the month, and day of the week for each date (type 1 =
Sunday, 2 = Monday…).
2. Express each date in serial format such as 08-Jan-2021.

Ex 2:
The below data table contains dates on which several machines were bought and sold.
1. Determine how many months and years each machine was kept.
2. Create “Real working days” of for each type of machines (assuming no holidays and that
Monday-Friday are the workdays).
3. Create “Retire date” for operators that always lists the next 30 workdays since Sold date
(assuming no holidays and that Monday-Friday are the workdays).
4. Format the table

Bought Sold Months kept Years kept Real Working days Retire date
4/27/12 8/22/13 =Yea
12/1/12 9/4/14
7/30/13 5/13/15
7/10/13 3/15/15
11/17/19 7/22/22
1/2/20 7/3/23
1/18/17 2/3/21
10/6/18 1/7/22
9/10/17 9/23/19
4/11/16 2/10/20
11/7/22 10/8/23
1/14/14 12/21/16
11/19/13 7/16/16
8/26/20 5/9/24
12/30/15 11/7/16
12/25/22 1/8/27
6/29/16 8/17/19
9/7/14 10/31/16
2/18/11 12/26/11
8/11/18 8/17/21
4/4/22 7/14/24

Ex 3:
Given the call data as follow

DATE START END PROVINC


E
10-Feb 13:00:5 13:45:56 BDG
5
20:17:5 20:39:01 DTP
0
8:15:20 8:58:10 AGG
12:00:5 13:02:56 DTP
8
20:17:5 21:19:01 DTP
0
8:15:20 8:28:10 HNI
20:12:5 22:19:01 AGG
0
13:00:5 13:02:56 BDG
5
20:18:5 20:59:01 DTP
0
7:15:20 8:28:10 BDG
14:18:1 15:20:26 AGG
7

Requirement:
1) Fill the Date series by month increasing.
2) Calculate the hours, minutes, and seconds of each call
3) Convert to the number of minutes to calculate fee, format with a hundred separator.
4) UNIT PRICE: unit price based on PROVINCE
Province Unit price (VND/min)
AGG 1100
BDG 1000
DTP 1100
HNI 3250
5) Format table.

Ex 4:
Given data as follow:

SCORE
Regional
ID NAME
Code CN1 CN2 CN3 TOTAL

D201 Nguyễn Thái Nga 8 7 6


D202 Trương Ngọc Lan 7 8 9
N103 Lý Cẩm Nhi 8 9 8
D404 Lưu Thùy Nhi 4 5 7
D105 Trần Thị Bích Tuyền 9 6 6
N206 Phạm Thị Hương 7 8 6
Requirement:
1. Extract the regional code from column ID, given that the second character displays the regional
code.
2. Calculate column Total: Total = CN1 + CN2 + CN3 + PA (With: PA is 1 if regional code is 1,
PA is 0,5 if regional code is 2, else PA is 0
3. Insert column “Scholarship type”. where:
- Type = A if Total >= 24 and no subject is less than 8
- Type = B if:
Total >= 24 and no subject is less than 6
Or Total >= 22 and no subject is less than 6 and PA is 1
- Others is Type C
4. Calculate scholarship based on scholarship type A, B, C
Scholarshi
Type
p
A 2000000
B 1000000
C 500000

5. Format table

Ex 5:
Given data in Table Car tenant:

Customer Rent Date Return Date Car type

Nguyễn Thái Nga 1/20/2018 1/30/2018 004

Trương Ngọc Lan 1/1/2018 1/5/2018 007

Lý Cẩm Nhi 1/20/2018 1/28/2018 007

Lưu Thùy Nhi 1/18/2018 1/25/2018 004

Trần Thị Bích Tuyền 1/2/2018 1/26/2018 004

Requirement:
1) Calculate Rent Day = Return Date – Rent Date
2) Convert Rent Day to number of weeks and days
Example: If Rent Day is 10 days then we convert to 1 week and 3 days.
3) Calculate Fee, given:
Fee = Week x Week Unit price + Day x Day Unit price
WEEK 3,200,000
Renting Unit price
DAY 500,000
And each customer gets a 5% discount if renting more than 1 week. (equal and greater than 1
week).
4) Calculate Total for column Rent Day, Week, Day and Fee
5) Format table

You might also like