0% found this document useful (0 votes)
9 views2 pages

Csc201 Computer Programming C

Program

Uploaded by

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

Csc201 Computer Programming C

Program

Uploaded by

Israel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Question One A

1. What is algorithm? Explain with example two types of algorithma.


2. Explain the four characteristics of algorithms
3. State the steps of algorithm to convert temperature from Fahrenheit to Celsius
4. Draw the flowchart for 3
5. Write a C++ program to implement your flowchart in 4

B
1. Your Uncle who is involved in community banking business called "ESUSE" has just
deposited the sum of N300,000.00 only in his saving account with UNION BANK Pic in the
campus. Assuming 12% interest is compounded annually is carned on this amount, write a c++
program to compute how
much is due to him at the end of 10 years.

Hints: FV Future Value; PV Present Value, r interest rate and n→ number of years 3 FV PV x (1
to be added to r) n.

Question Two A
1. State the syntax and write a C++ program of each of the following:

i. If statement. Write a program to display positive number entered by a user but a negative
number is entered the number is skipped

ii. If... else. Write a program to check whether an integer is positive or negative

iii. If ... else ... elseif statement. Write a C++ program to check whether an integer is positive,
negative or zero

B
1. ABC Shopping company decided to offer some discounts for goods purchased to encouraged
high patronage from customers during the forth-coming festive period. The discount must be
offered based on the total shopping amount as shown in the table given below

Total Shopping Discount

100. No Discount

100-200. 5%

200-400. 10%

400-800. 20%

800. 25%
Write a C++ program to find and print the price that must be paid after applying the discount

Question 3

1.What is object oriented programming OOP


2.What are the advantages and disadvantages of OOP
3.Differentiate between OOP and procedural
Language

4.Your younger sister in JSS3 have been disturbing you to assist her to solve an assignment of
calculating the HCF/GCD (greatest common divisor) of two numbers. As a programmer teach
her further on how to write a c++ program to implement this assignment with a computer.

Qusttion Four
1.Explain with example three logical operators as applied in C++,
2.A Fibonacci sequence is a series were the next term is a sum of the previous two terms
(0,1,1,2,3,5)etc write a c++ programs to display it on the screen

3. Write a c++ program that will calculate and print the charge that must be paid to ship From
one place to another. The charge must be calculated based on the weight of the parcel

the following criteria:


i.The shipping charge is 28.50, if the weight of parcel is under 2 Kg
ii.And if the weight of the parcel is above 2 Kg, then there is an additional charge of 4 for och
extra Kg.

Question Five
1. List and explain two datatypes of File Stream Classes in the iostream. Library

2. List five steps of data processing with C++ for file function.

3. Write a C++ program to find the largest integer number among four (4) numbers using if else
conditional statements.

Question Six
1. What is array in C++? State the syntax of one-dimensional array structure in C++

2. Write a complete C++ program to bubble sort 1000 integer numbers in ascending order

3. Write a C++ program to implement the mathematical function of matrix A as A→`A.

You might also like