EECP 1290 Modern College of Business C Programming Project

User Generated

Nye2fuqv

Programming

EECP 1290

Modern College of Business and Science

EECP

Description

see the file attachment ……………………………………………………

…...............................................………………………………………………………....

Unformatted Attachment Preview

MINISTRY OF MANPOWER NIZWA COLLEGE OF TECHNOLOGY Engineering Department FINAL ASSIGNMENT : Semester-2, 2019-20(RESIT) Course Code EECP1290 : Computer Programming for Engg. Date & Time of Upload 23.06.2020 9.00 AM Submission Deadline & Date 24.06.2020 09.00 AM Instructions to the Students 1. The Final Assignment will be available in Moodle at 9:00 am on the date of examination until 9.00 am of the next day. 2. This is an open resource examination; there are 3 pages. Students are allowed to refer any digital materials (Internet, Proquest, Masader, and OER) with proper referencing and citation for each answers. 3. Students has to answer the questions typewritten in the word (.docx) format. Figures / Diagrams, equations and solving of problems can be written by hand and added to the document as a picture/image. 4. Save the assignment file using the student ID & Course code. [ Example : 22s1234 – EECP2291] 5. Students should submit the answers through the turnitin link provided in moodle page. If any problem occurs, send it to the course tutor email [Email: syed.imran@nct.edu.om ] 6. Students are encouraged to upload the answers in the moodle at least two hours before the deadline to avoid any technical issues. 7. In case of any technical problem in opening or submitting your assignment please contact your course tutor through email and copy to the Department Head. 8. Any form of cheating is punishable. Students involved in cheating will be treated according to the Plagiarism and Academic Integrity Policies. 9. Students are advised to write the answers in their own words and in own hand writing. Based on the plagiarism policy and the department approved similarity level, the marks will be deducted for the plagiarized [Copied] answers. 10. Students should complete their assignment within the given time. Assignments submitted after the deadline will be marked 0. Final Assignment PART A (Q.1 to Q.5) EACH QUESTION CARRIES 6 MARKS 5 x 6= 30 Marks 1 Write a python program to accept a number from the user: if the number is even, calculate the factorial of that number and print it. (3 marks) if the number is odd, print the multiplication table of that number. 2 (3 marks) Suppose the number of Corona positive patients was increasing in the order of 0, 1, 1, 2, 3, 5, 8, 13, 21, 34 for the first 10 days. Write the algorithm and python program to find the increase in number of patients till 50th day. (4 marks) Explain the program in your own words (2 marks) 3 Suppose the temperature of a Burger is 120 degrees Fahrenheit and you want to eat it at 115 degrees. A chip of ice turns out to lower the temperature one degree each time. You test the temperature each time, and also print out the temperature before reducing the temperature. Write a code in python for this. 4 Write a Python program to accept a number from user: ● if number is equal to 1, calculate area of triangle by taking 3 sides as input (2 marks) ● if number is equal to 2, calculate z=2 / 4 + 2 / 6 + 2 / 8 +................. + 2 / n (2 marks) ● if number is equal to 3, calculate z=5x/6y + 7x/8y + 9x/10y +……………. + nx/(n+1)y W5 ri Correct the errors and convert the following for loop to while loop. (2 marks) ( 3 + 3 marks) a=0; x=5 while x>=n a=a+8/X x=x+10; Print(a) Page 2 of 3 Final Assignment PART B (Q.6 and Q.7) Each Question contains 10 marks 2 x 10= 20 Marks 1. a.)There are 2 sections of Computer Programming. There are 20 students in Section ‘A’ and 15 students in Section ‘B’. Write a Python program that will accept the input for section from user: ( 4 marks) • if input is 1, input the marks for 3 tests and calculate the average for 20 students using for loop. • if input is 2, input the marks for 2 tests and calculate the average for 15 students using while loop. b.) Muscat Electricity Distribution Company charges each customer with a minimum of 2 OMR. If the total bill amount is more than 30 OMR, then an additional charge of 10% of the total bill is added to the total amount. It uses following tariff plan for calculating monthly electricity bill ( 6 marks) For the first 100 units, 0.100 OMR/unit For the next 200 units, 0.200 OMR/unit More than 300 units, 0.500 OMR/unit Write a python program to accept the user id, name of customer and number of units as input and calculate total amount(bill) to be paid. a.)2. a.)Mr. Ali wants to calculate the area of circle and square and print it. Write a python program to help him by accepting the input from the user. The input should satisfy following conditions: ( 5 marks) Circle: Sum of two even numbers between 80 and 90 Square: Product of two odd number between 200 and 300 b.) Write an Algorithm and Draw a flowchart for the given program: ( 5 marks) Number = int(input("Please Enter any Number: ")) Reverse = 0 while(Number> 0): Reminder = Number %10 Reverse = (Reverse *10) + Reminder Number = Number //10 print("\n Reverse of entered number is = %d" %Reverse) Page 3 of 3
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Both word and zip files.

Surname 1
Student’s Name
Professor’s Name
Course
Date
Python Final
Question 1
from math import factorial
number = int(input("Enter a number: "))
if number % 2 == 0: # case number is even
fact = factorial(number)
print(f"The factorial of {number} is {fact}")
else: # case number is odd
for i in range(1, 11):
product = i * number
print("{:2} x{:2} = {:2}".format(i, number, product))

Question 2
'''
0, 1, 1, 2, 3, 5, 8, 13, 21, 34 for the first 10 days
step 0: Start
step 1: Declare variables i, a, c, b
step 1.1: Initialize i to 0, a to 0, b to 1, and c to 0
step 2: Enter n (the number of days)
step 3: Display c, display b
step 4: Loop to execute the following
step 4.1: c = a + b
step 4.2: a = b
step 4.3: b = c
step 4.4: display c

Surname 2
step 4.5: increase i by 1
step 5: End
'''
i = a = c = 0
b = 1
n = int(input("Enter the number of due days: "))
print(c, end=", ")
print(b, end=", ")
while i < (n-2):
c = a + b
a = b
b = c
print(c, end=", ")
i += 1

"""
The above program is an implementation of the fibonacci series;
The first term is always 0, the next is 1, and the successive terms are a sum
of their corresponding preceding two terms.The series can go forever except when
restircted
by a specified first n terms where n is the number of required terms, like 50 in
this case,
"""

Question 3
"""
"""
current_temp = 120
required_temp = 115
while current_temp >= required_temp:
print(f"Current temp...


Anonymous
Excellent resource! Really helped me get the gist of things.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags