0% found this document useful (0 votes)
148 views

SCP1103 Programming Technique C SEMESTER I 2007/2008: Universiti Teknologi Malaysia

SCP1103 PROGRAMMING TECHNIQUE C SEMESTER I 2007 / 2008 Part A: Flowcharts Draw your flowcharts using Microsoft (r) Visio. Describe each flowchart about its purpose, input and output and the processes involved.

Uploaded by

Chee Wung
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views

SCP1103 Programming Technique C SEMESTER I 2007/2008: Universiti Teknologi Malaysia

SCP1103 PROGRAMMING TECHNIQUE C SEMESTER I 2007 / 2008 Part A: Flowcharts Draw your flowcharts using Microsoft (r) Visio. Describe each flowchart about its purpose, input and output and the processes involved.

Uploaded by

Chee Wung
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

UNIVERSITI TEKNOLOGI MALAYSIA

SCP1103
PROGRAMMING TECHNIQUE C

SEMESTER I 2007/2008

ASSIGNMENT 1
FLOWCHARTING

Student’s Name:
NGO CHEE WUNG
IC NO
881116-08-5265

YEAR & COURSE


1SEL
SECTION 04
Lecturer’s Name:
MR. FARHAN MOHAMED

DATE OF SUBMISSION
12 AUGUST 2007

2
Part A: Flowcharts
Draw your flowcharts using Microsoft ® Visio ™ and then “copy-and-paste” them
into this part. Describe each flowchart about its purpose, input and output and the
processes involved. Below are two examples.

Flowchart : Main Flowchart


Name
Purpose : Computing Car loans of customer
Input :PRICE, INSTALLMENT, YEARS,
Output :PRINCIPAL LOAN, RATE, INTEREST, TOTAL LOAN, SCHEDULE

START

PRICE = Car_Price ( )

DISCOUNT = Discount ( PRICE )

INSTALLMENT = Car_Installment ( PRICE )

PRINCIPAL LOAN = Principal_Amount _Of_ Loan


( PRICE, INSTALLMENT )

YEARS = Loan_Duration_In_Year ( )

RATE = Interest_Rate_Per_Year ( YEARS )

INTEREST = Total_Interest
( PRINCIPAL LOAN, RATE, YEARS )

TOTAL LOAN = Total_Amount_Of_Loan


( PRINCIPAL LOAN, INTEREST )

3
2

Print
PRINCIPAL LOAN
YEARS
RATE
INTERESTS
TOTAL LOAN

SCHEDULE = Payment_Schedule
( YEARS, TOTAL LOAN )

Yes
START OVER
1
Repeat The
Process ?

Y
e

END

4
Flowchart : Function Definition of “PRICE = Car_Price ( ) ”
Name
Purpose : To enter the car price
Input : a ,car price
Output : acceptable car price

Car_Price ( )

Read a: Car price


No
a

If
10,000< a < 50,000

Yes

Return a

5
Flowchart : Function Definition of “ DISCOUNT = Discount ( PRICE )”
Name
Purpose : To Check for the discount
Input : a ,car price
Output : s: Car price after discount

Discount ( a )

Read
a

Initialize
p = 1000

If a ≥ 25,000

No
Yes

s=a–p s=a
s: car price after discount
a: car price

Return s

6
Flowchart : Function Definition of “INSTALLMENT = Car_Installment
Name ( PRICE ) ”
Purpose : To Check the installment
Input : c, installment
Output : acceptable installment

Car_Installment ( s )

Read
c: car installment
No
c s:car price

If
c ≥ o.1 s

Yes

Return c

7
Flowchart Name : Function Definition of “PRINCIPAL LOAN =
Principal_Amount _Of_ Loan
( PRICE, INSTALLMENT )

Purpose : To calculate the principal amount of loan
Input : s: car price after discount & c: installment
Output : d:Principal amount Of Loan

Principal_ Amount_Of_loan
( s,c )

Read
s,c

d=s–c d : principal amount of loan


s: car price
c: car installment

Return d

