Transcript
Page 1: Course Work Programming Concepts[1]

1/7

ICON College of Technology and Management Course: BTEC HND in ICT Systems

Unit: 3, Programming Concepts, Session: February 2010 Course Work Maximum word limit: 3000

Title: Programming Concepts Coursework

1 Objective

This coursework requires the student to produce a menu driven console program. The program is structured so that it tests the students’ knowledge in various areas of structured programming using C++. Each student is expected to produce a single program which comprises the various tasks listed here in this coursework. Each task should be written as a function to emphasise modularity of your program. Each student is expected to hand in a full source code and associated documentation in a CD as well as printed program documentation. The CD must contain everything necessary to run the program within Microsoft Visual C++ 2008 express edition environment, i.e. it must be the full project folder, not just the source code.

2 Program Specification

The program will have a menu system from which the user selects. There will be 9 options as listed from 2.1 to 2.9 below. Use the subsection headings from 2.1 to 2.9 as the menu item title. Each option will implement a specific task in the work as listed below. On selection of an option from the main menu, the program executes that option and waits for the user to press a key before returning o the main menu.

2.1 Hello World (Menu Item 1)

Specification: The function asks the user to enter their first and second names and it prints Hello World, this is YourFirstName YourSecondNam’s First C++ Project”.

2.2 The ICON Characters (Menu item 2)

Specification: Write a function to print the pattern shown below on the console screen.

2.3 The Area of a Circle (Menu item 3)

Specification: This function calculates the area of a circle. The area of a circle is given by 2ra where a is the area and r is the radius.

Input: The radius of the circle is the input parameter to the function and is entered by the user. Output: The function returns the area of the circle.

***** * * * *****

**** * * * ****

**** * * * * * * ****

* * * * * * * * * * * * *

Page 2: Course Work Programming Concepts[1]

2/7

2.4 The Volume of a Cylinder (Menu item 4)

Specification: This function calculates the volume of a cylinder. The volume of a cylinder is given by

hrV 2 , where r is the radius of the circular base and h is the height of the cylinder and V is the volume of the cylinder. Input: The radius of the circle and the height of the cylinder are inputs to the function and are entered by the user. Output: The function returns the volume of the cylinder.

2.5 The Student Examination Results Analysis (Menu item 5)

Specification: The function assigns Pass, Merit, Distinction or Fail against students names entered with their grades by assuming Fail as <40%, Pass as 40% to 60%, Merit as 61% to 80% and Distinction for grades >80%. The program should also print the average of all the grades entered. You should not fix the number of grades entered, it should be decided by the user at run time. Input: Enter names of students and their grades ranging from 0 to 100. Output: Prints a table with one column as student name and another column student grade and a third column with Pass, Merit, Distinction or Fail.

2.6 The National Lottery Number Generator (Menu item 6)

Specification: Write a function to generate six random numbers in the range of 1 to 49 (inclusive). The number of draws will be decided by the user. Input: Number of draws Output: prints six distinct numbers from 1 to 49 inclusive per row.

2.7 The Sum of the Elements of an Array (Menu item 7)

Specification: Write a function that returns the sum of all the elements of an array. The array is declared and initialised to be an input to the function.. Input: Array. Output: Sum of elements of the array.

2.8 The Solution of Quadratic Equation (Menu item 8)

Specification: The solution to a quadratic equation of the form 02 cbxax is given by the formula below:

a

acbbx

2

42

Where a, b and c are the coefficients of the quadratic equation. You are required to write a function to find the two solutions of the equation. The above formula only works if a ≠0 and that

042 acb for real roots. Your program must check the above two constrains and take appropriate action to avoid runtime errors. Input: Three coefficients of a quadratic equation Output: Solution of the quadratic equation.

2.9 Exit (Menu item 9)

Specification: This option should allow the user to exit the program.

2.10 The ReadMe File - Complete Program Documentation

This file will constitute as part of your assessment for the completion of the coursework. In this file, all the functional elements of the program must be explained. Flow diagrams of each task as well as that of the overall task must be shown as part of the design process.

Page 3: Course Work Programming Concepts[1]

3/7

3 Additional Specs, Hints & Good Programming Practices

