Vous êtes sur la page 1sur 41

NCC INTERNATIONAL DIPLOMA IN COMPUTER STUDIES

LEARN IT

TANZANIA ASSIGMENT: Programming Methods

Award: Module Title: Assignment Title:

International Diploma in Computer Studies Programming Methods Soccer Club

Examination Cycle: September 2008 NCC Education Submission Date: 16 / 07 / 2008

Important Notes
Plagiarism using the thought or writings of others as though they were your own without acknowledgement is an offence. is your responsibility to familiarize yourself with the NCC Education It Academic Dishonesty and Plagiarism Policy. Any thoughts, ideas or quotations which dont belong to you must be fully attributed to their sources using the appropriate in-text citation and a bibliography as described in the Harvard Referencing System. Authors work that is used in your assignment and not referenced is plagiarism. At Diploma level work omitting either citations or bibliography will be limited to a maximum 50%; at Advanced Diploma level to a maximum 45%; at Honors and PhD level to fail. 2

You must sign the Student Declaration as detailed in the Statement and Confirmation of Own Work found at the back of every NCC Education assignment. You must attach the signed and completed form to your assignment. You could lose marks if you exceed the recommended word count by more than 10%. digital copy as well as a paper copy must be submitted (on disk or similarly A acceptable medium).Media containing viruses, or media which cannot be run directly, will result in a FAIL grade being awarded for this module. Electronic media will also be checked for plagiarism so be aware! Markers comment: Moderators comment:

Mark:

Moderate Mark:

Final Mark:

Statement and Confirmation of Own Work


Programme/Qualification name: International Diploma in Computer Studies

All NCC Education assessed assignments submitted by students must have this statement as the cover page or it will not be accepted for marking. Please ensure that this statement is either firmly attached to the cover of the assignment or electronically inserted into the front of the assignment.
Student declaration I have read and understood NCC Educations Policy on Academic Dishonesty and Plagiarism. I can confirm the following details: Center Name: LEARNIT Module Name: Programming Methods Module Leader: MR. KISHORE SARANGA Number of words: 3,194

I confirm that this is my own work and that I have not plagiarized any part of it. I have also noted the assessment criteria and pass mark for assignments. Due Date: 11/07/2008 Submitted Date: 16/07/2008

CONTENTS:
Page:

Acknowledgement 6 Introduction 7 The Scenario .. 7 TASK 1 8-16 TASK 2 .. 17-18 TASK 3 .. 19-22 TASK 4 .. 23-24 TASK 5 . 25-38 TASK ... 39-40 Conclusion ... 40 Reference . 41

ACKNOWLEDGEMENT: 5

The successful completion of this assignment has been possible through assistance, effort, hard work, and support received from many people. I highly appreciate the effort and support of all people, who have directly or indirectly contributed in the successful completion of this project. First, I would like to express my sincere gratitude to my assignment supervisor MR.
KISHORE SARANGA for giving me all the guidance, support and useful comments

throughout the assignment. Special gratitude goes to my family and the family of Mr. & Mrs. Forgen Joel (my sponsor) for their support and encouragement through all my course work. Also, I sincerely thank the management of Learn IT for offering these NCC courses and providing all necessary facilities for doing this course, I do appreciate. Even to all my classmates for their moral and technical support and also advices. Most of all, I thank the Almighty GOD for lighting in me, the burning power and strength for completing this assignment, despite the many ups and downs that came in between the completion.

Introduction
6

The assignment allows the candidate to demonstrate the ability to use various modeling methods and techniques when developing computer programs. This assignment is based on the analysis and design of a computerized membership system for a local soccer club.

