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

Assignment C++

This document contains a computer programming assignment for an Electrical and Computer Engineering course. It includes 10 questions covering topics like binary and hexadecimal conversions, software development life cycles, algorithm development, data type sizes, physics problem solving, midpoint calculation, pattern printing, and quadratic equation solving. Students are asked to write C++ programs and use pseudocode and flowcharts to demonstrate their understanding. The assignment is due on February 9, 2021 and is worth 25% of the course grade.

Uploaded by

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

Assignment C++

This document contains a computer programming assignment for an Electrical and Computer Engineering course. It includes 10 questions covering topics like binary and hexadecimal conversions, software development life cycles, algorithm development, data type sizes, physics problem solving, midpoint calculation, pattern printing, and quadratic equation solving. Students are asked to write C++ programs and use pseudocode and flowcharts to demonstrate their understanding. The assignment is due on February 9, 2021 and is worth 25% of the course grade.

Uploaded by

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

Wollo University

KIoT
Electrical & Computer Engineering Department
Computer Programming (ECEg 1052) Assignment I

Due date: February 9, 2021

Max Marks: 25%

1) Convert the binary numbers below to decimal


a. 1111111.11111
b. 11010000.100
2) Convert each decimal fraction to binary
a. 0.9028
b. 2C6B.F2
3) Convert the hexadecimal number to decimal
a. B2F8
b. 2C
c. 2301

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:

y is the initial height of the object

v is the initial velocity of the falling object

y is the final height of the object

t is the time

g is the gravitational acceleration: 9.8 m/s/s

8) In mathematics, the midpoint between the two points (𝑥 , 𝑦 ) and (𝑥 , 𝑦 ) is


computed by the formula

Write a C++ program that receives two mathematical points from the user and
computes and prints their midpoint.

9) Write a C++ program that will print the following shapes.

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.

You might also like