Домашната от Console Input Output

Моите, решения на задачите от лекцията за вход и изход от конзолата без последната ( над нея още работя ).
Условията:
1. Write a program that reads 3 integer numbers from the console and prints their sum.
2. Write a program that reads the radius r of a circle and prints its perimeter and area.
3. A company has name, address, phone number, fax number, web site and manager. The manager has first name, last name, age and a phone number. Write a program that reads the information about a company and its manager and prints them on the console.
4. Write a program that reads two positive integer numbers and prints how many numbers p exist between them such that the reminder of the division by 5 is 0 (inclusive). Example: p(17,25) = 2.
5. Write a program that gets two numbers from the console and prints the greater of them. Don’t use if statements.
6. Write a program that reads the coefficients a, b and c of a quadratic equation ax2+bx+c=0 and solves it (prints its real roots).
7. Write a program that gets a number n and after that gets more n numbers and calculates and prints their sum.
8. Write a program that reads an integer number n from the console and prints all the numbers in the interval [1..n], each on a single line.
9. Write a program to print the first 100 members of the sequence of Fibonacci: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, …
10. Write a program to calculate the sum (with accuracy of 0.001): 1 + 1/2 – 1/3 + 1/4 – 1/5 + …

Ето и линк към място за свалянето на решенията ми:


Домашни от Operators, Expressions And Statements


В тази тема домашните стават с една идея по-трудно, особено последната 🙂
1. Write an expression that checks if given integer is odd or even.
2. Write a boolean expression that checks for given integer if it can be divided (without remainder) by 7 and 5 in the same time.
3. Write an expression that calculates rectangle’s area by given width and height.
4. Write an expression that checks for given integer if its third digit (right-to-left) is 7. E. g. 1732  true.
5. Write a boolean expression for finding if the bit 3 (counting from 0) of a given integer is 1 or 0.
6. Write an expression that checks if given point (x, y) is within a circle K(O, 5).
7. Write an expression that checks if given positive integer number n (n ≤ 100) is prime. E.g. 37 is prime.
8. Write an expression that calculates trapezoid’s area by given sides a and b and height h.
9. Write an expression that checks for given point (x, y) if it is within the circle K( (1,1), 3) and out of the rectangle R(top=1, left=-1, width=6, height=2).
10. Write a boolean expression that returns if the bit at position p (counting from 0) in a given integer number v has value of 1. Example: v=5; p=1  false
11. Write an expression that extracts from a given integer i the value of a given bit number b. Example: i=5; b=2  value=1.
12. We are given integer number n, value v (v=0 or 1) and a position p. Write a sequence of operators that modifies n to hold the value v at the position p from the binary representation of n.
Example: n = 5 (00000101), p=3, v=1  13 (00001101)
n = 5 (00000101), p=2, v=0  1 (00000001)
13. Write a program that exchanges bits 3, 4 and 5 with bits 24, 25 and 26 of given 32-bit unsigned integer.
14*. Write a program that exchanges bits {p, p+1, …, p+k-1) with bits {q, q+1, …, q+k-1} of given 32-bit unsigned integer.

Т.к. домашните стават все по-дълги и по-дълги реших този път да ги кача на отделен сайт, вместо да ги поствам направо тук.


HTML forms'n frames домашни

