Linear Program: Conditions
In all programs the input should be entered using the keyboard.
- Write a program that performs
km/h <-> m/sspeed conversion. The program should show a selection menu, e.g.This program performs km/h <-> m/s speed conversion. Please enter (a) if you want to convert km/h to m/s; (b) if you want to convert m/s to km/h. - Write a program that compares two numbers. The program should output
-1if the first number is greater than the second one,1if the second number is greater than the first one, and0if the numbers are equal. - Let $x$ and $y$ be coordinates on a plane. Write a program that determines a plane quadrant of the coordinates.
- Sort three numbers that are provided as the input.
- Given three numbers, which denote triangle side lengths, as an input, write a program that determines if a triangle with such side lengths exists. If yes, calculate the area of the triangle (you may use Heron’s formula).
- Given three numbers, which denote triangle side lengths, determine which
type the triangle belongs to:
- right-angled;
- obtuse-angled;
- acute-angled.
- The same problem as above, but the input is two side lengths of the triangle and an angle between these sides.
- The same problem as above, but the input is triangle vertices, each defined by (x, y) coordinates.
- Given three numbers, which denote triangle side lengths, determine which
type the triangle belongs to:
- equilateral;
- isosceles;
- scalene.
- You are given a hole of a rectangular shape defined by dimensions AxB (Aand B are provided as an input), and a brick with dimensions PxQxR (P, Q and R are provided as an input). The brick can be rotated to fit in the hole, but it must stay perpendicular to the hole surface. Write a program that determines if the brick can be inserted in the hole.
- Write a program that solves a linear inequality: $Ax + B > 0$ ($A$ and $B$ are provided as the input).
- Write a program that solves a linear inequality: $(Ax+B)(Cx+D) > 0$ ($A$, $B$, $C$ and $D$ are provided as the input).
- Write a program that solves a square equation: $Ax^2 + Bx + C = 0$. The program should correctly handle cases when there are two solutions, one solution, zero solutions.
- Write a program that determines alighment of two circumferences, each defined by the center coordinates and the circumference radius.
- Write a program that determines whether a given year is a leap year. All years which are perfectly divisible by 4 are leap years except for century years (years ending with 00) which is leap year only it is perfectly divisible by 400.