1. 3.0 + 4.0 A: 7.0 2 3.0 + 4 A: double 3 3 + “4” A: “34” 4.

Slides:



Advertisements
Similar presentations
The Important Thing About By. The Important Thing About ******** The important thing about ***** is *****. It is true s/he can *****, *****, and *****.
Advertisements

AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
For(int i = 1; i
Methods. Read two numbers, price and paid (via JOptiondialog) Calculate change; s = JOptionPane.showInputDialog("Enter price”); Double price = Double.parseDouble(s);
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Ch. 3 Variables VB.Net Programming. Data Types Boolean – True or False values Short – Small integers (+/- 32,767) Integer – Medium-size integers (+/-
What is output line of the following C++ code? Please trace int i = 1, QP; DATA: 4, B, 3, A double credit, totCredit=0.0; double num = 0.0; string LG;
Discussion1 Quiz. Q1 Which of the following are invalid Java identifiers (variable names)? a) if b) n4m3 c) Java d) e) DEFAULT_VALUE f) bad-choice.
CS-1010 Dr. Mark L. Hornick 1 Selection Statements and conditional expressions.
1 Powers of Two: Trace Ex. Print powers of 2 that are  2 N. Increment i from 0 to N. Double v each time. int i = 0; int v = 1; while (i
Primitives in Java Java has eight primitive types –boolean –integral types: signed: long, int, short, byte unsigned: char –floating point types: double,
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
Section 4.2: Functions that Test Conditions (continued)
BOOLEAN LOGIC CSC 171 FALL 2004 LECTURE 7. ASSIGNMENT Review Quiz # 2 Start reading Chapter 5.
Lecture 2: Topics Bits and Bytes Primitive Types Casting Strings Boolean expressions.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
Number systems Jaana Holvikivi Metropolia. Result AND OR NOT Logical operations Boolean algebra Operations &&AND.
Windows Programming, C.-S. Shieh, KUAS EC, Chapter 3 Operators and Expressions.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
CS177 Week2: Recitation Primitive data types and Strings with code examples.
Datatypes, Variables, Constants Flash Class. What Does ActionScript Do? Automates Examples: – Tells animation what to do button is clicked – Turn off.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Variables in Java x = 3;. What is a variable?  A variable is a placeholder in memory used by programmers to store information for a certain amount of.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Week 3 - Friday.  What did we talk about last time?  Operations on boolean values  !, &&, ||  Operations on char values  +, -  Operations on String.
ITEC 109 Lecture 7 Operations. Review Variables / Methods Functions Assignments –Purpose? –What provides the data? –What stores the data? –What type of.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Print Me Who’s Data? First Executed Name Me My Mistake Q $100 Q $200 Q $300 Q $400 Q $500 Q $100 Q $200 Q $300 Q $400 Q $500 Final Jeopardy.
The Basics Input / Output, and Primitive Data Types.
1.2 Primitive Data Types and Variables
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Chapter One Lesson Three DATA TYPES ©
More than just a song and dance.. They are objects that store primitive variable values: Integer – stores an int Double – stores a double Character –
Programming With Java ICS201 University Of Ha’il1 Chapter 11 Recursion.
 Variables can store data of different types, and different data types can do different things.  PHP supports the following data types:  String  Integer.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 06 – Java Datatypes Webpage:
DATA TYPES, VARIABLES AND CONSTANTS. LEARNING OBJECTIVES  Be able to identify and explain the difference between data and information  Be able to identify,
TestScore < 80 testScore * 2 >= < w / (h * h) x + y != 2 * (a + b) 2 * Math.PI * radius
CS 139 – Programming Fundamentals Lecture 08A. Relational/comparison Operators Relational Operator Meaning > is greater than < is less than >= is greater.
Lesson 4: Introduction to Control Statements 4.1 Additional Operators Extended Assignment Operators –The assignment operator can be combined with the.
Online Python Tutor Embeddable Program Visualizations for CS Education Philip Guo Assistant Professor of Computer Science University of Rochester
Input, Output and Variables GCSE Computer Science – Python.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Relational Operator and Operations
Chapter 4 Repetition Statements (loops)
Agenda Warmup Finish 2.4 Assignments
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Review Operation Bingo
نوع داده هاي انتزاعي Abstract Data Types
Computers & Programming Languages
Who Wants To Be A Millionaire?
Name Not Precise Enough
Introduction to Primitive Data types
Unit 6 - Variables - Fundamental Data Types
Feedback Pace Different ideas for delivery Debugging strategies
Data Types Imran Rashid CTO at ManiWeber Technologies.
Example. Sort {5, 1, 12, -5, 16, 2, 12, 14} using selection sort. Complexity analysis.
Decimals: Multiplying by 2.5
Nate Brunelle Today: Conditional Decision Statements
Variables Here we go.
C# Revision Cards Data types
Java: Variables, Input and Arrays
public class Dillo {     public int length;     public boolean isDead;         
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
Data Types and Maths Programming Guides.
GCSE Computing:: Selection (IF statements)
Boolean in C++ CSCE 121.
Introduction to Primitive Data types
Primitive Data Types and Operators
Exercise (6).
Presentation transcript:

1

A: 7.0 2

A: double 3

3 + “4” A: “34” 4

10 / 3 A: 3 5

5 % 7 A: 5 6

7 % 5 A: 2 7

7 / 5 A: 1 8

1.0 – 5 A: double 9

1.0 – 5 A: -4 10

“CS” A: String 11

“CS” A: “CS139” 12

5 / 7 A: int 13

5 / 7 A: 0 14

294 % 7 / 50.0 A:

294 % 7 / 50.0 A: double 16

Math.PI A: 3.14 (to two decimal places) 17

Math.PI A: double 18

17 / 25 *

% 25 20

7 / 3 * 6.0 / 2 21

true && false 22

false || true 23

false || true 24

‘a’ < ‘b’ A: true 25

x != x 26

5 == ‘5’ 27

‘a’ ‘Y’ 28

x == 3 && x == 5 29

x != 3 || x != 5 30

“Pinto”.equals(“Mustang”) A: boolean 31

3 + ( 6 + “4”) A: String 32

3 + ( 6 + “4”) A: “364” 33

“String 1”.compareTo(“Me”) A: int 34

10 / 3.0 A: 3.33 (two decimals) 35

10.0 / (two decimals) 36

“4” A: “94” 37

2.0 * (17 / 25) A: double 38

2.0 * (17 / 25) A:

17 % 25 A: 17 40

3 * A:

3 * A: double 42

“” A: “8.0” 43

“” A: String 44

3 * 7.0 / 1 <= 17 A: boolean 45

49 % A: 7 46

(int) ( ) % 3 A: int 47

(int) ( ) % 3 A: 1 48

(double) 12 / 4 A:

(double) 12 / 4 A: double 50

5 – 1.0 A: