Csc201 Computer Programming C
Csc201 Computer Programming C
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
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
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
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