Assignment 1
Assignment 1
– Assignment 1
Due Date: 27 sep,2023
Problem 1)
Design an algorithm to find the real roots of a quadratic equation of the
form ax2 + bx + c = 0, where a, b, and c are real numbers, and a is
nonzero.
Problem 2)
Design an algorithm to develop a mini calculator which performs only 4
operations (addition, subtraction, multiplication and division), for the
purpose of simplicity assumes that only two numbers are allowed in this
system. This calculator must simulate the operation of actual system, for
example actual calculator is not turned off until user wants, and similarly
user performs as many calculations as he wants without exiting the
system
problem 3)
Write a program that input three numbers from user and sorts the numbers from smallest to
largest only by using if statement.
problem 4)
Write a program that results the user to input an integer between 0 and 35. If the number is
less than or equal to 9, the program should output the number; otherwise, it should output A
for 10, B for 11, C for 12 . . . and Z for 35. You are allowed to use only one “if” statement
Note: Cheating is not allowed, hence will not be tolerated and may lead to F grade in the
course.