SOLUTIONS TO THE QUESTIONS DISCUSSED DURING THE FIRST REVIEW SESSION COSC 1306 Fall 2013.

Slides:



Advertisements
Similar presentations
Math Flash Fractions II By Monica Yuskaitis. How many halves are in a whole? 2 1/2.
Advertisements

Stations of the Cross. First Station: Jesus is condemned to die.
Early Math OrdinalandCardinalNumbers. Ordinal Numbers Early Math Move one.
Python Mini-Course University of Oklahoma Department of Psychology Day 2 – Lesson 8 Fruitful Functions 05/02/09 Python Mini-Course: Day 2 - Lesson 8 1.
Def f(n): if (n == 0): return else: print(“*”) return f(n-1) f(3)
Vocabulary Lesson Unit Title Here. first vocabulary word.
Ordinal Numbers. Order 1,2,3,4,5,6,7,8 These numbers are in order. 1,2,4,6,5,8,7 These numbers are not in order.
Math Ordinal Positions Grade 2 SOL 2.3 Created by; Kim Smith.
10 Little Gifts First one for you health Second for you luck.
10 ROSES FOR YOU for the New Year of the Rat
Let’s repeat the ordinal numbers!
Type Title Here for Tic-Tac-Toe Type names of students in group here.
Cut Scores Comparison: Reading WKCE Reading Scale Score by Grade Performance Level Advanced Proficient
9th Grade English / CARDINAL and ORDINAL NUMBERS  We use cardinal numbers ( one, two, three, four, five, six, seven, nine, ten…) to show.
On the first day of winter, my true love gave to me: a___________ in a tree.
Stations of the Cross.
The Solar System. Mercury Mercury is the closest planet to the sun. Mercury is the closest planet to the sun. Mercury is the eighth largest planet. Mercury.
COSC 1306 COMPUTER LITERACY FOR SCIENCE MAJORS Jehan-François Pâris
Solutions to the first midterm COSC 4330/6310 Summer 2012.
How To Take an ELA Test. 1.Always write neatly. 2.Always write A LOT. 3.Fill in all the lines. 4.Short answers = 4 sentences. 5.Bullets usually mean paragraphs.
Computer Science 111 Fundamentals of Programming I The while Loop and Indefinite Loops.
have breakfast have a break learn Maths speak English draw pictures read a tale write words sing songs listen to the teacher play computer.
10 Little Gifts The First for your health The Second for your luck.
Greater than & Less than Fractions Standard 2.1: Numbers, Number Systems, and Number Relationships C. Represent equivalent forms of the same number through.
The main program for postgraduate students master degree English legal system.
Twelve Days of Chemistry. On the first day of chemistry, my teacher said to me, write down the safety rules.
On the first day of Christmas when I brought home my tree My 12 cats were laughing at me.
K - 2 © 2012 Math As A Second Language All Rights Reserved Ordinal Numbers 1 – 10 and beyond with the Adjective/ Noun next.
Multiplying Common Fractions Multiplying next Using the Corn Bread © Math As A Second Language All Rights Reserved.
Happy New Year 2012 The top ten New Year’s Resolutions.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Last Week Modules Save functions to a file, e.g., filename.py The file filename.py is a module We can use the functions in filename.py by importing it.
Stations of the cross. The first Station: Jesus is condemned to death.
Example 1 Writing Powers Write the product as a power and describe it in words. a. 44= to the second power, or 4 squared 9 to the third power,
© Priya Rajendran A Dozen Roses The first rose holds the joy That's in my heart today; The.
Introduction to C++ Course Version 1.0. Topics Course Outline Course Materials Syllabus Blackboard Forum Why C++
G © 2012 Math As A Second Language All Rights Reserved Ordinal Numbers with the Adjective/ Noun next.
Fractions Part Two. How many halves are in a whole? 2 1/2.
The Solar System. Mercury Mercury is the closest planet to the sun. Mercury is the closest planet to the sun.
Zoom In Game.
The First Station: Jesus is Condemned to Die
The First Station Jesus is Condemned. The First Station Jesus is Condemned.
Adding Like Fractions Adding Like Fractions
Months of the Year ©Copyright
Ordinal Number's Amber, Mia, Angela.
Number Words 1st Grade.
Math Flash Fractions II

Student #7 starts with Locker 7 and changes every seventh door
Math Flash Fractions II
Math Flash Fractions II
The Stations Of The Cross
Social Justice Stations of the Cross

Chapter 10: Formal Codes of Ethics
Ms. Lindsey’s Kindergarten Class 11/1/16
Decision Maths Unit 7 Sorting Algorithms 3. Shell Sort.
3B Chapter 1 Open Day.
3B Chapter 1 Open Day.
冀教版 五年级上册 Lesson 24 Year Animals.
MATH 1310 Section 4.1.
Our birthdays 3B:Unit 3.
The Solar System.
Math Flash Fractions II
Ordinal Numbers.
Math Flash Fractions II
MATH 1310 Section 4.1.
Math Flash Fractions II
MATH 1310 Section 4.1.
JANUARY M T W T F S S Monday 1st semester Unit 2.
Presentation transcript:

SOLUTIONS TO THE QUESTIONS DISCUSSED DURING THE FIRST REVIEW SESSION COSC 1306 Fall 2013

First question Main memory Graphical user interface

Second and third questions Algorithmic approach: –Try all flavors in sequence. It always works. Heuristics: –Picking the tub that has the least ice cream. –Trying a a few likely winners.

Fourth question We cannot compare a string to a number

Fifth Question It will not work –Missing column athe end of the if

Sixth question Will loop forever –Should be: i = 5 while i > 0 : i= i -1 or I -= 1 –Use for I in range(…) instead

Seventh question a = 7.5 b = 2 c = 3.0 d = False

Eighth question """ Eighth Question""" first = input("Enter your first name: ") second = input("Enter your last name: ") print("Hello " + first[0] + ". " + second + "!")

Ninth question from math import sqrt def norm(a, b) : return sqrt(a*a + b*b) print(norm(3, 4)) will print 5.0

Tenth question from math import sqrt number = int(input("Enter an integer: ")) s= "This number is prime" biggest = int(sqrt(number)) for i in range(2, biggest + 1) : if (number % i == 0) : s = "This number is not prime" print(s) This solution wastes cycles: we should exit the loop as soon as we find out that the number is not prime!

Eleventh question Something like: s = “Cannot drink alcohol” if birthyear = 25 : s = “ Can drink alcohol”