3.4 Summary
This chapter included the system of the device and criteria, where it includes the block diagram and its explanations, and its main blocks that is used in this device, hardware requirements and a small brief about it and how it’s used in the device, and the flow chart of the device in its final phase with a miner explanation on it.
5.1 Overview
The implementation phases of the given device started with understanding the flow chart and block diagram that explains the flow of the device working criteria as shown before in the third chapter, then comes the software and hardware implementation phases. Software implementation includes drawing the circuit in the Proteus software and showing the expected output from the hardware circuit. Moving on to the hardware phase which will include the physical implementation of the components of the device and how they are connected. 5.7 Summary
This chapter has explained the software system of the device and its expected output, the hardware implementation of the system with its explanations, and the testing process with its result. The software implementation was done using Proteus software, and Hardware implementation included connected the components in the mentioned stages. Finally the testing was done into three stages; testing of components, testing of subsystem circuits, and testing of the device in its final stage after finishing its implementation
6.1 Overview
This chapter includes the result obtained from testing the system in different conditions and in many stages, and a comparison between both hardware and software implementation
6.5 Summary
Chapter 6 Results And Discussions
This chapter included the result obtained from testing the device in different conditions and in many stages, and a comparison between both hardware and software implementation. Additionally, brief comparison between the experimental result from this device and the output from other previous literature device was mentioned.
54
ACKNOWLEDGEMENT
This project has helped me to expand my knowledge about clean energy sources and how to use them since it has been an area of interest for me since high school. It also helped me to relate between this field and my specialization in telecommunications engineering.
First of all, I would like to send my thanking prayers to Allah the whole mighty, first and foremost for helping me to complete this project successfully and within the needed time and blessing my time and effort. Furthermore, I would like to express my deepest appreciation to the project supervisor MR. Athar aziz for his constant and ultimate help in support that guided me to complete the project successfully. Last but not least, special thanks to my family and friends whom I wouldn’t complete my work professionally without their endless support and prayers.
CS 222 01Programming Assignment 05 – Chapter 0520 Points
Due: Friday, December 7, 2018
In the hash table program example used in class, the hash t.
A Critique of the Proposed National Education Policy Reform
3.4 Summary This chapter included the system of the device and c.docx
1. 3.4 Summary
This chapter included the system of the device and criteria,
where it includes the block diagram and its explanations, and its
main blocks that is used in this device, hardware requirements
and a small brief about it and how it’s used in the device, and
the flow chart of the device in its final phase with a miner
explanation on it.
5.1 Overview
The implementation phases of the given device started with
understanding the flow chart and block diagram that explains
the flow of the device working criteria as shown before in the
third chapter, then comes the software and hardware
implementation phases. Software implementation includes
drawing the circuit in the Proteus software and showing the
expected output from the hardware circuit. Moving on to the
hardware phase which will include the physical implementation
of the components of the device and how they are connected.
5.7 Summary
This chapter has explained the software system of the device
and its expected output, the hardware implementation of the
system with its explanations, and the testing process with its
result. The software implementation was done using Proteus
software, and Hardware implementation included connected the
components in the mentioned stages. Finally the testing was
done into three stages; testing of components, testing of
subsystem circuits, and testing of the device in its final stage
after finishing its implementation
6.1 Overview
This chapter includes the result obtained from testing the
system in different conditions and in many stages, and a
comparison between both hardware and software
implementation
6.5 Summary
2. Chapter 6 Results And Discussions
This chapter included the result obtained from testing the device
in different conditions and in many stages, and a comparison
between both hardware and software implementation.
Additionally, brief comparison between the experimental result
from this device and the output from other previous literature
device was mentioned.
54
ACKNOWLEDGEMENT
This project has helped me to expand my knowledge about clean
energy sources and how to use them since it has been an area of
interest for me since high school. It also helped me to relate
between this field and my specialization in telecommunications
engineering.
First of all, I would like to send my thanking prayers to Allah
the whole mighty, first and foremost for helping me to complete
this project successfully and within the needed time and
blessing my time and effort. Furthermore, I would like to
express my deepest appreciation to the project supervisor MR.
Athar aziz for his constant and ultimate help in support that
guided me to complete the project successfully. Last but not
least, special thanks to my family and friends whom I wouldn’t
complete my work professionally without their endless support
and prayers.
CS 222 01Programming Assignment 05 – Chapter 0520 Points
Due: Friday, December 7, 2018
In the hash table program example used in class, the hash table
size was chosen to be 47. If the table gets full, this needs to be
increased. Re-implement the put method so that the table will
automatically resize itself when the loading factor reaches a
3. predetermined value (you can decided the value based on your
assessment of load versus performance).
What will need to be done:
· Determine what you want to use as the loading factor
· Create a new hash table where the hash table size is the next a
prime number at least 25% larger than the current table size.
You will need to add code that will find the next prime number
· Re-hash all the current values in the hash table and put them
in the new hash table
· Clear the old hash table and copy all the new values from the
new hash table into the old hash table
Add the following comments to the beginning of the program.
Name: Your Name
Class and Section: CS 222 01
Assignment: Program Assignment 05
Due Date: See above
Date Turned in:
Program Description: You write a short description of
what the program will do
When you complete the program, do the following.
1. Create a folder with the following name:
ProgramAssignment05
2. Copy your program to this folder
3. Copy the folder to your folder in the I:koppinboxCS 222 01
folder
Chapter 05/binarySearch.py
def binarySearch(alist, item):
first = 0
4. last = len(alist) - 1
found = False
compare = 0
while first <= last and not found:
midpoint = (first + last) // 2
compare += 1
if alist[midpoint] == item:
found = True
else:
if item < alist[midpoint]:
last = midpoint - 1
else:
first = midpoint + 1
return found, compare
def main():
lyst = []
for x in range(1000000):
5. lyst.append(x)
found, compare = binarySearch(lyst, 1000001)
print("is number in list", found)
print("Comparisons", compare)
main()
Chapter 05/bubbleSort.py
import random
def bubbleSort(alist):
for passnum in range(len(alist) - 1, 0, -1):
for i in range(passnum):
if alist[i] > alist[i + 1]:
temp = alist[i]
alist[i] = alist[i + 1]
alist[i + 1] = temp
def printList(alist):
6. count = 0
for x in range(len(alist)):
if count % 10 == 0:
print()
print("%4d" % alist[x], end = " ")
count += 1
def main():
lyst = []
n = int(input("Enter number of values: "))
for i in range(n):
lyst.append(i)
random.shuffle(lyst)
#print("List before sort")
#printList(lyst)
#print("nnList after sort")
bubbleSort(lyst)
#printList(lyst)
8. self.data[hashValue] = data # replace
else:
nextslot = self.rehash(hashValue, len(self.slots))
while self.slots[nextslot] != None and
self.slots[nextslot] != key:
print("newslot", self.slots[nextslot])
nextslot = self.rehash(nextslot, len(self.slots))
if self.slots[nextslot] == None:
self.slots[nextslot] = key
self.data[nextslot] = data
else:
self.data[nextslot] = data # replace
def hashFunction(self, key, size):
return key % size
def rehash(self, oldhash, size):
return (oldhash + 1) % size
9. def get(self, key):
startslot = self.hashFunction(key, len(self.slots))
data = None
stop = False
found = False
position = startslot
while self.slots[position] != None and
not found and not stop:
if self.slots[position] == key:
found = True
data = self.data[position]
else:
position = self.rehash(position, len(self.slots))
if position == startslot:
stop = True
return data
11. print("Hash 20:", H[20])
print("Hash 17:", H[17])
H[101] = "penguin"
H[20] = "duck"
print("Change Hash 20 from chicken to duck:", H[20])
print("Hash data")
print(H.data)
main()
Chapter 05/insertion.py
import random
def insertionSort(alist):
for index in range(1, len(alist)):
currentvalue = alist[index]
position = index
while position > 0 and alist[position - 1] > currentvalue:
alist[position] = alist[position - 1]
position -= 1
12. alist[position] = currentvalue
def main():
lyst = []
n = int(input("Enter number of values: "))
for i in range(n):
num = random.randint(1, n * 10)
while num in lyst:
num = random.randint(1, n * 10)
lyst.append(num)
print("Ready to Sort")
insertionSort(lyst)
count = 0
for i in range(len(lyst)):
if count % 10 == 0:
print()
count = 0
13. print(lyst[i], end = " ")
count += 1
main()
Chapter 05/mergeSort.py
import random
def mergeSort(alist):
if len(alist) > 1:
mid = len(alist) // 2
lefthalf = alist[:mid]
righthalf = alist[mid:]
mergeSort(lefthalf)
mergeSort(righthalf)
i = 0
j = 0
k = 0
while i < len(lefthalf) and j < len(righthalf):
14. if lefthalf[i] < righthalf[j]:
alist[k] = lefthalf[i]
i = i + 1
else:
alist[k] = righthalf[j]
j = j + 1
k = k + 1
while i < len(lefthalf):
alist[k] = lefthalf[i]
i = i + 1
k = k + 1
while j < len(righthalf):
alist[k] = righthalf[j]
j = j + 1
k = k + 1
def printList(alist):
count = 0
15. for x in range(len(alist)):
if count % 10 == 0:
print()
print("%4d" % alist[x], end = " ")
count += 1
def main():
lyst = []
n = int(input("Enter number of values: "))
for i in range(n):
lyst.append(i)
random.shuffle(lyst)
#print("List before sort")
#printList(lyst)
#print("Ready to Sort")
mergeSort(lyst)
printList(lyst)
17. while not done:
while leftmark <= rightmark and
alist[leftmark] <= pivotvalue:
leftmark = leftmark + 1
while alist[rightmark] >= pivotvalue and
rightmark >= leftmark:
rightmark = rightmark - 1
if rightmark < leftmark:
done = True
else:
temp = alist[leftmark]
alist[leftmark] = alist[rightmark]
alist[rightmark] = temp
temp = alist[first]
alist[first] = alist[rightmark]
alist[rightmark] = temp
return rightmark
18. def printList(alist):
count = 0
for x in range(len(alist)):
if count % 10 == 0:
print()
print("%4d" % alist[x], end = " ")
count += 1
def main():
lyst = []
n = int(input("Enter number of values: "))
for i in range(n):
lyst.append(i)
random.shuffle(lyst)
#printList(lyst)
#print("Ready to Sort")
20. return compare, binarySearch(alist[midpoint+1:],
item, compare)
def main():
lyst = []
compare = 0
for x in range(100):
lyst.append(x)
compare, found = binarySearch(lyst, 54, compare)
print("is number in list", found)
print("Comparisons", compare)
main()
Chapter 05/selectionSort.py
import random
def insertionSort(alist):
for index in range(1, len(alist)):
21. currentValue = alist[index]
position = index
while position > 0 and alist[position - 1] > currentValue:
alist[position] = alist[position - 1]
position -= 1
alist[position] = currentValue
def printList(alist):
count = 0
for x in range(len(alist)):
if count % 10 == 0:
print()
print("%4d" % alist[x], end = " ")
count += 1
def main():
lyst = []
n = int(input("Enter number of values: "))
22. for i in range(n):
lyst.append(i)
random.shuffle(lyst)
#print("List before sort")
#printList(lyst)
#print("nnList after sort")
insertionSort(lyst)
#printList(lyst)
main()
Chapter 05/sequentialSearch.py
import random
import time
def sequentialSearch(alist, item):
pos = 0
found = False
23. compare = 0
while pos < len(alist) and not found:
compare += 1
if alist[pos] == item:
found = True
else:
pos += 1
print(pos, alist[pos])
return found, compare
def main():
lyst = []
num = int(input("How many? "))
look = int(input("What number are you looking for? "))
for x in range(num):
lyst.append(x)
random.shuffle(lyst)
#random.shuffle(lyst)
24. start = time.time()
found, compare = sequentialSearch(lyst, look)
#print("is number in list", found)
end = time.time()
print("Comparisons:", compare)
print("Time:", end - start)
main()
Chapter 05/shellSort.py
import random
def shellSort(alist):
sublistCount = len(alist) // 2
while sublistCount > 0:
for startPosition in range(sublistCount):
gapInsertionSort(alist, startPosition, sublistCount)
sublistCount = sublistCount // 2
25. def gapInsertionSort(alist, start, gap):
for i in range(start + gap, len(alist), gap):
currentValue = alist[i]
position = i
while position >= gap and
alist[position - gap] > currentValue:
alist[position] = alist[position - gap]
position = position - gap
alist[position] = currentValue
def printList(alist):
count = 0
for x in range(len(alist)):
if count % 10 == 0:
print()
print("%4d" % alist[x], end = " ")
count += 1
26. def main():
lyst = []
n = int(input("Enter number of values: "))
for i in range(n):
lyst.append(i)
random.shuffle(lyst)
#print("List before sort")
#printList(lyst)
#print("nnList after sort")
shellSort(lyst)
#printList(lyst)
main()
Chapter 05/shortBubbleSort.py
import random
27. def bubbleSort(alist):
exchanges = True
passnum = len(alist) - 1
while passnum > 0 and exchanges:
exchanges = False
for i in range(passnum):
if alist[i] > alist[i + 1]:
exchanges = True
temp = alist[i]
alist[i] = alist[i + 1]
alist[i + 1] = temp
passnum -= 1
def printList(alist):
count = 0
for x in range(len(alist)):
if count % 10 == 0:
print()
28. print("%4d" % alist[x], end = " ")
count += 1
def main():
lyst = []
n = int(input("Enter number of values: "))
for i in range(n):
lyst.append(i)
#random.shuffle(lyst)
#print("List before sort")
#printList(lyst)
#print("nnList after sort")
bubbleSort(lyst)
#printList(lyst)
main()
29. Chapter 05/sortingTest.py
import random
import time
def shellSort(alist):
sublistCount = len(alist) // 2
while sublistCount > 0:
for startPosition in range(sublistCount):
gapInsertionSort(alist, startPosition, sublistCount)
#print("After increment of size", sublistCount, "the list
is")
#printList(alist)
sublistCount = sublistCount // 2
def gapInsertionSort(alist, start, gap):
for i in range(start + gap, len(alist), gap):
currentValue = alist[i]
position = i
while position >= gap and
30. alist[position - gap] > currentValue:
alist[position] = alist[position - gap]
position = position - gap
alist[position] = currentValue
def main():
lyst = []
for x in range(1000000):
lyst.append(x)
random.shuffle(lyst)
start = time.time()
lyst.sort()
end = time.time()
print("Time:", end - start)
start = time.time()
shellSort(lyst)