В този пост ще публикувам моите решения на задачите от лекцията за HTML формите.
Задача 1. Web Form:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>01. WebForm</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>

	<body>
		<form action="" method="post">
			<table border="1">
				<tr>
					<td><label for="lname">Last Name</label></td>
					<td colspan="3">
					<input type="text" id="lname" placeholder="Kurtev"/>
					</td>
				</tr>
				<tr>
					<td><label for="fname">First Name</label></td>
					<td colspan="3">
					<input type="text" id="fname" placeholder="Teodor"/>
					</td>
				</tr>
				<tr>
					<td><label for="addres">Addres</label></td>
					<td colspan="3">					<textarea id="addres" cols="30" rows="5" placeholder="Some addres here"></textarea></td>
				</tr>
				<tr>
					<td><label for="city">City</label></td>
					<td>
					<input type="text" id="city" placeholder="Sofia"/>
					</td>
					<td><label for="state">State</label></td>
					<td>
					<input type="text" id="state" size="3"/>
					</td>
				</tr>
				<tr>
					<td><label for="zipCode">Zip/Postal Code</label></td>
					<td colspan="3">
					<input type="text" id="zipCode" placeholder="123456"/>
					</td>
				</tr>
				<tr>
					<td><label for="country">Country</label></td>
					<td colspan="3">
					<select name="country" id="country">
						<option value="Bulgaria" selected="selected">Bulgaira</option>
						<option value="Macedonia">Macedonia</option>
						<option value="USA">USA</option>
					</select></td>
				</tr>
				<tr>
					<td><label for="phone">Phone (country code, area code, number)</label></td>
					<td colspan="3">
					<p>
						(+
						<input type="text" id="phone" size="3" placeholder="359"/>
						)
						<input type="text" placeholder="88" size="3"/>
						-
						<input type="number" placeholder="8334343"/>
					</p></td>
				</tr>
				<tr>
					<td><label for="mail">E-mail</label></td>
					<td colspan="3">
					<input type="email" id="mail" placeholder="mymail@somethin.com"/>
					</td>
				</tr>
				<tr>
					<td align="right"><label for="month">Birth date</label></td>
					<td colspan="3"><label for="month">Month</label>
					<input type="text" id="month" placeholder="06" size="2"/>
					<label for="day">Day</label>
					<input type="text" id="day" placeholder="14" size="2"/>
					<label for="year">Year (4 digit)</label>
					<input type="text" id="year" placeholder="1980" size="4">
					</td>
				</tr>
				<td align="right"><label for="gender">Gender</label></td>
				<td colspan="3">
				<select name="gender" id="gender">
					<option value="male" selected="selected">Male</option>
					<option value="female">Female</option>
				</select></td>
				<tr>
					<td><label for="opt1">Starting date</label></td>
					<td colspan="3">
					<input id="opt1" type="radio" value="spr06" name="opt1"/>
					<label for="opt1">Spring 2006</label>
					<input id="opt2" type="radio" value="sum06" name="opt2"/>
					<label for="opt2">Summer 2006</label></td>
				</tr>
				<tr>
					<td><label for="info">Comments/Questions</label></td>
					<td colspan="3"><textarea name="" id="info" cols="30" rows="10" placeholder="Please send me more information about the loding."></textarea></td>
				</tr>
				<tr>
					<td colspan="4">
					<input type="submit" value="Submit" name="submit"/>
					<input type="reset" value="Clear This Form" name="reset"/>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>

Задача 2. Grade Sheet:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>02. GradeSheet</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>

	<body>
		<table border="1">
			<thead>
				<tr>
					<th rowspan="2">Order</th>
					<th colspan="3">Personal Info</th>
					<th colspan="5">Uni Marks</th>
				</tr>
				<tr>
					<th>First Name</th>
					<th>Last Name</th>
					<th>Faculty Number</th>
					<th>English</th>
					<th>Math</th>
					<th>Biology</th>
					<th>Physics</th>
					<th>Total</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>1</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>2</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>3</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>4</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>5</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>6</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>7</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>8</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>9</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td>10</td>
					<td>Teodor</td>
					<td>Kurtev</td>
					<td>111119999</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
					<td>6</td>
				</tr>
				<tr>
					<td colspan="9">
						<form action="" method="post">
							<input type="button" value="Pervious" />
							<a href="">1</a>,
							<a href="">2</a>,
							<a href="">3</a>,
							<a href="">4</a>,
							.....,
							<a href="">10</a>,
							<input type="button" value="Next" />
						</form>
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>