The Scenario
The membership details of all members of the soccer club are currently monitored using a manual list. At club meeting list is checked by the club secretary and no person may enter the meeting who is not on the list. Members must pay an annual subscription which is at adult level or junior (under 18 years of age on 1 September) level. Details of all members are registered with the local soccer league to enable them to play in matches. The information currently stored in the list includes the following: Member name Member number Address Contact telephone number Membership level (adult or junior) Date of payment The membership list is also made available to the treasurer who monitors the membership and subscriptions. The club runs three teams, 1st team, 2nd team and junior team and the captains of each team also have access to the membership list so that they can select players for matches against other player. This information is recorded after each match played. The club officials have requested that the membership system be computerized. The aim is to speed up the production of regular monitoring reports on players and meet the soccer league requirements regarding player records and data protection.

Task 1 20 Marks
The club secretary would like the following report on regular basis: 7

Report: 1. A list of all the paid-up member names and contact numbers by membership level, with totals for each level. Report: 2. A list of players for each of the three teams for the current season with details of number of matches played for each team (a player may play for more than one team), goals scored, bookings (yellow cards), sending off (red cards) with the players listed in alphabetical order. Using JSP techniques and methodology analyze the requirements for both reports. Produce a set of diagrams for each report showing the step-wise progression. Diagrams should include logical data structure diagrams (DSDs), preliminary program structures (PSDs) as well as the detailed program specification for each report.

Solution:
This is membership table to be used by the Club Secretary

Soccer Club Members details


Registration No. Member name First Name Second Name Contacts Address Telephone No. Mobile Home Membership Level Adult 1st Team 2nd Team Junior Date of payment

Membership Table

Solution:

Report 1
Logical data structure diagram for report 1 Soccer Club

File Body

Body of report

Paid-up Members

Member * Name

Member * phone number

Membership Level

Total Number * of Members

Program specification for report 1

The program is to access a list of all the paid-up member names and contact number by membership level, with totals. At the top level the program can be separated into the components initialization task, processing tasks and closing tasks.

Program

Initializing

Processing

Closing

Top level of Top down development- Stepwise refinement Step1 At the top level the outline requirement for each main component are: Initializing: open files Processing: process each record to access members records Closing: close files.

Program

Initializing

Processing Until EOF

Closing

Open all files

Process each * members records

Close all files

Step1 of Top down development-Stepwise refinement Step 2

10

Considering each component in turn, they can be further divided to give each of the following refinements. Initializing refinements: Processing refinements: Closing refinements: Open files of reading and writing. Set up loop to read and process each record. Close files, Output closing messages.

Program

Initializing

Processing Until EOF

Closing

Open all files

Process each * members record

Close all files

Open input files

Open output files

Close input files

Close output files

Step 2 of top down development- Stepwise refinement

Step 3 11

Provide further analysis of the processing tasks. Processes are needed for accessing members records by Member Name Contact Number Membership Level (adult or junior) Total Number Program

Initializing

Processing

Closing

Until EOF
Open all files Process each * members record Close all files

Open input files

Open Output files

Close input files

Close output files

Member * Name

Member * Number

Contact * Number

Membership Level

Total number*

Step 3 of top down development- Stepwise refinement

12

Report 2
Logical data structure diagram for report 2

Soccer Club

File Body

Player list *

Team

Number of * Matches Played

Goals * Scored

(Yellow Cards)

Booking *

Sending Off *
(Red Cards)

Players Names *

13

Program specification for report 2 This program is to access a list of player for the current season, number of match played, and goals scored, booking (yellow cards), sending off (red cards), players name. Program

Initializing

Processing

Closing

Top level of top down development- Stepwise refinement Step 1 At the top level outline requirements for each component are: Initializing: open files Processing: process each records to access members records Closing: close files.

Program

Initializing

Processing
Until EOF

Closing

Open all files

List of player * for the current season

Close all files

Step 1 of top down development- Stepwise refinement

14

Step 2 Considering each component in turn, they can be further divided to give each of the following refinements. Initializing refinements: Open files of reading and writing. Processing refinements: Set up loop to read and process each record. Closing refinements: Close files.

Program

Initializing

Processing

Closing

Until EOF
Open all files List of player * for the current season Close all files

Open input files

Open output files

Close input files

Close output files

Team

Number of * match played

Goals * Scored

(Yellow Cards)

Booking *

Sending off *
(Red cards)

Players name *

Step 2 of top down development- Stepwise refinement

15

Step 3 Provide further analysis of the processing tasks. Processes are needed for accessing list of player for the current season. 1st Team, 2nd Team and Junior Team Program

Initializing

Processing

Closing

Until EOF
Open all files List of player * for the current season Open input files Open output files Close input files Close output files Close all files

Team

Number * Of match played

Goals * Scored

Booking * (Yellow Cards)

Sending off * (Red cards)

Players' name *

1st Team

2nd Team

Junior

Step 3 of top down development- Stepwise refinement

16

Task 2 - 12 Marks
Draw a flowchart for each of the two reports specified in task 1. Solution Task 2 Flowchart for report 1 Start

Process members Records

Accept members Records

Display paid up member

Yes
Members name

No

Contact number

Membership level
(Adult or Junior)

Display Error Messages


Total Number

End

17

Flowchart for report 2 Start

Process the list of players

Accept the list of players

Check Details for Current players?

Yes
Number of match Played Goals Scored

No
Booking (Yellow Cards) Sending Off (Red Cards) Players' name

Yes

Quit the players' detail?

No

End program

18

Task 3 20 Marks
a) Write a procedure that will check for paid-up members. This procedure will be included in the program that the secretary will use when checking if people are allowed into meetings. b) Write pseudo code for the two reports described in Task 1. Include in your code the procedure written in 3a) c) Write pseudo code for a report main menu. Note: you are not expected to write pseudo code for the options, only the code to navigate the menu is required.

Solution to Task 3a)

Pseudo code for report 1 Start program Use VARIABLE membership ID of TYPE Integer. DISPLAY Enter member ID ACCEPT Member ID" IF Member ID=Paid-up member is correct THEN DISPLAY Member Name DISPLAY Contact Number DISPLAY Membership Level DISPLAY Total number 19

ELSE DISPLAY ERROR MESSAGE, Enter correct Paid-up members END IF End program

Solution for Task 3b)


Pseudo code for two reports in task 1 Start program Use VARIABLE Choice of TYPE Character = A, B IF the choice = "A" Use VARIABLE members ID of TYPE Integer. DISPLAY Enter member ID ACCEPT Member ID" IF Member ID=Paid-up member is correct THEN DISPLAY Member Name DISPLAY Contact Number DISPLAY Membership Level DISPLAY Total number ELSE DISPLAY ERROR MESSAGE, Enter correct Member ID END IF 20

THEN IF the choice ="B" Use VARIABLE list of players of TYPE String. Number of match played, goals scored, booking (yellow cards), sending off (red cards) of TYPE Integer. DISPLAY List of player for the current season Accept List of player IF the current players list is correct THEN DISPLAY Number of match played DISPLAY Goals scored DISPLAY Booking (yellow cards) DISPLAY Sending off (red cards) DISPLAY Players name END IF Display "Quite the players detail or stay still" IF quite the players list is yes THEN End the Program END IF ELSE IF quite the players list is no THEN Return to the players list details END IF ELSE Display "ERROR MESSAGE, Enter the correct choice of the Report"

21

END IF End program

Solution for Task 3c) Pseudo code for main menu


Start program Use VARIABLE Choice of TYPE Character = A, B. DISPLAY Choose the report you want to view DISPLAY A = Report 1 DISPLAY B = Report 2 ACCEPT Choice DO CASE Choice CASE Choice = A PRINT Report 1 CASE Choice = B PRINT Report 2 Otherwise DISPLAY Invalid Choice END CASE End Program

22

Task 4 6 Marks
Test the pseudo code written in Task 3 b) by producing test plans, desk checks and dry runs. Test plan for pseudo code of report 1

