1 / 8

More Nested Loops and Lab 5

More Nested Loops and Lab 5. Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg. Announcements. UNI Computer Club Meeting is today! PA 4 is available Before starting, read Chapter 3.1-3.5!!!!! Discusses tools for program development Very important chapter!!. Yesterday’s Lab.

tstair
Télécharger la présentation

More Nested Loops and Lab 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. More Nested Loops and Lab 5 Intro to Computer Science CS1510, Section 2 Dr. Sarah Diesburg

  2. Announcements • UNI Computer Club Meeting is today! • PA 4 is available • Before starting, read Chapter 3.1-3.5!!!!! • Discusses tools for program development • Very important chapter!!

  3. Yesterday’s Lab • Activity A • New ways to print on the same line • What gave you the most trouble in Activity B? • How did you address this? • What gave you the most trouble in Activity C?

  4. New ways to print # Playing with print endings x = 0 while x<10: print(x, end=‘ ’) x=x+1 print() print(“Final value of x is”,x)

  5. What code could we write to print: * * * * * * * * * * * * * * *

  6. Important things • Name your variables descriptive names! • x, y, z, a, b, c don’t make much sense with nested loops • Once you figure out what you need to do, write a detailed comment about it • Start by solving a small problem, then work up to larger problems • If all else fails, step through the program line by line

  7. Activity B • Here is where we worked through the single line summation problem

  8. Activity C • Here is where we worked through the multiple line summation problem (nested loop)

More Related