Задача 3. Inventory Table:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>03. ShipingTable</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>
	<body>
		<form action="" method="post">
			<table border="1">
				<thead>
					<tr>
						<th colspan="6">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras urna nisi, gravida vitae lacinia ac</th>
					</tr>
					<tr>
						<th><label for="input1">Product ID</label></th>
						<th><label for="input2">Product Name</label></th>
						<th><label for="input3">Unit Price</label>
						<input type="image" src="img/9.png" alt="Test img"/>
						</th>
						<th><label for="input4">Quantity per unit</label></th>
						<th><label for="input5">Unit in stock</label>
						<input type="image" src="img/9.png" alt="Test img"/>
						</th>
						<th><label for="input6">Discontinued</label>
						<input type="image" src="img/9.png" alt="Test img"/>
						</th>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="6">
						<input type="image" src="img/fullleft.png" alt="fullback">
						<input type="image" src="img/left.png" alt="back">
						<a href="">1</a><a href="">2</a><a href="">3</a><a href="">4</a><a href="">5</a><a href="">6</a><a href="">7</a><a href="">8</a><a href="">9</a><a href="">10</a>...
						<input type="image" src="img/right.png" alt="forward">
						<input type="image" src="img/fullright.png" alt="fullforward">
						Page size:
						<select name="page">
							<option id="value1" value="10" selected="selected">10</option>
							<option id="value2" value="9" >9</option>
							<option id="value3" value="8" >8</option>
						</select></td>
					</tr>
				</tfoot>
				<tbody>
					<tr>
						<td>
						<input type="text" id="input1" />
						</td>
						<td>
						<input type="text" id="input2" />
						</td>
						<td>
						<input type="text" id="input3" />
						</td>
						<td>
						<input type="text" id="input4" />
						</td>
						<td>
						<input type="text" id="input5" />
						</td>
						<td>
						<input type="checkbox" id="input6" />
						</td>
					</tr>
					<tr>
						<td>1</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>2</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>3</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>4</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox" checked="checked" disabled="disabled"/>
						</td>
					</tr>
					<tr>
						<td>5</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>6</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>7</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox" checked="checked" disabled="disabled"/>
						</td>
					</tr>
					<tr>
						<td>8</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>9</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
					<tr>
						<td>10</td>
						<td>Chai</td>
						<td>&dollar; 18.00</td>
						<td>10 boxes x 20 bags</td>
						<td>39</td>
						<td>
						<input type="checkbox"/>
						</td>
					</tr>
				</tbody>

			</table>
		</form>
	</body>
</html>

Забележка: Може да използвате каквито си картинки си поискате на определените за това места в кода.
Задача 4. Apple Table:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>04. AppleTable</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>

	<body>
		<form action="" method="post">
		<table border="1">
			<tr>
				<th><a href="">Apple</a><a href="">Toshiba</a><a href="">Lenovo</a><a href="">Dell</a><a href="">Asus</a><a href="">Hacer</a><a href="">HP</a></th>
			</tr>
			<tr>
				<td>
				<table>
					<!-- 2 half table -->
					<tr>
						<td>
						<table border="1">
							<!-- Notebook warper -->
							<tr>
								<td>
								<table>
									<tr>
										<td>
										<fieldset>
											<legend>
												Apple MacBook Air
											</legend>
											<table>
												<tr>
													<td rowspan="2"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2Z88a6x88EsAl79Qh_bkuZv0QAj8nLDkTgSpZTlYgvpxRQseX" alt="MacBook"/></td><td>64 GB SSD</td>
												</tr>
												<tr>
													<td>2GB DDR</td>
												</tr>
												<tr>
													<td>1300 USD</td><td>Intel Core i5</td>
												</tr>
											</table>
										</fieldset></td>
										<td>
										<fieldset>
											<legend>
												Apple MacBook Air
											</legend>
											<table>
												<tr>
													<td rowspan="2"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2Z88a6x88EsAl79Qh_bkuZv0QAj8nLDkTgSpZTlYgvpxRQseX" alt="MacBook"/></td><td>64 GB SSD</td>
												</tr>
												<tr>
													<td>2GB DDR</td>
												</tr>
												<tr>
													<td>1300 USD</td><td>Intel Core i5</td>
												</tr>
											</table>
										</fieldset></td>
									</tr>
									<tr>
										<td>
										<fieldset>
											<legend>
												Apple MacBook Air
											</legend>
											<table>
												<tr>
													<td rowspan="2"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2Z88a6x88EsAl79Qh_bkuZv0QAj8nLDkTgSpZTlYgvpxRQseX" alt="MacBook"/></td><td>64 GB SSD</td>
												</tr>
												<tr>
													<td>2GB DDR</td>
												</tr>
												<tr>
													<td>1300 USD</td><td>Intel Core i5</td>
												</tr>
											</table>
										</fieldset></td>
										<td>
										<fieldset>
											<legend>
												Apple MacBook Air
											</legend>
											<table>
												<tr>
													<td rowspan="2"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2Z88a6x88EsAl79Qh_bkuZv0QAj8nLDkTgSpZTlYgvpxRQseX" alt="MacBook"/></td><td>64 GB SSD</td>
												</tr>
												<tr>
													<td>2GB DDR</td>
												</tr>
												<tr>
													<td>1300 USD</td><td>Intel Core i5</td>
												</tr>
											</table>
										</fieldset></td>
									</tr>
									<tr>
										<td>
										<fieldset>
											<legend>
												Apple MacBook Air
											</legend>
											<table>
												<tr>
													<td rowspan="2"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2Z88a6x88EsAl79Qh_bkuZv0QAj8nLDkTgSpZTlYgvpxRQseX" alt="MacBook"/></td><td>64 GB SSD</td>
												</tr>
												<tr>
													<td>2GB DDR</td>
												</tr>
												<tr>
													<td>1300 USD</td><td>Intel Core i5</td>
												</tr>
											</table>
										</fieldset></td>
										<td>
										<fieldset>
											<legend>
												Apple MacBook Air
											</legend>
											<table>
												<tr>
													<td rowspan="2"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS2Z88a6x88EsAl79Qh_bkuZv0QAj8nLDkTgSpZTlYgvpxRQseX" alt="MacBook"/></td><td>64 GB SSD</td>
												</tr>
												<tr>
													<td>2GB DDR</td>
												</tr>
												<tr>
													<td>1300 USD</td><td>Intel Core i5</td>
												</tr>
											</table>
										</fieldset></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
						<td>
						<label for="minprice">
							Min price: 500 USD
						</label>
						<br/>
						<input id="minprice" type="range" min="0" max="100"/>
						<br/>
						<label for="maxprice">
							Max price: 1500 USD
						</label>
						<br/>
						<input id="maxprice" type="range" min="0" max="100"/>
						<br/>
						<label for="minram">
							Min RAM: 4 GB
						</label>
						<br/>
						<input id="minram" type="range" min="0" max="100"/>
						<br/>
						<label for="maxram">
							Min price: 16 GB
						</label>
						<br/>
						<input id="maxram" type="range" min="0" max="100"/>
						<br/>
						</td>
					</tr>
				</table></td>
			</tr>
		</table>
		</form>
	</body>
