You are on page 1of 3

CSC128: INTRODUCTION TO COMPUTER PROBLEM SOLVING

PROGRAMMING EXERCISE 8

1. Given the following mathematical equations, write the C++ assignment statement:

2. Given the following mathematical equations, write the C++ assignment statement:

3.

PREPARED BY: NYCJ@FSKM, UiTMTKD


CSC128: INTRODUCTION TO COMPUTER PROBLEM SOLVING
PROGRAMMING EXERCISE 8

4. Write the appropriate statements that match the following comments:

PREPARED BY: NYCJ@FSKM, UiTMTKD


CSC128: INTRODUCTION TO COMPUTER PROBLEM SOLVING
PROGRAMMING EXERCISE 8

5. The program segments below have logic errors. Find and correct these errors to produce the intended
output:
(i) Find the average of all positive numbers from 50 numbers entered by the user.

(ii) Count the number of students who score within 80 to 100 in a test until a sentinel value -1 is given

PREPARED BY: NYCJ@FSKM, UiTMTKD

You might also like