Answer:
Question is answered using python:
num = int(input("User Input: "))
for i in range(3):
num = num+1
print("Number is now "+str(num))
for i in range(3):
num = num-1
print("Number is now "+str(num))
Explanation:
This line prompts user for input
num = int(input("User Input: "))
The following iterates from 1 to 3
for i in range(3):
This increments user input each time
num = num+1
This prints the value of num after increment
print("Number is now "+str(num))
The following iterates from 1 to 3
for i in range(3):
This decrements the value of num
num = num-1
This prints the value of num after decrement
print("Number is now "+str(num))
Answer:
![\left[\begin{array}{ccccc}1&1&1&0&1\\0&1&1&0&0\\1&0&0&1&0\\1&1&0&1&1\\1&1&0&0&0\end{array}\right]](https://tex.z-dn.net/?f=%5Cleft%5B%5Cbegin%7Barray%7D%7Bccccc%7D1%261%261%260%261%5C%5C0%261%261%260%260%5C%5C1%260%260%261%260%5C%5C1%261%260%261%261%5C%5C1%261%260%260%260%5Cend%7Barray%7D%5Cright%5D)
Explanation:
To keep the checksum length minimum ,checksum field should be a 4x4 matrix with two dimensional even parity bit.
For this purpose first create a matrix of RxC dimensions and add one even parity bit at the end of each row and column.
parity bit is sort of a check flag used to detect errors in binary data.Error detection is done by adding total number of 1's in the binary sequence.
There are two types of parity bits
- Even
- Odd
For even parity if total number of 1 is even parity bit for that sequence would be (0).
For even parity if total number of 1 is odd parity bit for that sequence would be (1)
For odd parity if total number of 1 is odd parity bit for that sequence would be (0)
For odd parity if total number of 1 is even parity bit for that sequence would be (1)
This is all you need to do for this one add quotes around the number to make it a string. Then for the question I don't know if you need to answer it but I said that when there is only one string it creates and addition problem of 24 + 24 and then when there are two strings it puts them right next to each other making it look like the number 2424.
Answer:
The algorithm is as follows;
1. Start
2. Input TeddyBears
3. Input Hours
4. WagebyTeddy = 2 * TeddyBears
5. WagebyHour = 5 * Hours
6. If WagebyHour > WagebyTeddy then
6.1 Print WagebyHour
7. Else
7.1. Print WagebyTeddy
8. Stop
Explanation:
The following variables are used;
TeddyBears -> Number of teddy bears made
Hours -> Number of Hours worked
WagebyTeddy -> Wages for the number of teddy bears made
WagebyHour -> Wages for the number of hours worked
The algorithm starts by accepting input for the number of teddy bears and hours worked from the user on line 2 and line 3
The wages for the number of teddy bears made is calculated on line 4
The wages for the number of hours worked is calculated on line 5
Line 6 checks if wages for the number of hours is greated than wages for the number of bears made;
If yes, the calculated wages by hour is displayed
Otherwise
the calculated wages by teddy bears made is displayed