</html>

HTML tables Домашно


Това са моите решения на домашната към лекцията HTML tables:
Задача 1. Fresh Fruits:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>01. FreshFruits</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>

	<body>
		<div>
			<table>
				<thead>
					<tr>
						<th colspan="2" >Fresh Fruits</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td> Lorem Ipsum is simply dummy text of the printing and typesetting industry.
						Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
						when an unknown printer took a galley of type and scrambled it to make a type specimen book.
						It has survived not only five centuries, but also the leap into electronic typesetting,
						remaining essentially unchanged. It was popularised in the
						1960s with the release of Letraset sheets containing Lorem Ipsum passages,
						and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </td>
						<td><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTQGNk7s2TKT68hXqgoPbYZFgtXypD2NKghmWYxUJh2LntMeIe" alt="Testing Img" width="200" height="200" /></td>
					</tr>
				</tbody>
			</table>
		</div>
	</body>
</html>

Задача 2. Letters Table:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>02. LettersTable</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>

	<body>
		<table border="1">
			<tr>
				<td colspan="3">Title goes here</td>
				<td>A</td>
				<td>B</td>
			</tr>
			<tr>
				<td rowspan="3">C</td>
				<td>D</td>
				<td>E</td>
				<td>F</td>
				<td>G</td>
			</tr>
			<tr>
				<td>H</td>
				<td colspan="2">I</td>
				<td rowspan="2">J</td>
			</tr>
			<tr>
				<td>K</td>
				<td>L</td>
				<td>M</td>
			</tr>
			<tr>
				<td>N</td>
				<td colspan="4">O</td>
			</tr>
		</table>
	</body>
</html>

Задача 3. Simple Web Form:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>03. SimpleWebForm</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
	</head>

	<body>
		<div>
			<form action="" method="post">
				<label for="name">Member name: </label>
				<input type="text" id="name" />
				<strong>*req</strong>
				<br />
				<label for="email">E-mail: </label>
				<input type="text" id="email" />
				<strong>*req</strong>
				<br />
				<label for="school">School: </label>
				<input type="text" id="school" />
				<strong>*req</strong>
				<br />
				<input type="submit" value="Submit" />
			</form>
		</div>
	</body>
</html>

Задача 4. Calculator:
HTML:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>04. Calculator</title>
		<meta name="description" content="" />
		<meta name="author" content="Teodor" />
		<meta name="viewport" content="width=device-width; initial-scale=1.0" />
		<link href="style/ClacStyle.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<div>
			<form action="" method="post">
				<table border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td colspan="4">
							<textarea id="result" dir="rtl">123</textarea>
						</td>
					</tr>
					<tr>
						<td>
						<input type="button" value="1" />
						</td>
						<td>
						<input type="button" value="2" />
						</td>
						<td>
						<input type="button" value="3" />
						</td>
						<td>
						<input type="button" value="+" />
						</td>
					</tr>
					<tr>
						<td>
						<input type="button" value="4" />
						</td>
						<td>
						<input type="button" value="5" />
						</td>
						<td>
						<input type="button" value="6" />
						</td>
						<td>
						<input type="button" value="-" />
						</td>
					</tr>
					<tr>
						<td>
						<input type="button" value="7" />
						</td>
						<td>
						<input type="button" value="8" />
						</td>
						<td>
						<input type="button" value="9" />
						</td>
						<td>
						<input type="button" value="*" />
						</td>
					</tr>
					<tr>
						<td colspan="2">
						<input type="button" id="zero" value="0"/>
						</td>
						<td>
						<input type="button" value="." />
						</td>
						<td>
						<input type="button" value="/" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</body>
</html>

CSS:

#result
{
	width:202px; 
	height:40px;
}
#zero
{
	width: 102px; 
	height: 50px;
}

input[type="button"] 
{
	width: 50px;
	height: 50px;
}

HTML Basics


Това е първата домашна от HTML5 трака към Софтуерната Академия на Телерик.
Задача 1. Simple Page :

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
	&lt;head&gt;
		&lt;meta charset=&quot;utf-8&quot; /&gt;
		&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge,chrome=1&quot; /&gt;
		&lt;title&gt;Simple Page&lt;/title&gt;
		&lt;meta name=&quot;description&quot; content=&quot;homework&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Teodor&quot; /&gt;
		&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0&quot; /&gt;
	&lt;/head&gt;

	&lt;body&gt;
		&lt;div&gt;
			&lt;header&gt;
				&lt;p&gt;
					Hello, Stranger!
				&lt;/p&gt;
				&lt;h1&gt;Welcome to Runners Home&amp;trade;&lt;/h1&gt;
			&lt;/header&gt;
			&lt;div&gt;
				&lt;p&gt;
					Runners Home&amp;trade; is dedicated to provideing you with
				&lt;/p&gt;
				- the moste up-to-date information on running races
				&lt;br/&gt;
				- the best resources for runners
			&lt;/div&gt;
			&lt;hr&gt;
			&lt;footer&gt;
				&lt;p&gt;
					&amp;copy; Runners Home. All rights reserved.
				&lt;/p&gt;
			&lt;/footer&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;

Задача 2. Nested Lists :

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
	&lt;head&gt;
		&lt;meta charset=&quot;utf-8&quot; /&gt;
		&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge,chrome=1&quot; /&gt;
		&lt;title&gt;Simple Page&lt;/title&gt;
		&lt;meta name=&quot;description&quot; content=&quot;homework&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Teodor&quot; /&gt;
		&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0&quot; /&gt;
	&lt;/head&gt;

	&lt;body&gt;
		&lt;div&gt;
			&lt;p&gt;
				Presseeding Text
			&lt;/p&gt;
			&lt;ol type=&quot;I&quot;&gt;
				&lt;li&gt;
					List Item 1
					&lt;ol type=&quot;a&quot;&gt;
						&lt;li&gt;
							Nested Item 1.1
						&lt;/li&gt;
						&lt;li&gt;
							Nested Item 1.2
						&lt;/li&gt;
					&lt;/ol&gt;
				&lt;/li&gt;
				&lt;li&gt;
					List Item 2
					&lt;ol&gt;
						&lt;li&gt;
							Nested Item 2.1
						&lt;/li&gt;
						&lt;li&gt;
							Nested Item 2.2
							&lt;ul type=&quot;disc&quot;&gt;
								&lt;li&gt;
									Nested Item 2.2.1
								&lt;/li&gt;
								&lt;li&gt;
									Nested Item 2.2.2
									&lt;ul type=&quot;square&quot;&gt;
										&lt;li&gt;
											Nested Item 2.2.2.1
										&lt;/li&gt;
										&lt;li&gt;
											Nested Item 2.2.2.2
										&lt;/li&gt;
									&lt;/ul&gt;
								&lt;/li&gt;
								&lt;li&gt;
									Nested Item 2.2.3
								&lt;/li&gt;
							&lt;/ul&gt;
						&lt;/li&gt;
						&lt;li&gt;
							Nested item 2.3
						&lt;/li&gt;
					&lt;/ol&gt;
				&lt;/li&gt;
				&lt;li&gt;
					List Item 3
					&lt;ul&gt;
						&lt;li&gt;
							Nested Item 3.1
						&lt;/li&gt;
						&lt;li&gt;
							Nested Item 3.2
						&lt;/li&gt;
						&lt;li&gt;
							Nested Item 3.3
						&lt;/li&gt;
					&lt;/ul&gt;
				&lt;/li&gt;
			&lt;/ol&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;

