Bcs1023-Programming Techniques 1415

Embed Size (px)

Citation preview

  • 8/18/2019 Bcs1023-Programming Techniques 1415

    1/6

    U n i v e r s i t i

    M a l a y s i a

    P H N G

    Engineering • Technology • reativity

    FACULTY OF COMPUTER SYSTEMS

    SOFTWARE ENGINEERING

     

    FINAL EXAM INATION

    COURSE

    COURSE CODE

    LECTURER

    DATE

    DURATION

    SESSION/SEMESTER

    PROGRAMME CODE

    PROGRAMMING TECHNIQUES

    BCS1O23

    ADZHAR BIN KAMALU DIN

    SURYANTI B INTI AWANG

    22 JUNE 2015

    3 HOURS

    SESSION 201 4/2015 SEM ESTER II

    BCSIBCNIBCG

    INSTRUCTIONS TO CANDIDATE:

    This question paper co nsists of

    THREE 3)

    questions Answer ALL questions

    2

    W rite your answers in the answer booklet provided

    3

    Answer EAC H question on a new page

    4

    All calculations and assumptions must be clearly show n

    EXAM INATION REQUIREME NTS:

    NONE

    DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO

    This exam ination paper consists of

    SIX 6)

    printed pages including the front page

  • 8/18/2019 Bcs1023-Programming Techniques 1415

    2/6

    CONFIDENTIAL

     

    CS BCNII3CG 1415111BCS1023

    QUESTION 1

     

    2 Marks]

    A log file for network acc ess for a particular day by UM P students from their college is shown in

    Figure 1. The log file consists of information of the college start time and end time of the acc ess

    and the data type of the access. The start time and end time is recorded using 24-hours clock

    system. ICT Centre of UMP has to produce a report as their daily task. The report consist of

    college name total time access per college and total cost per college. The cost is calculated by

    multiplying the access duration and the datatype. If the data type is A which is audio the cost is

    RM O.20 per minutes. If the data type is V which is video the cost is RMO.35 per minutes. If the

    data type is T which is text the cost is RMO.01 per minutes.

    OLLEGE

     

    T P TTIME

     

    N TIME

     

    T TYPE

    K K 2

    00:12

    00:20

     

    K K 1

    00:13

    00:35

    V

    K K 2

    00:20

    01:34

    T

    K K 5

    01:53

    03:35

    T

    KK 3

    02:12

    00:20

     

    KK 4

    02:33

    00:35

    V

    K K 2

    04:32

    05:34

    T

    < < 5

    04:43

    06:35

    T

    < < 2

    06:12

    06:20

     

    07:44

    08:35

     

    < < 3

    10:20 11:34

    T

    < < 4

    11:23

    11:35

    T

    < < 3

    16:12

    16:20

    V

    K K 1

    17:13

    18:35

     

    KK 2

    18:20

    19:34

    T

    < < 5

    19:23

    22:35

    V

    Figure 1: Log file for Network A ccess

    Based on above problem develop a complete program using modular programm ing array file

    processing or any appropriate technique to produce the report that required by ICT C entre of

    UMP.

     

  • 8/18/2019 Bcs1023-Programming Techniques 1415

    3/6

    CONFIDENTIAL

     

    CS BCNIBCG 1415111BCS1023

    QUESTION 2

     

    40 Marks]

    Storm R ider Book Re ntal Enterprise is providing online system for comic book rental. Customer

    is allowed to rent up to

    5

    books only otherwise the system will trigger a message

    Only 5 books

    are allowed to be rented at one time .

    The system also will display a list of comic books that are

    available to be rented in the system s menu along with their rental fees as shown in Table 1.

    Figure 2 is an ex ample of the system s output.

    Table 1:

    List of Books

    No

    Title

    Series

    Price

    No

    Title

    Series

    Price

    Pedang

    setiawan  

    1-620

    2

    5

    Naga Kembar

    1-101

     

    2.

    Dewata Raya

    1-160

    2

    6.

    Alam Perwira

    1-400

    2

    3.

    Golok Keramat

    1-99

    2

    7.

    Dragon Ball

    1-29

    3 5

    4.

    Pendekar Laut

    1-110

    2.50

    8 .

    Doraemon

    1-20

    3 5

    Task:

    Write a complete program using modular programming, array, file processing or any appropriate

    technique for the above problem. You may refer to Table 1 as a guideline for input process and

    Figure 1 for the output. The output must be produced in a file.

    3

  • 8/18/2019 Bcs1023-Programming Techniques 1415

    4/6

    CONFIDENTIAL

     

    CSIBCNIBCG 1415111BCS1023

    Enter Customer Name: Nabil Johari

    Enter Customer ID: M005

    List Of Title 

    eries 

    ental Fees

    1

    edang setiawan

    1-620  

    2

    ewata Raya

    1-160

     

    3

    olok Keramat

    1-99

     

    4

    endekar Laut

    1-110

    2 5 0

    5

    aga Kembar

    1-101

     

    6

    lam Perwira

    1-400

     

    7 ragon Ball

    1-29

    3 5

    8

    oraemon

    1-20

    3 5

    Enter your comic choice or press 0 to exit? 1

    Enter series [1-620] : 621

    Not valid, Enter valid series [1-620]: 35

    Enter your comic choice or press 0 to exit? 3

    Enter series [1-99]: 80

    Enter your comic choice or press 0 to exit? 6

    Enter series (1-4001: 67

    Enter your comic choice or press 0 to exit? 0

    Storm Rider Book Rental Enterprise

    Name 

    Nabil

    Johari

    Customer ID M 0 0 5

    Comic Books

    Series Rental Fees (RN)

    Pedang setiawan 35

    2 0 0

    Golok Kerarnat

    80

    2 0 0

    Alam Perwira

    67

    2 0 0

    sub total

    6 0 0

    +Postage fees

    1 0 0

    +GST 6 0.42

    Total:

     

    4 2

    Return period: 7 days

    Thank you, the requested comic books will be sent to your address

    the next following working day

    Figure 2: Sample of output of the program

  • 8/18/2019 Bcs1023-Programming Techniques 1415

    5/6

     ONFIDENTI L

     

    CSIBCNIBCG/1415IIJBCS1023

    QUESTION 3

     

    40 Marks]

    Inland Revenue Board IRB) proposed a new initiative for combining husband-wife annual

    income dec laration. The current practice of annua l income declaration is done individually by the

    husban d and wife as shown in Figure 3. IRB will give new tax rate of 2.5 for this initiative..

    Individual Annual Income Declaration

    Husband ID: H 23 7

    Individual Annu al Income Declara tion

    Wife ID: W00 145

    Type of Income

    Amount

    Type of Income

    Amount

    Salary

    76,000.34

    Salary

    56 434.40

    Allowance

    23,023.45

    Allowance

    3,289.45

    Other Incomes

    12,123.12

    Other Incomes

    2,123.12

    Total Income (a)

    111,146.91

    Total Income (a)

    61,846.97

    Type of Expenses

    Amount

    Type of Expenses Amount

    Family

    12,000.00

    Family

    12,000.00

    Education

    3,400.13

    Education 405.53

    Health

    2,345.12

    Health 345.62

    Total Expenses (b)

    17,745.25 Total Expenses (b)

    12,751.15

    Taxed Amount a-b) 93,401.66 Taxed Am ount a -b)

    49,095.82

    Percentage of Tax 7.5 Percentage of Tax

    7.5

    Amount of Tax 7005.12 Amount of Tax

    3682.19

     a) For husband

     

    b) For Wife

    Figure 3: Annual income declaration

    Task

    W rite a complete program using modular programm ing, array, file processing or any app ropriate

    technique for the above problem by reading the necessary input with the related calculation of

    the tax as shown in Figure 3. Then produce a report that shows calculation of the tax based on

    the new initiative. Example of the report is shown in Figure 4. You must apply at least two

    functions.

     

  • 8/18/2019 Bcs1023-Programming Techniques 1415

    6/6

     ONFIDENTI L

     

    CS BCNIBCG 141511113CS1023

    Com bine Annual Income Declaration

    Husband

    ID: H 12317

    Wife

    ID: W 00145

    Total

    Type of Income

     mount Amount

    Salary

    76,000.34

    56 434.40

    Allowance

    23,023.45

    3,289.45

    Other Incomes

    12,123.12

    2,123.12

    Total Income a)

    17,2993.88

    T ype of Expenses

     mount

    Amount

    Family

    12,000.00

    12,000.00

    Education

    3,400.13

    405.53

    Health

    2 345 12

    345.62

    Total Expenses b)

    30,496.40

    Taxed Amount a-b)

    142,497.48

    Percentage of Tax

    2.5 )

    2.5

    Amount of Tax

    3562 44

    Figure 4: Combine Annual Income D eclaration

    END OF QUESTION PAPER