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.

Slides:



Advertisements
Similar presentations
E.g.9 For to do loop for i:=1 to 10 do writeln(i); While do loop i:=1;
Advertisements

CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
Newton’s Method finds Zeros Efficiently finds Zeros of an equation: –Solves f(x)=0 Why do we care?
Binder Object-Oriented Testing Metrics. Lack of Cohesion in Methods b b In order to calculate the lack of Cohesion in methods, the Software Engineer must.
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.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
Calculator Shortcut – Solving Trinomials
COMPUTER INSTRUCTOR J.H.S. GOT, MORADABAD How to Square A Number :- To square a number, just multiply it by itself...
( ) EXAMPLE 1 Evaluating Square Roots a. 36 = 6 6 because 2 = 36 . b.
REPETITION STRUCTURES. Topics Introduction to Repetition Structures The while Loop: a Condition- Controlled Loop The for Loop: a Count-Controlled Loop.
Experimental determination of motor model parameters ETEC6419.
CSEB114: Principle of programming
Iteration Iterative operator: for, du, while. Problem: Infinite and time-consuming iterations. Halting problem: We are not able to determine whether an.
Computer Science 111 Fundamentals of Programming I The while Loop and Indefinite Loops.
Additional Problems.
Loop Application: Numerical Methods, Part 1 The power of Matlab Mathematics + Coding.
CS 108 Computing Fundamentals Notes for Thursday, February 19, 2015.
4.5: Linear Approximations, Differentials and Newton’s Method.
4.5: Linear Approximations, Differentials and Newton’s Method Greg Kelly, Hanford High School, Richland, Washington.
CSCI-100 Introduction to Computing
Introduction to Loops For Loops. Motivation for Using Loops So far, everything we’ve done in MATLAB, you could probably do by hand: Mathematical operations.
CS 100 Introduction to Computing Seminar October 7, 2015.
LINEARIZATION AND NEWTON’S METHOD Section 4.5. Linearization Algebraically, the principle of local linearity means that the equation of the tangent.
Standard Deviation A Measure of Variation in a set of Data.
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.
Intro to Loops 1.General Knowledge 2.Two Types of Loops 3.The WHILE loop 1.
E x i t ?Help ABC Home Quiz Pick It Out ? Closer Look E x i t ?Help Home.
Lloyd Algorithm K-Means Clustering. Gene Expression Susumu Ohno: whole genome duplications The expression of genes can be measured over time. Identifying.
PROBLEM SOLVING. REDBLUE GREENPINK ORANGEYELLOW Exit.
Given a set of data points as input Randomly assign each point to one of the k clusters Repeat until convergence – Calculate model of each of the k clusters.
Design Document Sample Given two concentrated circles with different radii, calculate the area which falls inside the big circle but outside the small.
Program Design & Development EE 201 C7-1 Spring
4.5: Linear Approximations, Differentials and Newton’s Method Greg Kelly, Hanford High School, Richland, Washington.
14.0 Math Review 14.1 Using a Calculator Calculator
Simplifying Radicals. You’ve already done some work with radicals and square roots such as: Finding the square root of perfect squares Estimate the square.
Estimating Square Roots
Find the square root of a number
Computer Programming Flowchart.
25 Math Review Part 1 Using a Calculator
Some problems for your consideration
Chapter 5: Control Structure
A Brief Introduction of RANSAC
ALGORITHMS & FLOWCHARTING II
Square Roots Practice © T Madas.
Some problems for your consideration
Polynomial Long Division Review
For Monday Read WebCT quiz 18.
Control Structure Senior Lecturer
Introduction to pseudocode
Algorithms & Pseudocode
Square Roots & Cube Roots
For Wednesday No new reading No quiz.
The Distance Formula.
Let’s all Repeat Together
Section 4.8: Newton’s Method
3.8 Newton’s Method How do you find a root of the following function without a graphing calculator? This is what Newton did.
4.8: Linear Approximations, Differentials and Newton’s Method
4.5: Linear Approximations, Differentials and Newton’s Method
Learning Intention I will learn about the iterative software development process with a focus on the Analysis stage.
Another Example Problem
5.5: Linearization and Newton’s Method
Warm Up Solve: −
Question 38.
Square Roots
WJEC GCSE Computer Science
Algorithms For use in Unit 2 Exam.
Iteration – While Loops
Presentation transcript:

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 of student test scores. 1. The program should prompt for test scores (0..100) until a special/crazy score (999) is entered. The program should then stop asking for more test scores. The program should then stop asking for more test scores. 2. It should then report the average (but not include the crazy 999 in the calculation).

Babylonian algorithm for square root of n (revisited) Steps: 1. Make a guess at the answer (you can pick n/2 as your initial guess). 2. Compute r = n / guess. 3. Set guess = (guess+r) / Go back to stop 2 for as may iterations as necessary. The more you repeat steps 2 and 3, the closer 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.