0% found this document useful (0 votes)
22 views

Module 3 Assessments

Uploaded by

Dominic Jara
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Module 3 Assessments

Uploaded by

Dominic Jara
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

MODULE 3: ELBORATE

ELABORATE 7
Instructions: Perform and apply the characteristics of a good program.
1. Develop a C++ program to fine the value of the following expression, where c, i, t, are constants
and belong to the data type float.

Y = cx2 + ix + t; if x >= 4
= cx2 + ix + t; if x < 4

ANSWER:

2. Write a program to calculate the commission of a salesman of cars as per following data:

SALES COMMISSION
More than & Equal to Rs. 100000 25%
Rs. 80000 to Rs. 99999 22.5%
Rs. 60000 to Rs. 79999 20%
Rs. 40000 to Rs. 59999 15%
Less than Rs. 40000 15.5%

ANSWER:

3. Write a program to find the square of first 20 numbers using For-Loop.

ANSWER:

4. Write a C++ program which calculates the average of 8 subject grades.

ANSWER:

5. Based from the programs you have developed in this worksheet. Did you encounter problems
while developing and writing the said programs? If yes, what are those problems and how did you
manage to solve them? If none, what did you do to make your program syntax error and bugs free?
Expound your answers.

ANSWER:
ELABORATE 8
1. Write a C++ program to search the position of a number out of the array with 10 values.

Sample Output:

Enter the numbers:


11
22
33
44
55
66
77
88
99
1010
Enter the Number to be Searched:
4
The position of required number is: 44

ANSWER:

2. Develop a C++ program to initialize only a few elements of a two-dimensional array.

Sample Output:

Contents of the Array are:


4 5 6 0 0
6 7 8 9 0
10 11 12 13 14
15 16 17 18 19

ANSWER:

3. Write a C++ program which initializes a set of characters in one-dimensional character array.

Sample Output:

NAME[0] = D
NAME[1] = I
NAME[2] = V
NAME[3] = I
NAME[4] = N
NAME[5] = E

ANSWER:

You might also like