Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

sum=1+1/2+1/3+1/4++1 The program includes two functions in parts a) and b) below: [11 marks] (a) The function main (): [5 Marks] accept no input parameter

image text in transcribed

sum=1+1/2+1/3+1/4++1 The program includes two functions in parts a) and b) below: [11 marks] (a) The function main (): [5 Marks] accept no input parameter and without return value ask user to input an end value (e.g. n=100) and store it in a variable named: n display the input end value on screen properly call the sumH () with the input data as argument Call the main () function for starting execution (b) The function sumH (): [6 Marks] accept one parameter (newN), and without return value calculate the sum (use range () to manipulate the accepted parameter of newN in the for loop) and store it in a variable named: sum finally display the sum on screen as the sample output below (c) Write a Python program to create a list with 5 integers, find and display the average value by using built-in functions sum () and len (). .[5 Marks] - Create a list named myLi ist and initialize it with 5 integers below - 11,22,33,44, ab Make sure use Your Student ID! - Remark: for integer ab, use the last 2 digits of vour student ID. E.g. Use 55 for ab above, if your student ID is 55 Display the list values on a single line by using for loop Determine and display the average (in integer type) of the list by using built-in sum () and len ()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Theory And Application Bio Science And Bio Technology International Conferences DTA And BSBT 2011 Held As Part Of The Future Generation In Computer And Information Science 258

Authors: Tai-hoon Kim ,Hojjat Adeli ,Alfredo Cuzzocrea ,Tughrul Arslan ,Yanchun Zhang ,Jianhua Ma ,Kyo-il Chung ,Siti Mariyam ,Xiaofeng Song

2011th Edition

3642271561, 978-3642271564

More Books

Students also viewed these Databases questions

Question

Question in Chemical Engineering Please Write Correct answer 1 .

Answered: 1 week ago