The marking scheme for this coursework will assign marks for Functionality, Quality of Code, Program Design, Style, Documentation and Working Binaries. Style and Documentation are crucial – you must neatly comment your code.

Try and break the coursework down into do-able chunks as identified by the task list. These are distinct programs in the coursework, so try and modularise your effort – for instance - first you need to set up the menu system and build functionalities of each menu item one by one. This approach will help in the testing and debugging process of your code.

DEBUGGING HINT: Compile and test your program after every change, even if it was as simple a change as adding a single line. This will allow you to find and fix errors early before you write more code. This is another reason why you have to write the skeleton program which runs first even if it does not do anything yet.

Your main program should have the following heading shown below. You must customise it to your particular details.

/************************************************************************************* About: This program is written as part of the fulfilment for the Programming Concepts Course - HND in ICT Systems at Icon College, London. Date : Put date here By : Put your name here. Student ID: Put your student ID Here Tutor: Y M Gebremichael *************************************************************************************/

Each function must have its own comment heading which describes exactly what the code does as shown below as an example.

/************************************************************************************* About: This program takes your date of birth as an input and returns your age. *************************************************************************************/

In addition to the above, follow good programming practices. Below are some of the common good practices generally accepted as industry standard and followed by those in industry who are using programming in general and the C/C++ in particular. You will get more marks for following good programming practices. Some examples are given below.

When naming identifiers, o Do not start with underscore (used for technical programming). e.g. _grades (this is

bad practice) o Write single word variables in all lower case , e.g. int grades, roots; o Space is not allowed in identifiers, e.g. ‘student grades’ is wrong! write this as

studenGrades or student_grades. Note the use of capitalisation or the underscore. o Use CAPILAT LETTERS TO DECLARE CONSTANTS, e.g. PI = 3.14, SIZE = 100; o Start function names with capital letters. e.g. AverageGrades(). Spaces are not

allowed in function names. ‘Average Grades()’ is wrong. Use AverageGrades() or Average_grades().

Make a habit of using Meaningful identifier and Function Names to make your code easier for others to understand. Think about it, what does "g" mean? Is it grades, garbage, grave, etc. Thus do not use cryptic identifier names, e.g. Use ‘grades’ to refer to student grades rather than ‘g’. Similarly, use sensible function names. If you want to write a function that assigns student’s grades, then call it StudentGrades(). Do not use your names or names of your pets or any name that does not describe what the function does, but at the same time do not use more than 3 words, i.e. do not use a sentence to name a function. e.g. ThisIsMyAverageFunction() while syntactically correct is not good programming practice.

Page 4: Course Work Programming Concepts[1]

4/7

Remember C/C++ is case sensitive so ‘Grades’ and ‘grades’ are not the same as identifier names. Thus be case and spelling consistent. Use an identifier name only once and spell it (upper and lower case) the same way within your program.

Finally give the project a sensible name like Unit3CoursewrkStudentID E.g. Unit3CourseWrk3344

4 Summary of Learning Outcomes

1. Design and develop code using structured programming methods 2. Use modularisation appropriate to the chosen programming language 3. Produce appropriate documentation for a given program application 4. Create and apply appropriate test schedules.

Outcomes Assessment criteria for pass To achieve each outcome a learner must demonstrate the ability to:

Tasks/questions reflecting the outcome

Design and develop code

using

structured programming methods

identify and select appropriate pre-defined

data types

use simple input/output and appropriate operators with the above

identify and use appropriate selection structures and loop structures for the given

task

produce programs to desired standards

2.1 – 2.9

Use modularisation

appropriate to the chosen

programming language

construct a program from a design and use

appropriate functions/procedures

demonstrate the effect of scope and life-time of variables

pass data effectively between modules

2.1 – 2.9

Produce appropriate

documentation for a given

program application

produce user documentation for a completed

programming application including the user

interface design develop documentation for a predescribed

program application

2.10

4 Create and apply

appropriate

test schedules

demonstrate discrimination between

semantic and syntax errors

produce test documentation

successfully construct and use test data and

schedules to detect logic errors

use appropriate techniques for detecting

errors

2.1 – 2.9

Page 5: Course Work Programming Concepts[1]

5/7

5 Grading Criteria of this Coursework (Overall)

Pass Merit Distinction

a. All outcomes and associated assessment criteria have been met. b. Reasonable concepts on the subject covered by the questions in the coursework have been demonstrated in own words. c. Listed all references c. TCA (in the form of Examination) has been passed.

a. Pass requirement achieved. b. Substantial concepts on the subject matter covered by the questions in the coursework have been demonstrated. c. Strategies to find appropriate solutions to solve the problems in the coursework have been identified and applied. d. Appropriate decision has been made after comparative analysis has been done. e. Appropriate findings have been presented to demonstrate the clear understanding

a. Pass and Merit Requirement achieved and b. First-rate concept of the subject matter covered by the questions in the coursework has been demonstrated. c. Critical reflection to evaluate own work and justify valid conclusions on the basis f the results obtained in the case of each of the problems in the coursework is evident. d. Critical evaluation of the products recommended and come up with conclusive statements to justify the recommendations.

Page 6: Course Work Programming Concepts[1]

6/7

6 Specific Guidelines for Pass/Merit/Distinction

7 Preparation Guidelines of the Coursework Document

a. All coursework must be word-processed. b. Document margins must not be more than 2.54 cm (1 inch) or less than 1.9cm (3/4 inch). c. Font size must be within the range of 10 point to 14 point including the headings and body text. d. Standard and commonly used type face such as Times new Roman or Arial etc should be used. e. All figures, graphs and tables must be numbered. f. Material taken from external sources must be properly referenced using a standard method g. Word limit must be strictly followed.

7.1 Plagiarism

Any act of plagiarism will be seriously dealt with according to the regulations. In this context the definition and scope of plagiarism are presented below: Plagiarism is presenting somebody else’s work as your own. It includes copying information directly from the Web or books without referencing the material; submitting joint coursework as an individual effort; copying another student’s coursework; stealing coursework from another student and submitting it as your own work. Suspected plagiarism will be investigated and if found to have

Pass Merit Distinction Design and develop code using

structured

programming methods

- Basic understanding of Structured programming

- Pass criteria met. -Substantial knowledge of the operation of structured programming and understanding of the advantages of structured programming techniques.

- Pass and Merit criteria met - Demonstrate in-depth knowledge of the structured programming methods and the implementation and the advantages of structured programming

Use

modularisation

appropriate to the chosen

programming

language

Basic understanding of modularisation

- Pass criteria met -Substantial knowledge of modularisation

- Pass and merit criteria met -Demonstrate in-depth knowledge of modularisation

Produce appropriate

documentation for

a given program

application

Basic understanding of the documentation involved in programming

- Pass criteria met -Substantial understanding of the documentation involved.

- Pass and merit criteria met -Demonstrate in-dpeth understanding of Software documentation.

Create and apply

appropriate

test schedules

Basic understanding of creating effective software test schedules

-Pass criteria met -Substantial understanding of creating effective software test schedules

-Pass and merit criteria met -Demonstrate in-depth knowledge and understanding of creating and implementing software test schedules

Page 7: Course Work Programming Concepts[1]

7/7

occurred will be dealt with according to the college procedure. (For details on Plagiarism please see the student hand book)

7.2 Submission

a. All coursework must be submitted to the assigned person and a receipt must be obtained. b. The copy of the coursework submitted will not be returned to you after marking c. Any computer files generated such as program code (software), graphic files that form part of the coursework must be submitted on a floppy disc or CD together with the documentation. d. The student must attach a copy of the question in between the cover page and the answer.

7.3 Good practice

a. Make backup of your work in different media (hard disk, CD, memory stick etc) to avoid distress for loss or damage of your original copy. b. Make an extra hardcopy of your work submitted for your own reference or later use

7.4 Extension and Late Submission

a. If you need an extension for a valid reason, you must request one using a coursework extension request form available from the college. Please note that the lecturers do not have the authority to extend the coursework deadlines and therefore do not ask them to award a coursework extension. The completed form must be accompanied by evidence such as a medical certificate in the event of you being sick. b. Late submission will be accepted and marked according to the college procedure. It is noted that late submission may result in lower grade or rejection.


Recommended