Cpsc111-Su16-Asg41:50withAnswer_.docx -...

This preview shows page 1 - 3 out of 7 pages.

The preview shows page 1 - 3 out of 7 pages.
CPSC111-Introduction to computing By Dr. Ahmed Malki – Asg. #1 (Summer-16)Assignment 1Python Practice:functions, strings and DecimalBinary Conversion!ASSIGNMENT MARK:41 / 50Due Date: Tuesday, July 26thAs always, all your answers should use functions and every function shouldhave a documentation string explaining the purpose of the function. Use thePython template given below at the top of your program you submit (don’tforget to modify it to include your information; your name and your studentnumber.)# Program: cpsc111-Su16-asg1.py # Author: Enter your Name and student number here# Class: CPSC 111# Date: 18/07/2016 # Task: Assignment #1 # Purpose: Solving simple functions             # parallelogram()____________________________________# getUserInfo()______________________________________# conversionProcess()a user-interactive function to    # convert miles to kilometers.Do not wait until the last minute to do this assignment in caseyou run into problems.Submit your assignment to the instructor by email at:[email protected]Part 1 - Simple FunctionsYou will write a few Python functions for practice with the language. In yourprogram file, include a Python template comment at the top. Also includeeach of the following functions.1. parallelogram()2. getUserInfo()3. conversionProcess()1 |am/cpsc111-Su16-Asg1.docxAssigned: Monday, July 18th
CPSC111-Introduction to computing By Dr. Ahmed Malki – Asg. #1 (Summer-16)Function Name:parallelogram()Parameters:NoneReturn Value:NoneDescription:Write a Python function that asks the user to enter two positive integers,the height and length of aparallelogramand prints a parallelogram of thatsize with stars to the screen. For example, if the height were 3 and thelength were 6, the following would be printed:******************or if the height was 4 and the length was 2, the following would be printed:********Also, write the code that will demonstrate your function.# parallelogram() -- get the height and length from user and produce aparallelogramdef parallelogram():height,length = input('Enter two integers number of height and lengh: ')startnumber = 1printfor startnumber in range( 1 , height + 1):print

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 7 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
ahmed malki
Tags
Binary numeral system, Decimal, Kilogram, Dr Ahmed Malki

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture