Some problems for your consideration

Slides:



Advertisements
Similar presentations
CHOSE TEAMS AND ONE SCORE KEEPER CHOSE TEAMS AND ONE SCORE KEEPER LOOK AT THE CATEGORY LOOK AT THE CATEGORY CHOSE THE MOST POPULAR ANSWER CHOSE THE.
Advertisements

E.g.9 For to do loop for i:=1 to 10 do writeln(i); While do loop i:=1;
Exercise (1).
Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
ALGORITHMS & FLOWCHARTING II
Welcome to Jeff’s baseball game! Here is how to play. You are asked a math question and you have to get it right or you will repeat the question until.
Flowcharts Remember that a solution to a problem is called an algorithm. Algorithms are often a series of steps required to solve the problem. A flowchart.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
NFA- to NFA conversion. Purpose This presentation presents an example execution of the algorithm which takes as input an NFA with -transitions and produces.
K-means Clustering. What is clustering? Why would we want to cluster? How would you determine clusters? How can you do this efficiently?
( ) EXAMPLE 1 Evaluating Square Roots a. 36 = 6 6 because 2 = 36 . b.
Computer Science: A Structured Programming Approach Using C1 3-7 Sample Programs This section contains several programs that you should study for programming.
Roots Rational Numbers Scientific Notation More with Exponents Laws of Exponents
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
Algorithms and Flowcharts for Programming CFD
Iteration Iterative operator: for, du, while. Problem: Infinite and time-consuming iterations. Halting problem: We are not able to determine whether an.
Additional Problems.
Estimating Square Roots to the Tenths and Hundredths Place.
Repetition & Loops. One of the BIG advantages of a computer: ­It can perform tasks over and over again, without getting bored or making mistakes (assuming.
Loop Application: Numerical Methods, Part 1 The power of Matlab Mathematics + Coding.
More While Loop Examples CS303E: Elements of Computers and Programming.
( + ) ÷ ( + ) = ( + ) ( – ) ÷ ( – ) = ( + ) Simplify the following. ( + ) ÷ ( – ) = ( – ) ( – ) ÷ ( + ) = ( – ) 1) – 54 ÷ ( – 9 )= 6 2) – 48 ÷ 6= – 8 3)
Even more problems.. Mean (average) I need a program that calculates the average of student test scores. I need a program that calculates the average.
Chapter 10 Algorithm Analysis.  Introduction  Generalizing Running Time  Doing a Timing Analysis  Big-Oh Notation  Analyzing Some Simple Programs.
Program Design. The design process How do you go about writing a program? –It’s like many other things in life Understand the problem to be solved Develop.
 CHOSE TEAMS AND ONE SCORE KEEPER  LOOK AT THE CATEGORY  CHOSE THE MOST POPULAR ANSWER  1000 PEOPLE SURVEYED WORLDWIDE  ONE TEAM, ONE GUESS. UNTIL.
 CHOSE TEAMS AND ONE SCORE KEEPER  LOOK AT THE CATEGORY  CHOSE THE MOST POPULAR ANSWER  1000 PEOPLE SURVEYED WORLDWIDE  ONE TEAM, ONE GUESS. UNTIL.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
5 While-Statements © 2010 David A Watt, University of Glasgow Accelerated Programming 2 Part I: Python Programming.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Think Possibility 1 Iterative Constructs ITERATION / LOOPS C provides three loop structures: the for-loop, the while-loop, and the do-while-loop. Each.
EGR 115 Introduction to Computing for Engineers Loops and Vectorization – Part 1 Monday 13 Oct 2014 EGR 115 Introduction to Computing for Engineers.
Flowchart. a diagram of the sequence of movements or actions of people or things involved in a complex system or activity. a graphical representation.
PROBLEM SOLVING. REDBLUE GREENPINK ORANGEYELLOW Exit.
160 as a product of its prime factors is 2 5 x 5 Use this information to show that 160 has 12 factors.
Why Repetition? Read 8 real numbers and compute their average REAL X1, X2, X3, X4, X5, X6, X7, X8 REAL SUM, AVG READ *, X1, X2, X3, X4, X5, X6, X7, X8.
Irvine, Kip R. Assembly Language for x86 Processors 7/e, What's Next Linking to an External Library The Book's Link Library Stack Operations Defining.
What you need today…  Pen/pencil  Calculator  Composition notebook  Histogram out from yesterday Schedule: Go over histograms Day 5: Standard Deviation.
,000 Word Problems Estimation Square Roots Math Vocabulary Miscellaneous ,000.
Programming revision Revision tip: Focus on the things you find difficult first.
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
14.0 Math Review 14.1 Using a Calculator Calculator
Find the square root of a number
Activity based around:
Introduction to Algorithms
Lecture 7: Repeating a Known Number of Times
Computer Programming Flowchart.
25 Math Review Part 1 Using a Calculator
CHAPTER 5A Loop Structure
ALGORITHMS & FLOWCHARTING II
Square Roots Practice © T Madas.
Some problems for your consideration
2008/09/24: Lecture 6b CMSC 104, Section 0101 John Y. Park
Introduction to pseudocode
Computers & Programming Languages
Computing Functions with Turing Machines
Loops CIS 40 – Introduction to Programming in Python
Computer Science 1 For..do loop Dry Run Take notes on the For loop
Warm Up Solve: −
Building Java Programs
Question 38.
Dry Run Fix it Write a program
Objective: To graph square root functions
Solving Quadratic Equations by Finding Square Roots
WJEC GCSE Computer Science
Algorithms For use in Unit 2 Exam.
Some problems for your consideration.
REPETITION Why Repetition?
Lecture 6 - Recursion.
Presentation transcript:

Some problems for your consideration

What’s in a name “Remember that a person's name is to that person the sweetest and most important sound in any language.” from Dale Carnegie’s “How to Win Friends and Influence People” Write a program that writes out your best friend’s name 100 times.

What’s in a name “Remember that a person's name is to that person the sweetest and most important sound in any language.” from Dale Carnegie’s “How to Win Friends and Influence People” Write a program that prompts you for a number and then writes out your best friend’s name that many times.

Summation Write a program that prompts the user for a positive integer, n, and then calculates the following:

Factorial Write a program that prompt the user for a positive integer, n, and then calculates n!.

Mean (average) I need a program that calculates the average of student test scores. The program should first prompt for the number of students, s. The program should then prompt for s test scores. Finally, the program should report the average.

Babylonian algorithm for square root of n (revisited) Steps: Make a guess at the answer (you can pick n/2 as your initial guess). Compute r = n / guess. Set guess = (guess+r) / 2. Go back to stop 2 for as may iterations as necessary. The more you repeat steps 2 and 3, the close guess will be to the square root of n. Write a program that inputs n, iterates through the algorithm K times, and outputs the answer.