Component ID

Test Purpose Test Condition Test Data

Report 1 Verification of list of players for the current season and view list of all members record. Error on , condition is repeat until correct list of player is accepted then access players details List of players for the current season of TYPE STRING All members records accessed if correct player list is entered. Displays correct players details from if players list entered is correct Otherwise display Error message, Enter correct players list To enable access members details entered from report 1

Expected Outcome

Actual Result

Desk checks of pseudo code of report 2 Variable list List of players for the current season of TYPE String. Number of matches played, goals scored, booking (yellow cards), sending off (red cards), Players name of TYPE Integer; this variable is used for accessing member's details DISPLAY Number of matched played DISPLAY Goals scored 23

DISPLAY Booking (yellow cards) DISPLAY Sending off (red cards) DISPLAY Players Name DISPLAY INVALID MESSAGES of TYPE String, this is displayed when invalid member is entered

Dry run of pseudo code of report 2 Variable List of player for the current season Number of match played Goals scored Booking (yellow cards) Sending off (red cards) Quite the player's details? Assign Value List of player for the season Action After Accept the list Expected Continuation Result Show players (Yes/No) details Number matches played "Goals scored "booking (yellow cards) "sending off (red cards)" "Total number" (Yes/No) Yes End of Answer Entered Yes Action After Display players details

24

Task 5 30 Marks
This task involves using the UML modeling technique. a) Create a high-level class diagram (Domain analysis) for the membership system. b) Carry out a high level USE CASE analysis and procedure a set of USE CASE diagrams that show the actor and any stereotyped dependencies. c) Develop a set of USE CASE diagrams for following scenarios: checking member details adding a new member of the database (file) deleting a member printing a report d) Develop a set of SEQUENCE diagrams for each of the scenarios described in 5c). Develop a set of COLLABORATION diagrams for the scenarios described in 5c).

25

Solution to task 5(a) High-level class diagrams (domain analysis) for the membership Club Official ID: Integer Name: String Password: String Club Secretary ID: Integer Name: String Password: String Club Treasure ID: Integer Name: String Password: String

- Requested that the membership system be computerized

-Checking membership list. -Writing reminder letters for Membership renewal

-Checking paid and unpaid members. -Produce Annual Account Reports.

Club Members Members Name: String Members number: Integer Address: String Contact telephone number: Integer Membership level: String Total number: Integer Renewal of membership. Obtain the club rules and regulations.

Printer Members Name: String Members number: Integer Membership level: String Date of payment: Integer Prints the final report

26

Relationship
Club Officials and Club Secretary = One to One Club Secretary and Club Treasurer = One to One Club Officials and Club Members =One to Many Club Secretary and Club Members = One to Many

27

Solution to task 5(b) High level use case analysis and a set of use case diagrams that show actors and stereotyped dependencies

Checking players list

Club Secretary

Writing reminder letters for renewal

Produce regular players report

Club Member

Renewal of membership

Checking members details

Treasurer

Produce Annual Account reports

Solution to Task 5(c) Use case diagrams for the following scenarios: 28

Checking members details (Secretary check-in)

Checking paid and unpaid club members Club Secretary

Produce club members report

Obtain the club rules and regulations.

Club Member

Renewal of membership.

29

Adding a new member to the database (file)

Adding member to membership list

Club Secretary

Details of the new member is entered into the computerized system

Club Treasure

Controls system and update new member details

30

Deleting a member

Issuing reminder letters to the unpaid members

Club Treasure & Club Secretary

Deleting all unpaid and invalid members from the computerized system

31

Printing a reports

Checks for the printers functionality

Sends the report for printing Club Secretary Gets the feedback

Prints the report Printer

32

Solution to task 5(d) Sequence diagram for checking member details (receptionist check-in)

Club member

Club Secretary

Obtain the club rules and regulations

Produce list of players report.

Checking members details

