CS 1803 Individual Homework 2 Conditionals & Loops Due: Wednesday, February 2 nd, before 6 PM Out of 100 points

Similar documents
CS 1803 Individual Homework 2 Conditionals & Loops Due: Wednesday, September 8th, before 6 PM Out of 100 points

CS 1301 Pair Homework 4 Conditionals & Loops Due: Friday, October 1, before 6 PM Out of 100 points

CS 1803 Pair Homework 3 Calculator Pair Fun Due: Wednesday, September 15th, before 6 PM Out of 100 points

CS 1803 Pair Homework 4 Greedy Scheduler (Part I) Due: Wednesday, September 29th, before 6 PM Out of 100 points

CS 2316 Individual Homework 4 Greedy Scheduler (Part I) Due: Wednesday, September 18th, before 11:55 PM Out of 100 points

CS 2316 Pair 1: Homework 3 Enigma Fun Due: Wednesday, February 1st, before 11:55 PM Out of 100 points

CS 1803 Individual Homework 1 Python Practice Due: Wednesday, January 26th, before 6 PM Out of 100 points

CS 1301 Individual Homework 3 Conditionals & Loops Due: Monday February 8 th before 11:55pm Out of 100 points

CS 2316 Homework 9a GT Pizza Login Due: Wednesday November 6th Out of 100 points. Premise

CS Homework 4 Employee Ranker. Due: Wednesday, February 8th, before 11:55 PM Out of 100 points. Files to submit: 1. HW4.py.

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points

CS 1803 Pair Homework 10 Newsvendor Inventory Policy Due: Monday, November 29th before 6:00 PM Out of 100 points

CS 2316 Individual Homework 5 Joint Probability Out of 100 points

CS 2316 Homework 9a GT Room Reservation Login

CS 2316 Homework 9a Login Due: Friday, November 2nd, before 11:55 PM Out of 100 points. Premise

CS 1301 Pair Homework 2 Conversions Due: Monday January 27th, 2014, before 11:55pm Out of 100 points Files to submit: hw2.py

CS 2316 Homework 9b GT Room Reservation

CS 1301 Homework Robot Web Writer

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, January 20 th, before 11:55 PM Out of 100 points

CS 2316 Homework 9b GT Thrift Shop Due: Wednesday, April 20 th, before 11:55 PM Out of 100 points. Premise

Visit the TA Helpdesk (schedule posted on class website)

CS 2316 Individual Homework 1 Python Practice Due: Wednesday, August 28th, before 11:55 PM Out of 100 points

CS Homework 4 Lifeguard Employee Ranker. Due: Tuesday, June 3rd, before 11:55 PM Out of 100 points. Files to submit: 1. HW4.py.

This homework has an opportunity for substantial extra credit, which is described at the end of this document.

CMSC 201 Fall 2016 Homework 6 Functions

Individual Homework- Create Your Own Password! Due: September 15 th, 2014 Before 11:55PM Out of 100 points

Functional Programming, Classes, and Recursion!

Class #1. introduction, functions, variables, conditionals

MATH 1MP3 Homework #4 Due: 11:59pm, Wednesday, March 6.

3-4 Systems of Equations in Three Variables

Reviewing all Topics this term

Advanced Algebra I Simplifying Expressions

CMSC 201 Spring 2017 Project 1 Number Classifier

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question

Honors Computer Science Python Mr. Clausen Programs 4A, 4B, 4C, 4D, 4E, 4F

Lesson 2 Fractions on a Number Line

CS261: HOMEWORK 2 Due 04/13/2012, at 2pm

CS 1301 Exam 1 Fall 2010

SAMS Programming A/B. Lecture #1 Introductions July 3, Mark Stehlik

CSCD 255 HW 2. No string (char arrays) or any other kinds of array variables are allowed

1. What is the minimum number of bits needed to store a single piece of data representing: a. An integer between 0 and 100?

CMSC 201 Spring 2017 Homework 4 Lists (and Loops and Strings)

CS 115 Lecture 8. Selection: the if statement. Neil Moore

Boolean Expressions. Is Equal and Is Not Equal

Please make sure that when you submit your assignment, you submit a single HW6.py file that contains your entire assignment.

CMSC 201 Spring 2019 Lab 06 Lists

Homework 6: Higher-Order Procedures Due: 10:00 PM, Oct 17, 2017

61A Lecture 3. Friday, September 5

Lecture 1. Course Overview Types & Expressions

Name: Class Period: Math Models Packet. This packet is due Monday 4/24/17. Circumference and Arc Length

CS 1301 Exam 1 Fall 2010

CS 1301 Exam 1 Fall 2009

CS 1301 Exam 1 Answers Fall 2009

Homework Set 1- Fundamentals

CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 4

