Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


FC712 Programming

Mid Module Take Home Examination RESIT

Question Book

 

Instructions to students:

1. Your FC712 Programming mid-module resit assessment is an online, take home examination. This means that you can access module learning resources specified by your teacher (and only those materials) whilst you are answering the examination questions. The questions will not ask you to copy any specific information from your learning materials, rather you will be asked to use the information and apply it in a thoughtful way. This does not mean you will be summarising the information from a textbook; it means you will be asked to interpret or use the information in relation to the specific examination questions and/or problems/case studies/scenarios.

 

2. You are expected to work on this assessment on your own.  Please note that you may be required to attend an online meeting to confirm that it is your own work.

 

3. There are 7 questions in this paper.  You should attempt to answer all questions.

 

 

4. In order to complete this assessment successfully you must:  

• read the question paper carefully before you begin to answer

• follow the instructions on how to answer each question fully

• Section 1 – Type your answers into text files and save them as HTML and CSS files

Section 2 – Type your answers into your IDE and save it as a .py file

• please save each file following this format:

<YOUR STUDENT NUMBER – MODULE CODE – exam – dd.mm.yy>

eg: P123456-FC712-MMEresit-10.12.21>

 

5. You must submit your assessment file(s) by 12pm on the 10 of December 2021

 

 Now proceed to answer the examination questions below.

 

The following sections require you to write HTML and Python code. For full marks in each question you must comment well throughout your programs

 

Section 1 - Programming in HTML and CSS – Please save your code as .html and .css files

 

Write a multipage website on a topic of your choosing. Each page in the website should contain a links bar with links to each of the other pages, pages should be navigable using links and there should be a theme running through the design of all the pages. Your website should contain images which should also act as links. Your text should contain some semantic markup. You must make use of CSS style sheets to format your website. Higher marks will be awarded for websites that show a greater understanding of the use of CSS style sheets to format your website.

[10 marks]

 


Section 2 - Programming in Python – Please save your code as a .py file

1) Write a function called Pythag(a,b) which takes as parameters two float numbers, a and b which represent the two short sides on a right-angled triangle. The function should return the length of the hypotenuse of the corresponding triangle. Recall Pythagoras’ theorem says that the square of the length of the hypotenuse of a right-angled triangle is equal to the sum of the squares of the other two sides.

[4 Marks]

 

 

2) Write a function called leap_year(n) which takes as a parameter an integer number, n, between 0 and 10000. The function should determine if the number n represents a leap year or a non-leap year. To be a leap year, the year number must be divisible by four – except for end-of-century years, which must be divisible by 400. This means that the year 2000 was a leap year, although 1900 was not. 2020, 2024 and 2028 are all leap years. If n is a leap year the function should return True, if the year is not a leap year it should return False.

[4 Marks]

 

 

3) Write a function called isRight(a,b,c) which takes as parameters 3 float numbers, a, b and c which represent the 3 sides of a triangle. The function should test to see if the triangle is a right-angled triangle and should return True if it is and False otherwise. Please note: there is no order to the parameters so a might be the longest side, or b, or c.

[5 Marks]

 

 

4) Write a function called reverse_list(list1) which takes as a parameter a list. Using for loops, the function should return the list in the reverse order. For example, if list1 = [1,2,3,4] then the function should return the list = [4,3,2,1]. Note, you may not use the built in function list.reverse() to complete this question.

[5 Marks]

 

5) Write a function called middle_numbers(n) which takes as a parameter an integer number with an even number of digits, at least 4 digits long. The function should multiply together the two middle digits and return the original number with the middle digits replaced by the answer of the digits multiplied together. For example, if n = 2367, then the two middle digits are 3 and 6, which when multiplied together give 18, so the function should return 2187.

[6 Marks]

 

 

6) Write a function called remove_spaces(string) which takes as a parameter a string. The function should return the original string with all the spaces removed. For example if string = “This old man he played one”, the function should return “Thisoldmanheplayedone”.

[6 Marks]

Finally – please save your PDF, .html and .css files and your .py file in a zipped folder with the following name system:

<YOUR STUDENT NUMBER – MODULE CODE – exam-dd.mm.yy>