You are on page 1of 6

PBS COMP 0401.

1 SPRG 12 CW3 QP PMM

Individual Assignment Spring 2012 Module: Programming Basics (COMP 0401.1) Submission and viva Week 14 Total Marks: 30

Submission Date: 28/ 05/ 2012 Objective:


The aim of this assignment is for the students to understand the basic program development life cycle and will enable them to solve problems using programming principles. Students will also develop knowledge of a programming language using different constructs and control statements. It will cover the various programming aspects of sequencing, selection and iteration.

Outcomes:
1. Identify the steps in the program development method. 2. Represent programming basics in the form of Flow Charts and program. 3. Understanding and use the various computer program aspects like sequence, selection and iteration. 4. Define the use of simple data and the requirement of structures like Structures, Pointers and arrays. 5. Application of Structures, Pointer and Arrays to Flow Charts and to program.

Instructions:
Do all the tasks. Explain the purpose of each step. No explanation or incorrect explanation no mark. Focus on building the logic towards the solution. Use pencil/ pen to work out your initial solution. Identify areas which could cause errors in your program.
Page 1 of 6

COMP 0401.1

PBS COMP 0401.1 SPRG 12 CW3 QP PMM Test the programs thoroughly with different data. Show the tested data with outcomes in a tabular format.

Task 1: Choose any two programs from the given below. Write and execute the program. Each program will carry 5 marks.

1. Write the pseudocode and draw a flowchart using Select Case statement for a program that will accept place and interest sales from the user and it will then calculate and print the discount based on the following criteria below: (5 marks)

Place is M, and then discount is 33% of interest sales. Place is W, and then discount is 10% of interest sales. Place is S, and then discount is 11% of interest sales. Otherwise, No discount

2. Write a pseudocode and a C++ program that will allow a user to input a number (4-digit) and output its 1s-digit, 10s-digit, 100s-digit, 1000s-digit, and the number in reverse order. (5 marks)

3. Write a program using pseudocode and C++ to let a user to accept qualification & number of employees experience depending with a following: (5 marks)

Qualification is Bachelors and experience more than or equal to 2 then print Lecture Qualification is Master and experience more than 6 then print Assoc Prof Qualification is PHD and experience more than 10 then print Prof If not, it will print Invalid Data

COMP 0401.1

Page 2 of 6

PBS COMP 0401.1 SPRG 12 CW3 QP PMM

Task 2: Choose only one question from the given below: Each program will carry 10 marks.
1. Define a Pointer Arithmetic and write the syntax for using pointer arithmetic. Write the below mentioned programs which make use of it. (2 marks)

a. Write and execute a program that allow a user to calculate the result of a pointer arithmetic expression, the compiler always multiplies the integer operand by the size of the object being pointed to and then show the output and draw a flowchart. (5 marks)

b. Write and execute a program that allow a user to initialize the element of an array to accept the vowel letters by using pointer arithmetic and then display the number of vowel letters of the element. 2. a. Define an array and write the syntax for using array. b. Illustrate the purpose of array using a program. (2 marks) (1 mark) (3 marks)

c. Write and execute a C++ program that will let the user to enter 10 values into an array. The program should then display the largest and the smallest values stored in the array, show the output and then draw a flowchart to show the flow of the program. (7 marks)

Task 3: Answer All Questions:


1. Explain the purpose of function in programs. Illustrate the definition of function with syntax. (3 marks)

2. Write two example programs which make use of function. Execute the programs, show the output and draw a flowchart.
COMP 0401.1

(7 marks)
Page 3 of 6

PBS COMP 0401.1 SPRG 12 CW3 QP PMM

Note: You have to demonstrate your knowledge of the submitted assignment to your teacher. Marks for tasks 1 to 3 depends on your viva and presentation.

Guidelines:
Follow the guidelines mentioned below for your report submission: Report should be typed and a hardcopy is to be submitted. Also its soft copy is to be uploaded through E- mail. Handwriting assignment will not be accepted. Report should have a Title Page. Title Page should contain the following information: Assignment Name Class Student name Student ID It should have Table of Contents. The report should have an introduction, description and a conclusion. The screenshots of the program have to be included in the report. Page number is a must. Report should be typed in your own words using Times New Roman font size 12. Heading should be with Font Size 14, Bold, Underline Copy and paste from the Internet is strictly not acceptable. Marks will be awarded for the content written in your own words. Library and internet resources can be used for finding information. Reference should be included in the last page as follows:
COMP 0401.1

Author name, Book Title, Publisher, Year in case of books


Page 4 of 6

PBS COMP 0401.1 SPRG 12 CW3 QP PMM In case of web site references type the full path of the web page with referenced date. In case of magazines/ periodicals type article name, magazine name, Issue Number and date. If any topic or diagram of a report is found copied from the other then marks will be deducted from both reports.

Rules & Regulations:


If any answer in the assignment is found copied from the others then marks will be deducted from both assignments. Any form of cheating is not allowed.

Plagiarism policy:
Plagiarized documents, in parts or whole, submitted by the students will be rejected. For the first offence of plagiarism, a student enrolled in undergraduate programme is penalized with a deduction of 25% of the maximum marks on the assessment as per the plagiarism policy statement and is allowed to resubmit the work once, within a weeks period. The student has the right to appeal against the decision made, to the respective Programme Coordinator. Further appeal on decision taken may be made to the Head of the concerned department. If the student is not satisfied by the decisions taken by the department, s/he can appeal to the Plagiarism Appeals Committee. For the second offence of plagiarism against the student, (committed in any semester after the semester of the students first offence of plagiarism in the tenure of the student in the undergraduate programme), the student is awarded zero in the assessment where
COMP 0401.1 Page 5 of 6

PBS COMP 0401.1 SPRG 12 CW3 QP PMM plagiarised content was found. The student is not allowed to re-submit the assessment. The student has the right to appeal against the decision made to the respective Programme Coordinator. Further appeal on decision taken may be made to the Head of the concerned department. If the student is not satisfied by the decisions taken by the department, s/he can appeal to the Plagiarism Appeals Committee.

Late Submission:
Penalty for late submission - 5% of the maximum mark specified for the assessment will be deducted for each working day. Assessment documents submitted beyond a period of one week after the last date of submission will not be accepted and will be marked as zero for that assessment.

Note: Students must follow the assignment instructions.

COMP 0401.1

Page 6 of 6

You might also like