Basic Data Types and Operators CS 8: Introduction to Computer Science, Winter 2019 Lecture #2

CS1 Lecture 3 Jan. 18, 2019

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

by the evening of Tuesday, Feb 6

CS1 Lecture 3 Jan. 22, 2018

CSE 142, Autumn 2018 Programming Assignment #9: Critters (20 points) Due Tuesday, December 4th, 9:00 PM

Boolean Expressions. Is Equal and Is Not Equal

Introduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

Homework 2. Due 4:00pm, Wednesday, February 13, Installation and Handin 2

Math 180 Written Homework Solutions Assignment #1 Due Thursday, September 4th at the beginning of your discussion class.

Lecture 2: Variables & Assignments

Computer Science Grade 10 Sample -Term 2 Date: February 2018 Time: TBC Duration: 45 minutes

W13:Homework:H08. CS40 Foundations of Computer Science W13. From 40wiki

AP Computer Science Homework Set 1 Fundamentals

cd h: mkdir -p CS101 cd CS101 curl -O unzip zipfile cd CS101_Exam4

Unit O Student Success Sheet (SSS) Right Triangle Trigonometry (sections 4.3, 4.8)

CMSC 201 Spring 2018 Project 3 Minesweeper

NMC Sample Problems: Grade 8

MATH Ms. Becker

Homework 2 Solutions

Mobile Computing Professor Pushpendra Singh Indraprastha Institute of Information Technology Delhi Java Basics Lecture 02

Answer Key Lesson 5: Area Problems

Seventh Grade Spiraling Review Week 1 of First Six Weeks

Decisions, Decisions. Testing, testing C H A P T E R 7

Assignment 4: Due Friday Mar 11 at 6pm

Unit 5, Lesson 8: Calculating Products of Decimals

CMSC 201 Spring 2018 Project 2 Battleship

HW3: CS 110X C Domain Information. Final Version: 1/29/2014

CS 101, Spring 2016 March 22nd Exam 2

Programming for Engineers in Python. Autumn

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

Integrated Math 1 Module 3 Honors Sequences and Series Ready, Set, Go! Homework

What You ll Learn Today

Control and Environments Fall 2017 Discussion 1: August 30, Control. If statements. Boolean Operators

Lab 4: Strings/Loops Due Apr 22 at midnight

Midterm Review Session

Project 1. due date Sunday July 8, 2018, 12:00 noon

Simplifying Expressions

Homework 1. Notes. What To Turn In. Unix Accounts. Reading. Handout 3 CSCI 334: Spring, 2017

CpSc 1011 Lab 3 Integer Variables, Mathematical Operations, & Redirection

Objective: Use multiplication to calculate volume.

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

Homework 6: Higher-Order Procedures Due: 11:59 PM, Oct 16, 2018

STIDistrict Query (Basic)

Transcription:

CS 1803 Individual Homework 2 Conditionals & Loops Due: Wednesday, February 2 nd, before 6 PM Out of 100 points Files to submit: 1. HW2.py This is an INDIVIDUAL assignment! Collaboration at a reasonable level will not result in substantially similar code. Students may only collaborate with fellow students currently taking CS 1803, the TA's and the lecturer. Collaboration means talking through problems, assisting with debugging, explaining a concept, etc. You should not exchange code or write code for others. For Help: - TA Helpdesk Schedule posted on class website. - Email TA's or use T-Square Forums Notes: Don t forget to include the required comments and collaboration statement (as outlined on the course syllabus). Do not wait until the last minute to do this assignment in case you run into problems. Simple Functions You will write a few python functions for practice with the language. In your HW2.py file, include a comment at the top with your name, section, GTID/Email, and your collaboration statement. Also include each of the following functions. 1. checkheight 2. smallest 3. countup 4. multiplicationtables 5. complementmaker 6. combolock 7. badrecord 8. printtimestable 9. printtimes

Function Name: checkheight height - an integer representing the user's height in centimeters Either the string Have a great ride! or the string Sorry. You must be at least 1 meter 32 cm to ride. checkheight(125) --> Sorry. You must be at least 1 meter 32 cm to ride. checkheight(169) --> Have a great ride! Write a function for the superman ride at six flags that determines whether the user is taller than 1 meter 32 centimeters so that he or she can ride a roller coaster. If the user's height, which is provided by the parameter height, is greater than or equal to the minimum height, return the string 'Have a great ride!'. Otherwise, return the string 'Sorry. You must be at least 1 meter 32 cm to ride.' Function Name: smallest num1 - a floating point number being compared against num2 and num3 num2 - a floating point number being compared against num1 and num3 num3 - a floating point number being compared against num1 and num2 A floating point number that represents the smallest number of the three given values. smallest(433.1, 2340.32, 12323.7) --> 433.1 smallest(12.0, 32.1, 32.1) --> 12.0 smallest(23.44, 23.44, 23.44) --> 23.44 Write a function that takes in three numbers as parameters and returns the smallest of the three. If two or all of the numbers are equal, then just return one of them. The function may not use any built-in math functions, e.g. you may not use min().