8
Flowchart : Function Definition of “YEARS = Loan_Duration_In_Year ( )”
Name
Purpose : To check the loan duration in years
Input : e : loan duration (years)
Output : acceptable loan duration

Loan_Duration_In_Year ( )
Interest_Rate_Per_Year ( e )

No Read
e : loan duration in year
e

If
2≤e≤7

Yes

Return e

9
Flowchart Name : Function Definition of “RATE =
Interest_Rate_Per_Year ( YEARS )”

Purpose : To calculate the interest rate of loan


Input : e : loan duration (years)
Output Read : er:: loan
Interest rate
duration in year per year

No

No No
2≤e≤4 5≤e≤6 e=7

Yes Yes Yes

r = 4.8 % r = 5.5 % r = 6.0%

Return r
Interest Rate (per year)

H = ( Counter / e ) * d * r
h =H+h

10
Flowchart : Function Definition of
Name
“INTEREST = Total_Interest ( PRINCIPAL LOAN, RATE, YEARS )”
rate
Purpose : To calculate the total interest
Input : r: interest rate , d: amount of loan , e: year of loan
Output : h: Total interest

Total_Interest ( r, d ,e )

Read
r ,d , e

Initialize h = Total interest


Counter = e e: Loan duration in year
h =0 r:interest rate per year

H: Interest rate at
particular year

No
If
Counter = Counter -1
Counter = 0

Yes

Return h

11
Flowchart : Function Definition of
Name “TOTAL LOAN = Total_Amount_Of_Loan
( PRINCIPAL LOAN, INTEREST )”

Purpose : To calculate the total loan


Input : d: Principal amount of loan ,h: total interest ,
Output : I: Total Loan

Total_Amount_Of_Loa
n ( d, h )

Read d: principal amount of loan


d,h h: total interest
i: total Amount Of Loan

i =d + h

Return i

Flowchart : Function Definition of


Name “SCHEDULE = Payment_Schedule
( YEARS, TOTAL LOAN ) ”
Purpose : To print payment schedule
Input : i: total amount of loan ,e: number of years
Output : m:Payment schedule

12
Payment Schedule ( i , e )

k : average payment
k = i / ( 12 * e ) i : total amount of loan
e: loan duration in years

Read
i,k

Initialize
Month = 1
Payment = k
Balance = i – k

Print Month
Print Payment
Print Balance

No
If Month = Month + 1

Balance = 0 Payment =k
Balance = i – ( Month * k )

Yes

Return m m = payment schedule

Part B: Reflections
You are expected to have completed Part A before going on to this part. The
purpose of this part is to determine whether you have achieved the objectives of
this assignment. Answer the following questions. The score for each question is
as indicated. If you prefer to answer in Bahasa Malaysia, you may do so.

Question 1
Do you think having many functions in an algorithm is a good idea? Explain why. [3
marks]
13
Answer:
I agree it is a good idea. This is because it becomes easier more easy to find
solution when we consider it as pieces of small problems. Hence, it is easier to
design the algorithm. Besides, it makes the flowchart look nicely and
systematically. The system can run smoothly and not complicated.

Question 2
Explain how you applied “Thinking in modular ways” in this assignment. [3 marks]

Answer:
Thinking in modular way enable me design the flowchart creatively I consider each
requirement as module. First, I understand the problem as whole. Than, break into
simpler and understandable parts. After that, I sketch various of method to solve
the problem and choose the most suitable. Furthermore, I use actual parameter
main flowchart and forma parameter in function definition. By looking these
variables, one is able to combine the main function with its definition. As a result,
he or she can undertand the main function as well.

Question 3
As stated in the course planning, you are expected to have a mini project later.
You will do the project in a group of 3 persons.

The tasks are supposed to be distributed to the team members. However, you
may think it is more difficult to do the project separately, since it is a single
program. Hence, you decide to do it together.

On the other hand, you may think your job is easier if the tasks are distributed
equally to all the team members. However, when it comes to the integration,
sometimes you will get troubled. What your members have done cannot be
combined with yours or vice versa.