Задача 3. Web Profile:
Friends section:

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
	&lt;head&gt;
		&lt;meta charset=&quot;utf-8&quot; /&gt;
		&lt;!-- Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
		Remove this if you use the .htaccess --&gt;
		&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge,chrome=1&quot; /&gt;
		&lt;title&gt;Friends&lt;/title&gt;
		&lt;meta name=&quot;description&quot; content=&quot;homework&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Teodor&quot; /&gt;
		&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0&quot; /&gt;
		&lt;link href=&quot;style/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
	&lt;/head&gt;

	&lt;body&gt;
		&lt;div&gt;
			&lt;header&gt;
				&lt;h1&gt;Friends&lt;/h1&gt;
			&lt;/header&gt;

			&lt;nav&gt;
				&lt;a id=&quot;first&quot; href=&quot;Profile.html&quot;&gt;Profile&lt;/a&gt;
				&lt;a href=&quot;#&quot;&gt;Friends&lt;/a&gt;
				&lt;a href=&quot;Info.html&quot;&gt;Additional information&lt;/a&gt;
			&lt;/nav&gt;

			&lt;div&gt;
				&lt;hr/&gt;
				&lt;h3&gt;&lt;em&gt;Additional Information about Doncho&lt;/em&gt;&lt;/h3&gt;
				&lt;hr/&gt;
				&lt;ol&gt;
					&lt;li&gt;
						&lt;dl&gt;
							&lt;dt&gt;
								&lt;em&gt;Pesho Ivanov&lt;/em&gt;
							&lt;/dt&gt;
							&lt;dd&gt;
								Student
							&lt;/dd&gt;
						&lt;/dl&gt;
					&lt;/li&gt;
					&lt;li&gt;
						&lt;dl&gt;
							&lt;dt&gt;
								&lt;em&gt;Vankata&lt;/em&gt;
							&lt;/dt&gt;
							&lt;dd&gt;
								Software developer
							&lt;/dd&gt;
						&lt;/dl&gt;
					&lt;/li&gt;
					&lt;li&gt;
						&lt;dl&gt;
							&lt;dt&gt;
								&lt;em&gt;Bai Gosho&lt;/em&gt;
							&lt;/dt&gt;
							&lt;dd&gt;
								System admin
							&lt;/dd&gt;
						&lt;/dl&gt;
					&lt;/li&gt;
				&lt;/ol&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;

Information section:

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
	&lt;head&gt;
		&lt;meta charset=&quot;utf-8&quot; /&gt;
		&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge,chrome=1&quot; /&gt;
		&lt;title&gt;Info&lt;/title&gt;
		&lt;meta name=&quot;description&quot; content=&quot;homework&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Teodor&quot; /&gt;
		&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0&quot; /&gt;
		&lt;link href=&quot;style/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
	&lt;/head&gt;

	&lt;body&gt;
		&lt;div&gt;
			&lt;header&gt;
				&lt;h1&gt;&lt;em&gt;Additional information about Doncho &lt;/em&gt;&lt;/h1&gt;
			&lt;/header&gt;
			&lt;nav&gt;
				&lt;a id=&quot;first&quot; href=&quot;Profile.html&quot;&gt;Profile&lt;/a&gt;
				&lt;a href=&quot;Friends.html&quot;&gt;Friends&lt;/a&gt;
				&lt;a href=&quot;#&quot;&gt;Additional information&lt;/a&gt;
			&lt;/nav&gt;

			&lt;div&gt;
				&lt;hr/&gt;
				&lt;h3&gt;Frends of Doncho&lt;/h3&gt;
				&lt;hr/&gt;
			&lt;/div&gt;

			&lt;div&gt;
				&lt;em&gt;Student at &lt;a href=&quot;#&quot;&gt;Sofia University&lt;/a&gt;
				&lt;br /&gt;
				Born in Burgas
				&lt;br /&gt;
				Living in Sofia
				&lt;br /&gt;
				Working at &lt;a href=&quot;#&quot;&gt;Telerik&lt;/a&gt;&lt;/em&gt;
			&lt;/div&gt;

		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;

Profile section:

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
	&lt;head&gt;
		&lt;meta charset=&quot;utf-8&quot; /&gt;
		&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge,chrome=1&quot; /&gt;
		&lt;title&gt;Profile&lt;/title&gt;
		&lt;meta name=&quot;description&quot; content=&quot;homework&quot; /&gt;
		&lt;meta name=&quot;author&quot; content=&quot;Teodor&quot; /&gt;
		&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width; initial-scale=1.0&quot; /&gt;
		&lt;link href=&quot;style/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
	&lt;/head&gt;

	&lt;body&gt;
		&lt;div&gt;
			&lt;header&gt;
				&lt;h1&gt;Profile&lt;/h1&gt;
			&lt;/header&gt;
			&lt;nav&gt;
				&lt;a id=&quot;first&quot; href=&quot;#&quot;&gt;Profile&lt;/a&gt;
				&lt;a href=&quot;Friends.html&quot;&gt;Friends&lt;/a&gt;
				&lt;a href=&quot;Info.html&quot;&gt;Additional information&lt;/a&gt;
			&lt;/nav&gt;
			&lt;div&gt;
				&lt;hr/&gt;
				&lt;h3&gt;Profile of Doncho&lt;/h3&gt;
				&lt;hr/&gt;
			&lt;/div&gt;
			&lt;div&gt;
				&lt;img src=&quot;http://www.vnvlvokc.com/ow_userfiles/plugins/shoppro/images/product_1.jpg&quot; alt=&quot;Testing image&quot; width=&quot;50px&quot; height=&quot;50px&quot;/&gt;
			&lt;/div&gt;
			&lt;div&gt;
				&lt;p&gt;
					Name: Doncho Minkov
				&lt;/p&gt;
				&lt;p&gt;
					Birthday: 22 June 1989
				&lt;/p&gt;
				&lt;p&gt;
					Occupation: Student
				&lt;/p&gt;
				&lt;p&gt;
					Area of occupation: IT
				&lt;/p&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;

И накрая малко CSS за вкус към 3тата задача:

body 
{
	background-color: #ccecff;
}
nav &gt; a
{
	margin-left: 100px;
}
#first
{
	margin: 0;
}

Primitive Data Types and Variables


Това е втората домашна от C# – Part1 курса:

1.Declare five variables choosing for each of them the most appropriate of the types byte, sbyte, short, ushort, int, uint, long, ulong to represent the following values: 52130, -115, 4825932, 97, -10000.

using System;

class SimpleDeclaration
{
    static void Main()
    {
        ushort unsignedShort = 52130;
        sbyte simpleByte = -115;
        int intiger = 4825932;
        byte smallByte = 97;
        short simpleShort = -10000;
    }
}

2. Which of the following values can be assigned to a variable of type float and which to a variable of type double: 34.567839023, 12.345, 8923.1234857, 3456.091?

using System;

class DoublesAndFloats
{
    static void Main()
    {
        double firstDouble = 34.567839023;
        float firstFloat = 12.345f;
        double secondDouble = 8923.1234857;
        float secondFloat = 3456.091f;
    }
}

3.Write a program that safely compares floating-point numbers with precision of 0.000001. Examples: (5.3 ; 6.01)  false; (5.00000001 ; 5.00000003)  true

using System;

class FloatingPointComparison
{
    static void Main()
    {
        decimal firstNumber = 1235.6666666666666666666666666M;
        decimal secondNumber = 6.01M;
        decimal roundedOne = Math.Round(firstNumber, 6);
        Console.WriteLine(roundedOne);
        decimal roundedTwo = Math.Round(secondNumber, 6);
        if (roundedOne == roundedTwo)
        {
            Console.WriteLine("The numbers are equal!");
        }
        else if (roundedOne > roundedTwo)
        {
            Console.WriteLine("The first number is greater than the second!");
        }
        else
        {
            Console.WriteLine("The second number is greater than the first!");
        }
    }
}

4.Declare an integer variable and assign it with the value 254 in hexadecimal format. Use Windows Calculator to find its hexadecimal representation.

using System;

class HexValue
{
    static void Main()
    {
        int hexValue = 0xFE;
    }
}

5. Declare a character variable and assign it with the symbol that has Unicode code 72. Hint: first use the Windows Calculator to find the hexadecimal representation of 72.

using System;

class UniCodeSimbyl
{
    static void Main(string[] args)
    {
        char symbol = 'u0048';
        Console.WriteLine(symbol);
    }
}

6. Declare a boolean variable called isFemale and assign an appropriate value corresponding to your gender.

using System;

class Gender
{
    static void Main()
    {
        bool isFemale = false;
    }
}

7. Declare two string variables and assign them with “Hello” and “World”. Declare an object variable and assign it with the concatenation of the first two variables (mind adding an interval). Declare a third string variable and initialize it with the value of the object variable (you should perform type casting).

using System;

class ConcatenationAndCasting
{
    static void Main()
    {
        string firstPart = "Hello ";
        string secondPart = "World";
        object wholeObj = firstPart + secondPart;
        string wholeString = (string)wholeObj;
    }
}

8.Declare two string variables and assign them with following value: /The “use” of quotations causes difficulties./
Do the above in two different ways: with and without using quoted strings.

using System;

class QuoteProblems
{
    static void Main()
    {
        Console.WriteLine("The "use" of quotations causes difficulties.");
        Console.WriteLine(@"The ""use"" of quotations causes difficulties.");
    }
}

9.Write a program that prints an isosceles triangle of 9 copyright symbols ©. Use Windows Character Map to find the Unicode code of the © symbol. Note: the © symbol may be displayed incorrectly.

using System;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        Console.OutputEncoding = Encoding.Unicode;
        int copyRignt = 169;
        byte spaceing = 2;
        for (int rows = 0; rows < 3; rows++)
        {
            for (int spaceCounter = 0; spaceCounter < spaceing; spaceCounter++) 
            {
                Console.Write(" ");
            }
            for (int cols = 0; cols <= rows; cols++)
            {
                Console.Write((char)copyRignt);
            }
            for (int cols = 0; cols <= rows - 1; cols++)
            {
                Console.Write((char)copyRignt);
            }
            spaceing--;
            Console.WriteLine();
        }
    }
}

10. A marketing firm wants to keep record of its employees. Each record would have the following characteristics – first name, family name, age, gender (m or f), ID number, unique employee number (27560000 to 27569999). Declare the variables needed to keep the information for a single employee using appropriate data types and descriptive names.

using System;

class MarketingFirmInfo
{
    static void Main()
    {
        string firstName = "Ivan";
        string lastName = "Ivanov";
        byte age = 23;
        char gender = 'm';
        long ID = 213124123;
        uint uniqueNumber = 27569999;
    }
}

11. Declare two integer variables and assign them with 5 and 10 and after that exchange their values.

using System;

class ChangeingValues
{
    static void Main()
    {
        int a = 5;
        int b = 10;
        int c;
        c = a;
        a = b;
        b = c;
        Console.WriteLine("The value of " a " is {0} and the value of " b " is {1}", a, b);
    }
}

12. Find online more information about ASCII (American Standard Code for Information Interchange) and write a program that prints the entire ASCII table of characters on the console.

using System;
using System.Text;

class ASCIIsymbols
{
    static void Main()
    {
        Console.OutputEncoding = Encoding.Unicode;
        for (int i = 0; i <= 255; i++ )
        {
            char symbol = (char)i;
            Console.WriteLine("ASCII symbol {0} and its number {1}",symbol,i);
        }
    }
}

13. Create a program that assigns null values to an integer and to double variables. Try to print them on the console, try to add some values or the null literal to them and see the result.

using System;

class NullValues
{
    static void Main()
    {
        int? nullVauleOne = null;
        double? nullValueTwo = null;
        Console.WriteLine("First varibale {0} and second varibale {1}", nullVauleOne, nullValueTwo);
        Console.WriteLine(nullVauleOne + nullValueTwo);
        Console.WriteLine(nullVauleOne + 12);
        nullVauleOne = 5;
        Console.WriteLine(nullVauleOne.GetValueOrDefault());
    }
}

14. A bank account has a holder name (first name, middle name and last name), available amount of money (balance), bank name, IBAN, BIC code and 3 credit card numbers associated with the account. Declare the variables needed to keep the information for a single bank account using the appropriate data types and descriptive names.

using System;

class DoublesAndFloats
{
    static void Main()
    {
        string firstName = "Teodor";
        string middleName = "Ivanov";
        string lastName = "Kurtev";
        decimal balance = 1000;
        string bankName = "BNB";
        string IBAN = "";
        string BIC = "";
        ulong creditCard1 = 1111;
        ulong creditCard2 = 123123;
        ulong creditCard3 = 334324;

    }
}