Review Game 1. Teams: B Dylan, Sarah, Angie, Chris S, Isaac Harrison, Nikki, Peter, Katie, Eddie Jen, Stephanie, Chris G, Trey, Megan Joanna, John, Lexi,

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 2 Simple C Programs.
Advertisements

IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
1 MATH METHODS THAT RETURN VALUES. 2 JAVA'S MATH CLASS.
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
Computer Programming w/ Eng. Applications
CS110 Programming Language I
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
 Variables  What are they?  Declaring and initializing variables  Common uses for variables  Variables you get “for free” in Processing ▪ Aka: Built-in.
Intro Programming By Trevor Decker Team 1743 By Trevor Decker Team 1743.
Review Game 1. Teams: A Scott, Michael O, Myles, Ryan Haris, William, Matt C, Jack Jessica, Patrick, Lexa, Kyle Josh, Nico, Betsey, Brian Tanner, Evan,
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
Introduction to Python
Lesson Three: Organization
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
Programming in C++ Lecture Notes 6 Void Functions (Procedures) Andreas Savva.
© Mark E. Damon - All Rights Reserved Another Presentation © All rights Reserved.
CSC 335 Review Game Exam 2. Teams Andrew, Marshall, Riley, Z Emily, Paul, Dawn, Lisa Gavan, Catharine, David, Alex D Michelle, Matt, Rohan, Jamie Ben,
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Java the UML Way version Only to be used in connection with the book "Java the UML Way", by Else Lervik and.
CSE 201 – Elementary Computer Programming 1 Extra Exercises Source: Suggested but not selected midterm questions.
Primitive Variables.
Starting Out with C++: From Control Structures through Objects 7 th edition By Tony Gaddis Source Code Chapter 2.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Do Now Use the information in the table to determine whether the rule works for the given input-output pair. Write “Yes” if the rule works for the input-output.
11 Working with Images Session Session Overview  Find out more about image manipulation and scaling when drawing using XNA  Start to implement.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
COM S 207 Method Instructor: Ying Cai Department of Computer Science Iowa State University
Chapter 2 Variables.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
How to design and code functions Chapter 4 (ctd).
Input a number #include using namespace std; int main() { int num; cout num; return 0; }
Java methods Methods break down large problems into smaller ones Your program may call the same method many times saves writing and maintaining same code.
Calling Methods. Review  We can declare and create objects: Dinosaur dino; dino = new Dinosaur();  We can also shortcut the first two lines: Dinosaur.
Java Basics Variables, Expressions, Statements, etc. CS 21a: Introduction to Computing I Department of Information Systems and Computer Science Ateneo.
Variables and Constants Objectives F To understand Identifiers, Variables, and Constants.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
CSCI 1226 FALL 2015 MIDTERM #1 REVIEWS.  Types of computers:  Personal computers  Embedded systems  Servers  Hardware:  I/O devices: mice, keyboards,
Java – Variables and Constants By: Dan Lunney. Declaring Variables All variables must be declared before they can be used A declaration takes the form:
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Review for Exam 2. Teams – Section B Chris G, Nikki, Jen, Angie, Spencer Katie, Isaac, Kevin, Lexi, Anders Stephanie, Ryan, Eddie, Matt, Browning Tyler.
Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.
With Mr. Tyler $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500.
JAVA Practical Unary operators 2. Using Reals 3. Conversions 4. Type Casting 5. Scope 6. Constants.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Variables, Types, Operations on Numbers CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Topics for today: 1.Comments 2.Data types 3.Variable declaration.
CS 240 Computer Programming 1
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
C++ ReviewEECE 3521 EECS 352 Data Structures and Algorithms José M. Vidal Office: 3A47.
Chapter 3 Using Variables, Constants, Formatting Mrs. UlshaferSept
C++ Lesson 1.
Topic 2 Elementary Programming
Variables Mr. Crone.
Elementary Programming
BASIC ELEMENTS OF A COMPUTER PROGRAM
Chapter 2 Elementary Programming
Chapter 2.
Static Variables ICS 111: Introduction to Computer Science I
Computers & Programming Languages
Chapter 2 Variables.
Building Java Programs
Arrays.
Java for Beginners University Greenwich Computing At School DASCO
Primitive Types and Expressions
Chapter 4, Variables Brief Notes
Unit 3: Variables in Java
Java: Variables, Input and Arrays
Building Java Programs
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Review Game 1