Those two scenarios are common problems when working in a team.

Explain how you will apply “Thinking in modular ways” in an appropriate manner
for your future group assignment in order to overcome those kinds of problem. [4
marks]

Answer:
First of all, we will choose the group leader among us. Than we start plan the
schedule and task due to the assignment together. Task are devided equally
among us to avoid argument. Since we are work in a group, each member will do
some part f the assignment. Besides, we will collect the contact number each of
our members. Its important as we can discuss through the phone if we face with
urgent problems. Apart from that, we can found the variety of resources from
library as our references. We also can consult with lecturer if we not clear of the
requirements of the assignment. Group discussion are done frequently as to speak
out the problems that occurred. Hence, we can find the varies of solution among
group member. Group leader has to make sure that everyone do their work
according to the schedule. Each of the group member should respect to others and
makes contributes to it .Teamwork is the only key to gain success in our works.

14
Part C: Log Book
As you work with your assignment, record the activities you have done. At a
minimum, you are expected to write when you have started the assignment, what
activities have involved and when you have submitted the assignment. Fill in the
following table. You are also expected to write the names of your friends or
persons who you have had discussions with;. Fill in the “Discussion with” column.

Date Time Venue Description of Activity Discussion


with
30/07/07 3.00pm- N28 • Listen to the briefing from Mr. Farhan
5.00pm lecturer C. C. Choo
• Start to plan the solution J. C.. Koey
for the problem K.W. Chee
• Form my group to work
together

02/08/07 8.00pm PSZ • Print out the assignment C. C. Choo


10.00pm Library • Check with friends about J. C.. Koey
the solution K.W. Chee
04/08/07 8.00am KTC’s • Read again the problem
12.00pm hostel • Think for the algorithm to -
solve it
• Sketch the flow chart
manually
05/08/07 8.00am KTC’s • Compare my friends about C. C. Choo
9.00am hostel my flowchart J. C.. Koey
• Test run on the system K.W. Chee
07/08/07 8.00am N28 • Present my flowchart to my Mr. Farhan
10.00am lecture.
• Learn from mistake
• Make corrections
08/08/07 8.00pm KTC’s • Make mind map about the -
10.00pm hostel solution in part B,C,D.
10/08/07 8.00am KTC’s • Redraw the flowchart in C. C. Choo
12.00pm hostel computer J. C.. Koey
• Retest the system again
13/08/07 10.00am KTC’s • Upload my assignment 2 -
hostel

15
Part D: Estimated Scores
You are expected to have completed Part A – C before going on to this part. In this
part, you will assess your own assignment. However, the score from the
assessment will not be taken. The idea behind this self assessment is to promote
you to full fill the requirements of the assignment as good as possible in order to
get a better grade.

Guides to assessment:

Scale Column:
How good is your answer for each of the following criterion? Please rate yourself
according to these scales:

9- 10 : Excellent
7–8 : Good
5–6 : Average
1–4 : Bad

Score Column:
Fill in the column using this formula:
Score = Max_Score x Scale x 0.1

Total:
Calculate the summation of all scores from the Score Column.

Example:
Main Flowchart: Scale= 8 Score=5 x 8 x 0.1 = 4

Max Scal
Criterion Scor e Scor
e (1- e
10)
Report:
Part A: Flowcharts
Main Flowchart 5 10 5
Requirement 1: car price 5 10 5
Requirement 2: discount 5 10 5
Requirement 3: installment 5 10 5
Requirement 4: loan amount 5 10 5
Requirement 5: the number of 5 10 5
years
Requirement 6: interest rate 10 9 9
Requirement 7 : total interest and 5 10 5
total loan
Requirement 8: loan information 5 10 5
Requirement 9: payments schedule 20 9 18
Requirement 10: start over 5 10 5
Part B: Reflections 10 8 8
Part C: Log Book 5 10 5
Part D: Estimated Scores 5 8 4
Post-Mortem Survey* 5 10 5
Total 94

*You are entitled to get a full score for Post-Mortem Survey as long
you fill in all the questions

16

You might also like