Assignment C++
Assignment C++
KIoT
Electrical & Computer Engineering Department
Computer Programming (ECEg 1052) Assignment I
4) Compare and contrast the following Software Development Life Cycle (SDLC)
models?
a. Waterfall vs. V – Model
b. Prototype Model vs. Spiral Model
c. Iterative and Incremental Model vs. Agile Model
5) Develop an algorithm for the following problems using Pseudo-code and flow chart?
a. Read the input from the user to compute the real roots of quadratic equation
(y=𝒂𝟐 + bx+ c) and display the value of x.
b. Swap the contents of two variables using a third variable.
c. A problem that Checks a given number is palindrome or not. A palindrome
numbers
d. A problem to find the sum of digits of a given number. If for example the given
number is 536, the sum of digits in the number = 5 + 3 + 6 =14
6) The size of the operator can be used to determine the number of bytes occupied in
memory by a variable of a certain type. For example, the sizeof(short) is equivalent to
2. Write a C++ program that displays the memory space required by each fundamental
type on screen
7) Write a program that, prompts the user to input a set of values for the initial height,
initial velocity, and the final height. Then calculate and display the number of seconds
until the object reaches the final height. All data are in the metric system. Assume that
the final height is less than the initial height. All program variables should be doubles.
1
Use the quadratic equation to solve for t. However, you must determine whether to use
the + or – root.
Where:
t is the time
Write a C++ program that receives two mathematical points from the user and
computes and prints their midpoint.
A. B. C. D.
* 54321 * *
** 4321 *** ***
*** 321 ***** *****
**** 21 ******* ***
***** 1 ********* *
10) Write a C++ program to calculate the root of a quadratic equation, (y=𝒂𝟐 + bx+ c)
where the three inputs (a, b, c) are entered by the user, display the value of the roots
which may be one or two real roots or imaginary roots.