Function Name: countup start - an integer greater than 0 representing the last number of the count sequence None 1. >>> countup(3) 1 2 3 I made it! 2. >>> countup(1) 1 I made it! Write a function to count up from one to a given number (inclusive). The function should print the numbers from 1 to the given number in ascending order, with each number being printed on its own line. After printing the required numbers, on a separate line, print the string ' I made it!' Function Name: multiplicationtables number an integer representing the number for which you want to create a multiplication table limit an integer representing how high you want the multiplication table to go None 1. >>>multiplicationtables(3, 4) 3*0 = 0 3*1 = 3 3*2 = 6 3*3 = 9 3*4 = 12 2. >>>mutiplicationtables(5, 2) 5*0 = 0 5*1 = 5 5*2 = 10 Write a function that takes in a two numbers. The first number is the number for which you wish to make a multiplication table; the second is how far you want the table to go. Have your function print out lines of the multiplication table as shown in the test case, by printing the number, the multiplication sign, the number you are multiplying it by, the equal sign, and what they equal.

Function Name: complimentmaker answer1 a boolean (True or False) representing whether the user is "super" answer2 - a boolean (True or False) representing whether the user is "nice" answer3 - a boolean (True or False) representing whether the user is "smart" answer4 - a boolean (True or False) representing whether the user is "cool" The string You are + the designated compliments +. 1. complimentmaker(true, True, True, True) --> You are super nice smart cool. 2. complimentmaker(true, False, True, False) --> You are super smart. 3. complimentmaker(false, False, False, False) --> No Comment. Write a function that returns a string of compliments based on the adjectives selected by the inputs. Use the inputs True and False. The function should return the string You are concatenated with the compliments that are true. The four compliments should be: "super" "nice" "smart" and "cool". If none of the compliments are true, return the string No comment instead. Function Name: combolock num1 a positive integer representing the first digit in the combination num2 a positive integer representing the second digit in the combination num3 a positive integer representing the third digit in the combination num4 a positive integer representing the fourth digit in the combination num5 a positive integer representing the fifth digit in the combination Either the string You opened the lock. or the string You are locked out. 1. combolock(8, 2, 5, 4, 2) --> You are locked out. 2. combolock(2, 8, 3, 6, 7) --> You opened the lock. 3. combolock(11, 2, 5, 6, 4) --> You are locked out. You own a combination lock that only opens when presented with the correct sequence of odd and even numbers that are less than 10. Write a function that takes in 5 integers. Check whether they are in this order: even, even, odd, even, odd. If they are in the correct order and all below 10, then return the string You opened the lock. Otherwise, return You are locked out.

Function Name: badrecord sentence - a string with at least one character A string containing the capital letter characters from the input string. 1. badrecord( CS is fun! I love coding. ) --> CSI 2. badrecord( My Favorite Food is Pizza. ) --> MFFP 3. badrecord( oooooo ) --> O Write a function that uses a for loop to create and return a new string that contains the capital letters the original input string. You may use a for loop to automatically index into the sequence. If the input string has no capital letters, you must return an empty string. Function Name: printtimestable none none You are hired to develop an educational software package. Your first job: Write a function printtimestables() that will print the times tables (1 to 9) on the screen. When your function is called, it should print the following: Times: 1 2 3 4 5 6 7 8 9 1 1 2 3 4 5 6 7 8 9 2 2 4 6 8 10 12 14 16 18 3 3 6 9 12 15 18 21 24 27 4 4 8 12 16 20 24 28 32 36 5 5 10 15 20 25 30 35 40 45 6 6 12 18 24 30 36 42 48 54 7 7 14 21 28 35 42 49 56 63 8 8 16 24 32 40 48 56 64 72 9 9 18 27 36 45 54 63 72 81 Note that your function must print a header (Times: 1...9) and a first column number that goes from 1..9, while the interior of the grid is the X * Y value. Hint: Using two loops (one inside of the other) is an easy (but not the only) way to accomplish this. You may want to use tab characters ( \t ) to space your grid out correctly.

Function Name: printtimes N an integer that limits the upper bound of the times table (inclusive) Return Values: none Your boss was impressed with your 9x9 times table function. Now he wants you to modify the function so that it will work for for any sized times table. Write a printtimes( N ) function that will print a times table from 1 up to N, for any positive number N. Grading You will earn points as follows for each function that works correctly according to the specifications. checkheight 5 smallest 10 countup 5 multiplicationtables 10 complementmaker 10 combolock 15 badrecord 15 printtimestable 10 printtimes 20