diff --git a/HW/1/README.md b/HW/1/README.md index c646fcf..fc1db1f 100644 --- a/HW/1/README.md +++ b/HW/1/README.md @@ -21,18 +21,11 @@ There are 30 marks available and are awarded grades as follows: ##Data Representation ###1 - Why do we represent data using binary when using computers *(1 mark)* - -``` -answer here -``` +Because computers read 1s and zeros or on and offs. ###2 - How would we represent the number 147 in binary? *(1 mark)* -``` -answer here -``` +10010011 ###3 - Can you convert the hexadecimal number **b5** to denary, there is a mark for you working. *(2 marks)* -``` -answer here -``` +181 ###4 - Here is a function written is **pseudocode**. ``` FUNCTION validUser (users , user) @@ -47,13 +40,10 @@ ENDFUNCTION (a) What type of data is **users**? **(1 mark)** ``` -answer here -``` - +integer (b) What type of data is returned by this function? **(1 mark)** ``` -answer here -``` +integer ##Errors ###6 - This program is supposed to find the mean of a list of numbers and print it out for the user: @@ -68,37 +58,29 @@ line7: OUTPT mean ``` (a) On which line is there a **syntax** error? **(1 mark)** -``` -answer here -``` +line7 (b) What is meant by a **syntax** error? **(1 mark)** -``` -answer here -``` +Where the user has mistyped or misused a symbol or character and the program cannot run. (c) Identify a logical error in the program and suggest how this might be fixed. **(2 marks)** -``` -answer here -``` - +The mean is eq (d) Describe and give an example of the 3rd kind of programming error. **(2 marks)** -``` -answer here -``` +A run time error, this type of area is quite common and occurs whenever the program tells the computer to do something that it is not designed to do. ##Algortithms ###7 - Write an **algorithm** that if given a list of numbers could find the largest. Try to use [pseudocode](http://filestore2.aqa.org.uk/subjects/AQA-GCSE-COMPSCI-W-TRB-PSEU.PDF). -``` -answer here -``` +FUNCTION num_list_sort +listofnumbers <- user input + + ##Networking ###8 - Research the following methods (*topologies*) for connecting devices to a network. In each case give a description and at least 1 advantage and 1 disadvantage. **Bus Topology (6 marks)** ``` -Describe: +Describe: A bus network is where all the machines, servers and printers Advantages: diff --git a/HW/2/tables.py b/HW/2/tables.py index 0b91656..161bda8 100644 --- a/HW/2/tables.py +++ b/HW/2/tables.py @@ -1 +1,5 @@ #paste code here +timesNumber = int(input("What number would you like to times: ")) +numberTO = int(input("How far do you want to go up to: ")) +for x in range(1,(numberTO+1)): + print(timesNumber * x)