ICS3U Python Programming Evaluation 4

Instructions

These ICS3U Grade 11 Computer Science python coding questions will form a part of your final grade for this course and are to be handed in for grading. 

For all of the following questions:

  • Use a Python IDE of your choice (Spyder, IDLE, Pycharm, etc) and create a coded solution to the given problem.
  • Hand in the .py files for your solution.

Your grade will be based on your ability to demonstrate the overall expectations from the Ontario Computer Studies Curriculum

A1 – Data Sequencing 

  • Use variables to carry out mathematical calculations in a computational problem

A2 – Selection and Repetition Structures

  • Incorporate selection structures into a computer program.
  • Incorporate repetition structures into a computer program

B3 – Algorithm Design

  • Design and implement algorithms that solve problems

ICS3U Python Programming Evaluation Question 1

File Name: “ICS3UorderSum.py”

Write a program that continually generates 2 numbers between -5 and 5

  • After each number is generated display each pair from smallest to biggest along with the sum of the pair.
  • The program stops when the program generates a pair that is the negative of the other (Ex: -5 and 5 or -2 and 2, etc)
  • At the end of the program display the sum of all the numbers that were generated.

ICS3U Python Programming Evaluation Question 2

File Name: “ICS3UheadsUp.py”

You are going to write a program that “flips” a coin repeatedly and displays the results to the screen.  

  • The program only stops when a specific # of heads has been flipped.  That number of heads is specified by the user.
  • Your program should output the total number of flips made during execution.

ICS3U Python Programming Evaluation Question 3

File Name: “ICS3UdoubleDiamond.py”

Write a program that prints two diamonds side by side based on a number entered by the user.  

  • That input determines the number of rows in half the diamond.
  • There is to be a single space between the diamonds.  

For example, if the user entered the value of 9, then the following picture would be drawn on the screen.

NOTE:  You cannot use python’s print statement that uses a * to print characters a certain amount of times.  Use only loops to do your printing

ICS3U Evaluation Double Diamond