0% found this document useful (0 votes)
12 views3 pages

2018 Prac Programming

c++ questions

Uploaded by

Panashe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

2018 Prac Programming

c++ questions

Uploaded by

Panashe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
ZIMBABWE MINISTRY OF HIGHER AND TERTIARY EDUCATION, SCIENCE AND TECHNOLOGY DEVELOPMENT HIGHER EDUCATION EXAMINATIONS COUNCIL (HEXCO) € NATIONAL CERTIFICATE IN vA INFORMATION TECHNOLOGY SUBJECT: Programming Using C'+ PAPER NO: 317/13/S02B (Practical) DURATION: 3 Hours MARCH /A 18 EXAMINATION REQUIREMENTS 1. Computer with a C++ Compiler. \ g » 2. Storage device and printing facility. ] 3. At least 2 sheets of paper for rough work INSTRUCTIONS TO CANDIDATE, 1, Answer ALL questions. 2. Print both code and output. This paper consists of 3 printed pages. — 3 B_- PROGRAMMING USING C++ (PRACTICAL In order to qualify for a modelling show, an aspiring model must Weigh less than SSkg and must be 1.65m tall or above, Write a Program which accepts the aspiting model's full name, weight and height and determines whether she qualifies for the show or not % (10 marks} Write a program that accepts a three digit number from the user, alculates and displays the sum of the digits in the number as as the number in reverse order. For example, if your number 3" the sum of the digits is 18 and the number in reverse order (10 marks) is 972) Use a while loop. QUESTION 2 Write INEte @ menu driven program that allow! her choice. Your program must have the following functions c *ShowDivision *Commerce 1s a person to select a division of engineering, “Applied Arts Gwen that Commerce courses cost $275 per term and take two years to Complete National Certificate, Engineering courses cost $200 per term Sand take 3 years to complete National Certificate while Applied Arts S28FSe8 cost $250 and take 2 years to complete National Certificate ©Ur program should calculate and display for the user the total fees Fequired to complete National Certificate in the selected division. Use the Switch statement (20 marks) SUESTION 3 a ‘A retail shop sells a variety of products and intends to store their product details in the computer. The following details will be . stored for each product: « ProductID, description and unit cost. Write a program that accepts and stores the details of the products. Your program should calculate and display the total unit cost of all the products and | display the details of the products in the following format ProductID Description Cost co148 Counter Book 1,00 F210 File / Total cost = 3.40 PAPE NO: _317/13/S02B ~ PROGRAMMING USING C++ (PRACTICAL) b| Using your knowledge of function prototyping, write a program that generates and displays the first n terms of Fibonacci, Use a function to calculate the fibonacci terms and display them in the main function (15 marks) QUESTION 4 Write a program that creates and loads an array of 20 integer elements, ‘our program should sort the array in descending order. Display both the unsorted and the sorted arrays. (20 marks) QUESTION 5 Using notepad, write your name, surname, course and age each in a re atate line. Save the file as myfile.txt. Write a C++ program. c the information from the file and display it on the screen,

You might also like