You are on page 1of 6

SKTK1533 Introduction to Computer Programming 20192020-1

PROJECT 1: SHIPPING COST (POOL 1: G1, G2, G3, G4, G5)


The cost of shipping a package by two different courier company according to the
following price schedule:

Company A: Speed Postage


Weight
Type of Service
0 – 1kg 1 – 5kg More than 5 kg
Ground $1.18 + $0.45 for $4.96 +$0.72 for
(5-7 days) $0.70 + $0.50/kg every additional every additional
100g 200g
Express $4.20+$1.20 for $15.20+$1.90 for
(3-4 days) $2.40 + $1.80/kg every additional every additional
100g 200g
Overnight $18.60+$4.20 for $61.80 + $6.40 for
(One day) $12.20 + $6.40/kg every additional every additional
100g 200g

Company B: Express Rakyat


Weight
Type of Service
0 – 1kg 1 – 5kg More than 5 kg
Ground $1.50 + $0.41 for $5.80 + $0.65 for
(5-7 days) $1.00 + $0.45/kg every additional every additional
100g 200g
Express $6.10+$1.10 for $20+$1.70 for
(3-4 days) $4.50 + $1.30/kg every additional every additional
100g 200g
Overnight $20.20+$3.90 for $65.50 + $6.30 for
(One day) $15.20 + $6.10/kg every additional every additional
100g 200g

Write a program to calculate the cheapest shipping cost for a customer so that she/he
can decide which courier company to use. The program asks the user to enter the type
of service (Ground, Express, or Overnight) and the weight of the package. The
program then displays the cost for the shipment for both type of courier service
company, and suggest the most economical courier service company.

Test the program for the following cases:


(a) Ground 2.67 kg
(b) Express 0.96 kg
(c) Overnight 5.26 kg
SKTK1533 Introduction to Computer Programming 20192020-1

COMPUTER PROGRAMMING PROJECT GUIDELINE

PROJECT DESCRIPTION

Develop a program based on the given topic. The program must apply all the
knowledge in this course. It must contain all the item i-iv, but not limited to,

i. Script file
ii. Function file
iii. Multiple Input – Output styles
iv. Structured programming – decision/loops or both

REPORT WRITING GUIDELINE

1. Use Times New Roman with font size 12 and 1.15 spacing.
2. Add caption for each figure and table

Prepare the report based on the content outline below.

1. Cover page
2. Report Outline
3. Project description
4. Algorithm
5. Flowchart
- Draw the flowchart (suggested to use MS Visio)
6. MATLAB Programming
- Explain the input style and indicates the location in the m.file
- Explain the output style, show at least an example and indicates the
location in the m.file
- List down the name of the script and function files.
7. Case Studies:
a. Case 1:
i. Problem Definition
ii. Result – snapshot the picture of the command window that
contain your result
b. Case 2:
i. Problem Definition
ii. Result - snapshot the picture of the command window that
contain your result
c. Case 3:
i. Problem Definition
ii. Result - snapshot the picture of the command window that
contain your result
8. Conclusion
9. Appendices
i. Script file codes
ii. Function file codes
SKTK1533 Introduction to Computer Programming 20192020-1

Presentation guideline

1. Project description
2. Algorithm and flowchart
3. MATLAB program (no need to show all program)
a. Input – give an example for each input style applied in the program
b. Output - give an example for each output style applied in the
program
c. Function file – give example where apply for function file
4. Case studies – show the problem and snap picture of command window
with result

SUBMISSIONS

1. Hardcopy: Report. In order to promote sustainable practices in this class,


the hardcopy report must be printed in black and white, double sided,
staple (no spiral bind) with no plastic covered.
2. Softcopy: Report, Script and function files (m.files). Submit softcopy files
through e-learning.
3. Due date of submission: Dec 2020, before 4.30pm.
4. Marks will be deducted if violate any item 1-3.
SKTK1533 Introduction to Computer Programming 20192020-1

PROJECT 2: Heat capacity (POOL 2: G6, G7, G8, G9)

The temperature dependence of the heat capacity of many gases can be described
as below:
2 2
𝐶 𝐸
𝐶𝑝 = 𝐴 + 𝐵 [ ] +𝐷[ ]
𝑇𝑠𝑖𝑛ℎ(𝐶 ⁄𝑇) 𝑇𝑐𝑜𝑠ℎ(𝐸 ⁄𝑇)

The following table gives the coefficients of the cubic equation for each gas, Cp is in
J/(kmol.K) and T is in K.

Gas A B C D E Tmin Tmax


SO2 33375 25864 932.8 10880 423.7 100 1500
CO2 29370 34540 1428 26400 588 50 5000
N2 29105 8614.9 1701.6 103.47 909.79 50 1500
CH4 33298 79933 2086.9 41602 991.96 50 1500

Write a program that does the following:


• Prints all the available gases on the screen and asks the user to select which
gas to find the heat capacity for.
• Asks the user for a temperature.
• Asks the user if another temperature is needed (enter yes or no). If the
answer is yes, the user is asked to enter another temperature. This process
continues until the user enters no.
• Display the output of the temperatures entered, and the corresponding heat
capacities in table format.

Test the program for determining the heat capacity of


a. CO2 at 100oC and 180oC.
b. N2 at 220oC and 300oC
c. CH4 at 100oC, 150oC, 200oC, 270oC
SKTK1533 Introduction to Computer Programming 20192020-1

PROJECT DESCRIPTION

Develop a program based on the given topic. The program must apply all the
knowledge in this course. It must contain all the item i-iv, but not limited to,

i. Script file
ii. Function file
iii. Multiple Input – Output styles
iv. Structured programming – decision/loops or both

REPORT GUIDELINE

Prepare the report based on the content outline below.

1. Cover page
2. Project description
3. Algorithm
4. Flowchart
 Draw the flowchart (suggested to use MS Visio)
5. MATLAB Programming
 Explain the input style and indicates the location in the m.file
 Explain the output style, show at least an example and indicates
the location in the m.file
 List down the name of the script and function files.
6. Case Studies:
 Case 1:
i. Problem Definition
ii. Result – snapshot the picture of the command window that
contain your result
 Case 2:
i. Problem Definition
ii. Result - snapshot the picture of the command window that
contain your result
 Case 3:
i. Problem Definition
ii. Result - snapshot the picture of the command window that
contain your result
7. Conclusion
SKTK1533 Introduction to Computer Programming 20192020-1

SUBMISSIONS

1. Report – Hardcopy and softcopy. In order to promote a sustainability


practice in this class, the hardcopy report must be printed in black and
white, double sided, staple (no spiral bind) with no plastic covered.
2. Script and function files (m.files) – softcopy. Submit a softcopy of both script
and function file in dot m (.m) format through e-learning.
3. Due date: Dec 2019, before 4.30pm. Mark will be deducted for late
submission.

You might also like