Teams: B Dylan, Sarah, Angie, Chris S, Isaac Harrison, Nikki, Peter, Katie, Eddie Jen, Stephanie, Chris G, Trey, Megan Joanna, John, Lexi, Spencer, Matt Kevin, Browning, Draper, Tyler W Ryan, Julian, Anders, Lara, Tyler Y

Teams: C Jon H, Katy, Matt, Claire, Scott Olivia, William, Christy, Nick, Ellie Billy, Jade, Christina, Chris, Michael Tommy, Stephanie, John V, Tim, Charles Tatum, Collin, Evan, Drew, Pete Nicole, Tyler, Steven, Wes, Aaron

1. Describe what gets drawn: fill(0,255,0); stroke(255,0,0); ellipseMode(CORNER); ellipse(0,0,100,100);

2. What is printed? char a = ‘b’; char b = ‘a’; System.out.print(a);

3. What is the value of number? double number = (1/3)*3;

4. What is the value of number? int number = 3+2/5;

5. What is the value of number? int number = (int) 5.7;

6. What word denotes the answer to a method?

7. What line of Java declares and creates an object in the Student class with your name?

8. Suppose I want to write a method to tell whether or not a number is positive. What would the input and output types be?

9. Suppose I want to write a method that takes a letter and whether or not it should be upper case and computes the new letter. What should the input and output types be?

10. What is special about a variable declared with the word “final”?

11. What does this line of code do? Tiger tony;

12. What math allows us to tell the last digit of an integer?

13. What is the difference between the setup() and the draw() methods?

14. What is the value of b? int x = 2; int y = 4; boolean b = (x<3) && (y<3);

15. What is the value of b? int x = 2; int y = 4; boolean b = (x<3) || (y<3);

16. What is the value of b? int x = 2; int y = 4; boolean b = !(y<3);

17. Which Java keyword means that a method has no output?

18. What is the value of x? int x = 17 % 6;

19. What is the value of x? int x = 6 % 17;

20. What is the value of x at the end of the code? int x = 3; int y = 5; x = y; y = y+1;

21. Suppose the Tiger class has this behavior: public int countTeeth() What line of code calls the countTeeth behavior on the Tiger tony?

22. Suppose the Tiger class has this behavior: public void grabMice(int mice) What line calls the grabMice behavior on the Tiger tony for 3 mice?

23. What is the error? public int mystery(double a, double b){ if (a<b){ return a; } return b; }

24. What does this method do? public int mystery(int a){ int answer = a%100; return answer; }

25. What is the error? public int mystery(int a, int b){ if(a<b){ return a; } else if (a>=b){ return b; }

26. What is x? int a = 3; int b = 5; int x; if (a<b){ x = 0; } else if (b<10){ x = 1; } else{ x = 2; }

27. What is x? int a = 3; int b = 5; int x; if (a<b){ x = 0; } if (b<10){ x = 1; } else{ x = 2; }

28. Find and fix the error: arc(100,100,100,100, PI, 0);

29. What math tells you if a number is even?

30. What is the difference? System.out.println(str); System.out.println(“str”);

Round 2 Team

Write a method The above formula calculates a person’s BMI given their height in centimeters and weight in kilograms. Write a method to calculate a person’s BMI given their height and weight, but the weight is given in grams. (1 kilogram = 1000 grams). public double bmi(double wt, double ht){

Write a method You need to write a program to help out your weekend business doing lawn care. You really need to buy $15 bags of grass seed, but if any money is left over, you also need some $2 bags of mulch. Write a method that takes as input how much money you have and prints how many bags of grass seed and mulch I can buy. For example, if I have 52 dollars, I can buy 3 bags of seed (that’s $45) and 3 bags of mulch ($6 more). public void purchaseOrder(int dollars)

Write a method The method takes as parameters the rate (amount per hour) the employee makes and the number of hours worked. Employees make the pay rate for the first 40 hours they work, and overtime pay for any hours worked after that. Overtime pay is 1.5 times regular pay rate. For example, getPayAmount(10, 30) should return 300, and getPayAmount(10, 45) should return 475. public double getPayAmount(double rate, double hours){