33

Sequence diagram for adding new member to the database (file)

Club member

Club Secretary & Treasure

Computerized system

Choosing membership level

Adding member To membership List

Enter member Details into the computer System Controls system and Update new members Details

34

Sequence diagram for deleting a member

Club Secretary

Club Treasure

Computerized system

Checking paid and Unpaid Members Issuing reminder Letters to Unpaid members Deleting unpaid members From computerized system

Removing unpaid up players From the list

35

Sequence diagram for printing a report

Club Secretary or Club Treasurer

Printer

Send a Report

Check for printers functionality

Prints report and get feedback.

36

Collaboration diagram for checking member details (Secretary check-in) 1. Obtain club rules and regulations

Club member 3. Renewal of membership

Club Secretary 2. Produce renewal membership report

Collaboration diagram for adding new members to the database (file)

1. Club member

Choosing membership Level

2. Adding new member to membership list Club Secretary 4. Controls system and update new members' details

Club Treasure 3. Entered new members details into the computerized system.

37

Collaboration diagram for deleting a member

Club Treasure

1. Checking paid and unpaid members

2. Deleting unpaid members from the membership list.

Computerized system

3. Issuing reminders letters to the unpaid members Club secretary 4. Deleting of unpaid and invalid members from the computerized system

Collaboration diagram for printing a report

Send reports

1. Checks for printer functionality

Club Secretary or Club Treasurer

Printer

2. Print the reports from the printer and get feedback

38

Task 6 12 Marks
In not more than 500 words, write a review of your work. Describe any assumption you have made and any changes you could introduce to improve your work. For the different methods and technique you have used in Task 1 5, discuss which would be most suitable for an object-oriented programming language.

Solution Task 6 TASK 1


I have made good use of Jackson Structure Programming (JSP) techniques and methodology to analyze the requirements for all the reports and have produced a set of diagrams for each report showing the stepwise progression. Diagram includes logical DSD, program structure and program specification. TASK 2 In this task I was ask to draw a Flowchart for each of the two reports in task 1. Report 1: Flowchart has to do with list of paid-up members which include the members name, contact number, membership level and total number for each level. Report 2: Was dealing with the list of players for each of the three teams for the current season, number of match played, goals scored, booking (yellow cards), Sending off (red cards) and the list of players listed in alphabetical order. TASK 3 This task is divided into three parts. The first part was to write a procedure that will check for paid-up members. And this is included in the program that the club secretary has to use when checking in valid members. The second part was to write pseudo codes for two reports described in task 1. Which was to show paid up member with their details such as: Member names, Contact number, membership level with total number for each level. Furthermore, the third one is dealing with writing a pseudo code for a report main menu that will be accessed by the use of Do case statement.

39

TASK 4 In this task I have been asked to test the pseudo code written in task 3, which include report 1 and report 2. I have approach this as per requirement by producing test plan, desk checking and dry run. TASK 5 I have used the UML Diagram for the table tennis club, whereby I developed the following diagrams: Developing the high level class diagram Developing a set of use case diagrams Developing sequence diagram Developing a set of collaboration diagram

I used the above mention diagram to draw the following scenarios: Checking members details by Secretary, Adding a new member to the database, Deleting a member and finally printing a report. Areas of Improvement: Computerized system can be used by the club officials, club secretary and club treasurer in order to speed up file processing. It helps the club Secretary to enter data pertaining to the number of paid-up members and the total number of players in the club. It provides Treasurer to enter data pertaining the transaction that takes place in a day. It provides error free and non-repetitive data that can be adding new members to the database in the computerized system.

Conclusions In this report I have written the review of each task. I have also written the improvement the new computerized system which would bring to the replacement of the old fashion and the benefits it would bring to the club and system as well.

40

Reference:
1. Structured Programming Methods IDCS Book Published by NCC Education Limited 2. My notes Book

41

Vous aimerez peut-être aussi