1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt WHILE.

Slides:



Advertisements
Similar presentations
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Advertisements

Advanced Piloting Cruise Plot.
Fig , p Table 10-1, p. 271 Fig , p. 272.
Fig. 4.21, p.96 Sue PeteBetty conveyor ground V s/g =0 V c/g =10 m/s V P/c =5 m/sV B/c =0 m/s V P/g =?
Chapter 1 The Study of Body Function Image PowerPoint
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
Fractions VI Simplifying Fractions
Multiplying Powers Dividing Powers Zero ExponentsNegative.
WHAT DO THEY ALL MEAN?. Median Is the number that is in the middle of a set of numbers. (If two numbers make up the middle of a set of numbers then the.
Chapter 3: Top-Down Design with Functions Problem Solving & Program Design in C Sixth Edition By Jeri R. Hanly & Elliot B. Koffman.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
Reducing Fractions. Factor A number that is multiplied by another number to find a product. Factors of 24 are (1,2, 3, 4, 6, 8, 12, 24).
Science Jeopardy >>>> Topic 1 Topic 2 Topic 4 Topic Topic 5.
2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt ShapesPatterns Counting Number.
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Teacher Name Class / Subject Date A:B: Write an answer here #1 Write your question Here C:D: Write an answer here.
Year 6 mental test 5 second questions
Year 6 mental test 10 second questions
School Shop. Welcome to my shop. You have 10p How much change will you get? 7p 3p change.
Multiplication and Division
It is 2 o C The temperature drops by 3 degrees What temperature is it now? -1 o C.
SOLVING EQUATIONS AND EXPANDING BRACKETS
Factorise the following 10x a – 20 36m a + 27b + 9c 9y² - 12y 30ab³ + 35a²b 24x4y³ - 40x²y.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Computer Science Recursion Yuting Zhang Allegheny College, 04/24/06.
1 CompSci 105 SS 2005 Principles of Computer Science Lecture 11: Linked Lists Lecturer: Santokh Singh Assignment 2 due tomorrow, i.e. Friday 21 Jan 2005.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
Green Eggs and Ham.
VOORBLAD.
1 Breadth First Search s s Undiscovered Discovered Finished Queue: s Top of queue 2 1 Shortest path from s.
1 public class Newton { public static double sqrt(double c) { double epsilon = 1E-15; if (c < 0) return Double.NaN; double t = c; while (Math.abs(t - c/t)
“Start-to-End” Simulations Imaging of Single Molecules at the European XFEL Igor Zagorodnov S2E Meeting DESY 10. February 2014.
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
8 2.
Do you have the Maths Factor?. Maths Can you beat this term’s Maths Challenge?
CS12230 Introduction to Programming Lecture 4-x – Consolidation 1.
© 2012 National Heart Foundation of Australia. Slide 2.
Lets play bingo!!. Calculate: MEAN Calculate: MEDIAN
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
8. 2_4 ÷ 2_4 = 1, 2_4 ÷ 1_2 = 1 or 1_2 ÷ 1_2 = _5 ÷ 2_5 = _6 ÷ 2_6 = 2, 2_3 ÷ 2_6 = 2, 4_6 ÷ 1_3 = 2 or 2_3 ÷ 1_3 = _ _12 ÷ 2_ _ 12=
25 seconds left…...
Factoring Grouping (Bust-the-b) Ex. 3x2 + 14x Ex. 6x2 + 7x + 2.
Januar MDMDFSSMDMDFSSS
We will resume in: 25 Minutes.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Intracellular Compartments and Transport
A SMALL TRUTH TO MAKE LIFE 100%
PSSA Preparation.
Immunobiology: The Immune System in Health & Disease Sixth Edition
Immunobiology: The Immune System in Health & Disease Sixth Edition
CpSc 3220 Designing a Database
Towers of Hanoi
Traktor- og motorlære Kapitel 1 1 Kopiering forbudt.
Method main Point p1 = new Point(5, 6); Point p2 = new Point(10, 11); System.out.println(p1.getX()); System.out.println( Point.num );
!'!!. = pt >pt > \ ___,..___,..
Presentation transcript:

1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt WHILE You were out FOR Crying out Loud! IF You insist What is your mal- FUNCTION Nothing to see here. Move Along

2 What is the output?? int x = 0; while(x<=7){ System.out.println(x); x++; }

4 int x = 10; while(x>0){ x-=2; System.out.println(x); } What is the output??

6 int x = 0, y=0; while(x<=100){ y+=x; x+=10; } System.out.println("x="+x); System.out.println("y="+y);

7 x=110 y=550

8 What is the output? int x = 1; while(x<=20){ if(x%2 != 0) System.out.print(x+" "); if(x%5==0) System.out.print("\n"); x++; }

10 Assume that the user has entered a value into a variable named exp. Write code that uses a while-loop to calculate 2 exp. (be sure to declare any other variables that you may use)

11 int exp=5; int count=0, ans=1; while(count<exp){ ans*=2; count++; } System.out.println(ans);

12 What is the output? for(int i=0; i<8; i++) System.out.println(i);

14 What is the output? for(int i=10; i>=0; i-=2){ System.out.println(i); }

16 What is the output? int x=5, ans=0; for(int i=x; i>0; i--){ ans += i*i; } System.out.println(ans);

17 55

18 What is the output? int x=3, y=5, ans=1; for(int i=y; i>0; i--){ ans*=x; } System.out.println(ans);

19 243

20 Assume the user has stored a value in a variable named var. Write a for-loop that calculates the factorial of var. Be sure to declare any other variables.

21 int fact=1; for(int i=1;i<=var;i++) fact*=i; System.out.println(fact);

22 What is the output? int a=92, f=65; int x=70; if(x>=a) System.out.println("You make A"); else if(x>=f) System.out.println("You pass"); else System.out.println("FAILURE");

23 You pass

24 What is the output? int x=2, y=3; int num=5; if(num%x==0) if(num%y==0) System.out.println(x*y+" divides "+num); else System.out.println(x +" divides "+num); else if(num%y==0) System.out.println(y +" divides "+num); else System.out.println("thanks for playing");

25 thanks for playing

26 What is the output? int x=2, y=3; int num=5; if(num>x) if(num<y) System.out.println("between"); else System.out.println("below"); System.out.println("thanks");

27 below thanks

28 What’s the output? int x=2, y=5,z=8; int num=19; if(x<=num) if(num<=y) System.out.println("[x,y]"); else if(num<=z) System.out.println("[y,z]"); else System.out.println("[z,i]"); else System.out.println("[-i,x]");

29 [z, i]

30 What’s the output? int x=3, y=14,z=28; int num=19; if(x<=num) if(num<=y) System.out.println("a"); else if(num<=z) System.out.println("b"); else System.out.println("c"); else System.out.println("d");

31 b

32 What is the output? public static void main(String[] args){ int num1=5, num2; num2 = sq(num1); System.out.println(num1); System.out.println(num2); } public static int sq(int x){ x*=x; return x; }

34 What are values of variables x, y, & z? public static void main(String[] args){ int x=5, y=10, z=15; x=fun(x,y); z=fun(y,x); } public static int fun(int a, int b){ a += b; b--; return(a-10); }

35 x=5 y=10 z=5

36 Values of x, y, & z? public static void main(String[] args){ int x=2, y=4, z=0; fun(x,y); z=fun(y,x); y=fun(z,x); } public static int fun(int n1, int n2){ int a=0; if(n1>n2) a=n1+(n1-n2); else a=n1-(n2-n1); n1*=1000; n2+=n1; return a; }

37 x=2 y=10 z=6

38 Values of x, y, & z? public static void main(String[] args) { int x=2, y=3,z; z=fun(x,y); y=fun(z,2); System.out.println("x="+x); System.out.println("y="+y); System.out.println("z="+z); } public static int fun(int n1, int n2){ int a=1; while(n2>0){ a*=n1; n2--; } return a; }

39 x=2 y=64 z=8

40 Write a function that accepts one parameter and returns the sum of all positive integers less than or equal to its value.

41 public static int sum(int x){ int sum=0; while(x>0){ sum+=x; x--; } return sum; }

42

43

44

45

46

47

48

49

50

51

52 FINAL JEOPARDY!! Write a function that calculates and returns the factorial of a given number.

53 public static int fact(int x){ int ans=1; for(int i=1; i<=x; i++) ans*=i; return ans; }