PROGRAMMING REFRESHER MODULE. Delivered by Ana Cavalcanti and Alvaro Miyazawa Prepared by Dr Lilian Blot

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "PROGRAMMING REFRESHER MODULE. Delivered by Ana Cavalcanti and Alvaro Miyazawa Prepared by Dr Lilian Blot"

Transcription

1 PROGRAMMING REFRESHER MODULE Delivered by Ana Cavalcanti and Alvaro Miyazawa Prepared by Dr Lilian Blot

2 The Rules Everything in PREF (Week 1) is optional. From week 2 of APRC and JAPC, we assume that all that has been taught in week one is mastered. The material will not be covered in any other lecture. From Week 2: The practical sessions are mandatory, you must attend. Lectures are always optional (but strongly recommended).

3 A n a. C a v a l c a n t y o r k. a c. u k Contact A l v a r o. M i y a z a w y o r k. a c. u k

4 Textbook Java How to Program: Early Objects Version (10 th Edition) by Paul and Harvey Deitel. The pages and sections of APRC and JAPC may match just the 9 th Edition. 6 th -8 th Editions Okay. BE AWARE Earlier editions will confuse you! 5th or earlier edition are bad! Collections have changed Integer, Double and others have changed. 3rd or earlier is very bad!! Swing has changed

5 Why Java? One language for one degree programme Cross-platform Good open-source tools Simpler than many rivals (for instance, C++)

6 TODAY S OBJECTIVES Java Basics part 1 Writing our first Java program Types and Variables Control Structure A Selection statement: IF-ELSE IF-ELSE

7 Section 1 First Program In this section we will be writing our first Java program A classic Hello World

8 Class public class HelloWorld { }... At least one class per java file Starts with keywords public class Followed by class name The name of the file must be the name of the class followed by the extension.java. NOTE All names have rules to follow: No punctuation (except underscore) and no spaces Do not start with a number. Java file name must be same as class name. Convention: Each word in class name starts in uppercase.

9 Class public class HelloWorld { public static void main(string[ ] args) {... } } NOTE The main method always has same signature, whereas other methods differ. We will look into that a little bit later this week. Java classes are structured into methods. Each Java application must have one main method..

10 Class public class HelloWorld { public static void main(string[ ] args) { System.out.println("Hello World!"); } } NOTE Statements are always terminated by semicolon. However they may span over several line of codes when they are complex expressions. Statements consist of construct and expression: Construct is the command. Expression is the data to be enacted upon..

11 Section 2 The Eclipse IDE Eclipse Integrated Development Environment (IDE) Coloured text ( syntax highlighting ) Background compilation Syntax errors notified as you type Auto completion Task setting Project Package explorer Many other views

12 Objectives Section 3 Declarations, Variables & Types What is a variable? What is a type? How to declare a variable? What are the different types in Java? Primitives Objects

13 Variable Declaration Format type identifier [= initialvalue]; Note the square brackets denote optional initialisation Examples int num; int num, result; int num=0, result; NOTE All declarations begin with a type (primitive or class). One or more variables can be declared at same time. Any variable can be initialised at declaration. Variable names: No spaces Only punctuation symbol is the underscore e.g first_name Must not be same as a reserved word. Conventions: Should start with a lowercase letter. Each subsequent word begins in uppercase.

14 Constant Declaration If the value stored in a memory location will not change during program run, store the value in a constant. Constants must be declared and initialised at same time. Format final type identifier = initialvalue; Example final double INTEREST_RATE = 0.2; NOTE Constant names follow the same rules as variables, but different conventions: Name is entirely written in uppercase, With an underscore separating different words in the name. These conventions make the code easier to read, and therefore should be followed.

15 Type of data Examples Data Type Data Type Examples Some data types start with an upper case letter and some with a lower case letter. Types starting with a upper case letter are Objects. Types starting with lower case letter are Primitives. Java supports 8 primitive types. Integer types (byte, short, int, long) Floating point types (float, double) A character type (char) A Boolean type (boolean) A single character (letter) a char A word or words Combination of characters and numbers apple or two aces CS 103 String String Nothing (Empty String) String Integers Real number (number with decimal point) True or False 63 or 0 or or true or false int double boolean

16 Type of data Examples Data Type Data Type Examples Java also supports the String type Technically this is a class type (discussed next week). But is (mostly) used as if it were a primitive type. Note: char literal values use single quotes and String literal values use double quotes A single character (letter) a char A word or words Combination of characters and numbers apple or two aces CS 103 String String Nothing (Empty String) String Integers Real number (number with decimal point) 63 or 0 or or int double True or False true or false boolean

17 Type Conversion Type casts can be applied to convert a variable from one type to another type Format: (datatype) variablename Example: double result = 5.2; int rounded = (int) result; Rounded is assigned the int value 5. BE AWARE Any value can be converted to a String, but not all String values can be parsed to a primitive. We can convert String values to primitive type values by means of parse methods Example: int num = Integer.parseInt("9"); Primitive values can be converted to string by tostring() method in wrapper classes. Example: String five = Integer.toString(5); Or by concatenation: String five = "" + 5;

18 Objectives Section 4 Input, Libraries & Packages Build the program Hello <name> Program Specification Ask the user to enter their name, then print the words Hello <name>! to the console.

19 The Code Simple view of the program public class HelloName { public static void main(string[] args) { //create scanner object Scanner sc = new Scanner(System.in); Input //prompt user System.out.print("Please enter your name:\t"); Processing } } //get input and print string System.out.println("Hello " + sc.next() + "!"); Output

20 The Modified Code Tell the compiler where to find the code for a Scanner, and add it to our program. java.util.scanner is a Java library. import java.util.scanner; public class HelloName { public static void main(string[] args) { //create scanner object Scanner sc = new Scanner(System.in); Simple view of the program Input Processing //prompt user System.out.print("Please enter your name:\t"); } } //get input and print string System.out.println("Hello " + sc.next() + "!"); Output

21 Objectives Section 5 Operators & Expressions What are the Java operators? What is an expression? How to declare a variable?

22 Expressions An expression is a combination of values, variables, and operators Operators are special symbols that represent computations like addition and multiplication. The values the operator uses are called operands. Expressions can be combined to create a more complex expression. For example: <expression_1> operator <expression_2> (age * 10) + (heightcm / 100) ( Dr + name) + ( > * 3) NOTE As in Mathematics, when more than one operator appears in an expression, the order of evaluation depends on the rules of precedence. the result of * 2 is 11, not 14. Parentheses have the highest precedence: the result of (3 + 4) * 2 is 14, not 11 use of parentheses is encouraged in long and complex expressions.

23 Operator Name Mathematical Operators P +, - Unary plus and minus (for example, - 10) On the table on the right you can see mathematical operators and their precedence. r e c e *, /, % Multiplication, division, integer division, and remainder The ( + ) operator is also the concatenation of two String operator Dr + + Blot is a valid expression. The result is the String Dr Blot. d e n c e +, - Binary plus and minus (for instance, 3-10) Note the special case for the Assignment Operator ( = ): The left-hand side of the assignment operator has to be a variable, not an expression. = Assignment operators

24 Assignment and Expressions Example Code String firstname = Lilian ; String lastname = Blot ; String title = Dr String name = firstname+ +lastname; name = title + + name; 24

25 Assignment and Expressions Example Name space firstname lastname Memory Lilian Code String firstname = Lilian ; String lastname = Blot ; String title = Dr ; Blot title Dr 25

26 Assignment and Expressions Example Name space firstname lastname Memory Lilian Code String firstname = Lilian ; String lastname = Blot ; String title = Dr ; String name = firstname+ +lastname; Lilian + + Blot name Blot Lilian Blot title Dr 26

27 Assignment and Expressions Example Name space firstname lastname Memory Lilian Code String firstname = Lilian ; String lastname = Blot ; String title = Dr ; String name = firstname+ +lastname; name = title + + name; name Blot Lilian Blot Dr + + Lilian Blot Dr Lilian Blot title Dr 27

28 Main Scanner Class Methods Method nextint() nextdouble() nextboolean() next() hasnextint() hasnextdouble() hasnextboolean() hasnext() Description Reads the next input value as an integer Reads the next input value as a double Reads the next input value as a boolean Reads the next input value as a String Returns true if next input value is an integer Returns true if next input value is a double Returns true if next input value is a boolean Returns true if there is another input value to read

29 Today s Problem We would like to write a program taking a measurement in meters (respectively, Feet, inches) as input and convert it to Feet, inches (respectively, meters). We need to find a way for the user to tell us which conversion he/she wants to do. Depending on the user SELECTION we need to do one operation or the other. We haven t seen such a structure yet. 29

30 Section 6 Control Structure part I Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things. A Control Structure for Branching: Selection statement if - else if - else. 30

31 Motivation Straight line programs: sequence of commands executed one after the other, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 31

32 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 32

33 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 33

34 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 34

35 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 35

36 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 36

37 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 37

38 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 38

39 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 39

40 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 40

41 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 41

42 Motivation Straight line programs: sequence of commands executed one after the other one, and only once. Cannot do many interesting things if any. True Condition False Branching: A program can decide which statements to execute based on a condition. Statement A1 Statement An Statement B1 Statement Bk If condition is True, execute A 1 to A n If condition is False, execute B 1 to B k 42

43 Schema Code if (condition) { Statement A1; } else { } Statement An; Statement B1; Statement Bk; True Statement A1 Statement An Condition False Statement B1 Statement Bk 43

44 Schema Code if (condition) { Statement A1; } else { } Statement An; Statement B1; Statement Bk; True Statement A1 Statement An Condition False Statement B1 Statement Bk 44

45 Schema Code if (condition) { Statement A1; } else { } Statement An; Statement B1; Statement Bk; True Statement A1 Statement An Condition False Statement B1 Statement Bk 45

46 Schema Simple if-statement if (condition) { Statement A1; } Statement An; statement X; statement Y; True Statement A1 Statement An Condition Statement X Statement Y False 46

47 Schema if-else if-else statement if (cond_1) { Statement A; } else if (cond_2) { Statement B; } } else if (cond_n) { Statement C; } else { Statement D; } True cond_1 Statement A Statement B False cond_2 True True Statement C cond_n False False Statement D 47

48 Schema Nested if-else statements if (cond_1) { Statement A; } else { Statement B1; Statement B2; if (cond_2) { Statement C; } else { Statement D; } } True Statement A cond_1 False True Statement C Statement B1 Statement B2 cond_2 False Statement D 48

49 Format: Ternary Operator (condition)? true-code : false-code? Simplified (short hand) alternative to the if-else statement. Must be used as part of a statement. Useful for assigning one of two values depending on some condition. Note The ternary operator makes the code more difficult to read. It should be used only when the conditions are simple, and the statements are very short. Use it sparingly. Example grade = (mark >= 50)? "pass" : "fail"; 49

50 Boolean Expression A boolean expression returns true or false. The returned value is of the Java boolean type (a primitive type), a data type that can take only two values, true or false (case sensitive).

51 Comparing Numbers We can compare numbers using comparators such as: >, <, >=, <=, ==,!=. code boolean boolean a = 10 < 7; // a contains the value false b = 10 >= 7; // a contains the value true NOTE When comparing to a variable, you must ensure the types are compatible. A compiler error will occur if you try to compare a int to a String. Values in variables can be compared too, and the result can be stored in a variable. code int small = 6; int big = 2000; boolean is_greater = (big >= small); // true Beware, confusing the Assignment operator = and the Equality operator == is a common mistake.

52 Examples Assume: int num = 10; Expression Result Explanation (num == 10) true num is equal to 10 (num == A ) error Different data-types (num!= A ) error Different data-types (num!= 11) true num is not equal to 11 (num > 9) true Greater than test num is larger value (num >= 11) false Greater/Equal test num is smaller (num < 11) true Less than test num is smaller (num <= 10) true Less/Equal test num is equal to 10 52

53 Boolean Expression composition Boolean expressions can be combined to form complex expressions. composition can be done using three operators: && (and), (or),! (not) Refer to the truth tables on the right to see the result of composition of two boolean expressions. Truth Tables && True False True True False False False False True False True True True False True False Code sample discount = ((age < 26) (isstudent == true)); resit =!((average >= 40) && (compensable < 40));! True False False True

54 Operator Name Operator Precedence (cont.) In the table on the right you can see the rule of precedence for the boolean operators. P r e c e +, -! *, /, % Unary plus and minus (e.g. -10) not Multiplication, division, integer division, and remainder There are more operators available in Java. You are encouraged to read about them. d e n c e +, - <, <=, >= ==,!= Binary plus and minus (e.g. 3-10) Comparison Equality, inequality && and or =, +=, -=, *=, /=, %= Assignment operators

55 Summary You should now be able to develop very simple programs, taking input from user and producing an output. You should be familiar with the concepts of Values, Variables and Data Types. You should understand Operators and the rules of precedence, and be able to create more complex expressions using them. 55

56 Exercises Give a truth table that shows the (boolean) value of each of the following Boolean expressions, for every possible combination of input values. a)!(p && Q) b) (!P) && Q c) (!P) (!Q) d) (P && Q) R e) (P R) && (Q R) Hint: including columns for intermediate expressions is helpful. 56

57 Exercises Here is some practice on writing complex Boolean expressions. Your task is to convert the English description into a Java Boolean expression. The variables to be used in the expressions are: dogsize with String values "small", "medium", and "large. doghasspots with Boolean values true or false. dogage with positive integer values. dogcolor with String values "white", "black", "red", and "brown. catsize with String values "small", "medium", and "large. cathasspots with Boolean values true or false. catcolor with String values "white", "black", "orange", and "tabby. cateyecolor with String values "green", "brown", "blue. catage with positive integer values. An old dog is one with an age greater than seven years while an old cat has an age greater than or equal to nine years. A cat and a dog are young if they are younger than three years old. 57

58 Exercises For the time being, and for simplicity we consider that we can compare two Strings using:!=, ==, <, >, >=, <=. these ARE NOT the correct Java operators for comparing Strings; we will see the proper comparator during the next lecture. Write a Boolean expression that captures Dogs that are large and have spots or cats that are white but do not have blue eyes. Young cats and dogs of small size and with brown eyes. Old cats and dogs, where cats are white and dogs are not black. 58

Introduction to Java

Introduction to Java Introduction to Java The HelloWorld program Primitive data types Assignment and arithmetic operations User input Conditional statements Looping Arrays CSA0011 Matthew Xuereb 2008 1 Java Overview A high

More information

Chapter 2: Elements of Java

Chapter 2: Elements of Java Chapter 2: Elements of Java Basic components of a Java program Primitive data types Arithmetic expressions Type casting. The String type (introduction) Basic I/O statements Importing packages. 1 Introduction

More information

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java

More information

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:

Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand: Introduction to Programming and Algorithms Module 2 CS 146 Sam Houston State University Dr. Tim McGuire Introduction To Computers And Java Chapter Objectives To understand: the meaning and placement of

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Primitive Data Types Summer 2010 Margaret Reid-Miller

Primitive Data Types Summer 2010 Margaret Reid-Miller Primitive Data Types 15-110 Summer 2010 Margaret Reid-Miller Data Types Data stored in memory is a string of bits (0 or 1). What does 1000010 mean? 66? 'B'? 9.2E-44? How the computer interprets the string

More information

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.

Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved. 1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays

More information

Introduction to Java. CS 3: Computer Programming in Java

Introduction to Java. CS 3: Computer Programming in Java Introduction to Java CS 3: Computer Programming in Java Objectives Begin with primitive data types Create a main class with helper methods Learn how to call built-in class methods and instance methods

More information

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science

First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca

More information

JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4

JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4 JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4 NOTE: SUN ONE Studio is almost identical with NetBeans. NetBeans is open source and can be downloaded from www.netbeans.org. I

More information

Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++

Adjusted/Modified by Nicole Tobias. Chapter 2: Basic Elements of C++ Adjusted/Modified by Nicole Tobias Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types

More information

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)

More information

Chapter 2 Elementary Programming

Chapter 2 Elementary Programming Chapter 2 Elementary Programming 2.1 Introduction You will learn elementary programming using Java primitive data types and related subjects, such as variables, constants, operators, expressions, and input

More information

Install Java Development Kit (JDK) 1.8 http://www.oracle.com/technetwork/java/javase/downloads/index.html

Install Java Development Kit (JDK) 1.8 http://www.oracle.com/technetwork/java/javase/downloads/index.html CS 259: Data Structures with Java Hello World with the IntelliJ IDE Instructor: Joel Castellanos e-mail: joel.unm.edu Web: http://cs.unm.edu/~joel/ Office: Farris Engineering Center 319 8/19/2015 Install

More information

Chapter 2 Introduction to Java programming

Chapter 2 Introduction to Java programming Chapter 2 Introduction to Java programming 1 Keywords boolean if interface class true char else package volatile false byte final switch while throws float private case return native void protected break

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 01 / 21 / 2014 Instructor: Michael Eckmann Today s Topics Introduction Homework assignment Review the syllabus Review the policies on academic dishonesty and improper

More information

CS1020 Data Structures and Algorithms I Lecture Note #1. Introduction to Java

CS1020 Data Structures and Algorithms I Lecture Note #1. Introduction to Java CS1020 Data Structures and Algorithms I Lecture Note #1 Introduction to Java Objectives Java Basic Java features C Java Translate C programs in CS1010 into Java programs 2 References Chapter 1 Section

More information

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals

CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals CSE 1223: Introduction to Computer Programming in Java Chapter 2 Java Fundamentals 1 Recall From Last Time: Java Program import java.util.scanner; public class EggBasket { public static void main(string[]

More information

Moving from CS 61A Scheme to CS 61B Java

Moving from CS 61A Scheme to CS 61B Java Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you

More information

Introduction to Python

Introduction to Python WEEK ONE Introduction to Python Python is such a simple language to learn that we can throw away the manual and start with an example. Traditionally, the first program to write in any programming language

More information

Object-Oriented Programming in Java

Object-Oriented Programming in Java CSCI/CMPE 3326 Object-Oriented Programming in Java Class, object, member field and method, final constant, format specifier, file I/O Dongchul Kim Department of Computer Science University of Texas Rio

More information

C Programming Dr. Hasan Demirel

C Programming Dr. Hasan Demirel C How to Program, H. M. Deitel and P. J. Deitel, Prentice Hall, 5 th edition (3 rd edition or above is also OK). Introduction to C Programming Dr. Hasan Demirel Programming Languages There are three types

More information

6.1. Example: A Tip Calculator 6-1

6.1. Example: A Tip Calculator 6-1 Chapter 6. Transition to Java Not all programming languages are created equal. Each is designed by its creator to achieve a particular purpose, which can range from highly focused languages designed for

More information

java.util.scanner Here are some of the many features of Scanner objects. Some Features of java.util.scanner

java.util.scanner Here are some of the many features of Scanner objects. Some Features of java.util.scanner java.util.scanner java.util.scanner is a class in the Java API used to create a Scanner object, an extremely versatile object that you can use to input alphanumeric characters from several input sources

More information

Chapter 3. Input and output. 3.1 The System class

Chapter 3. Input and output. 3.1 The System class Chapter 3 Input and output The programs we ve looked at so far just display messages, which doesn t involve a lot of real computation. This chapter will show you how to read input from the keyboard, use

More information

Lecture 5: Java Fundamentals III

Lecture 5: Java Fundamentals III Lecture 5: Java Fundamentals III School of Science and Technology The University of New England Trimester 2 2015 Lecture 5: Java Fundamentals III - Operators Reading: Finish reading Chapter 2 of the 2nd

More information

Part I:( Time: 90 minutes, 30 Points)

Part I:( Time: 90 minutes, 30 Points) Qassim University Deanship of Educational Services Preparatory Year Program- Computer Science Unit Final Exam - 1434/1435 CSC111 Time: 2 Hours + 10 Minutes 1 MG Student name: Select the correct choice:

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Exam Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) The JDK command to compile a class in the file Test.java is A) java Test.java B) java

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

Topic 11 Scanner object, conditional execution

Topic 11 Scanner object, conditional execution Topic 11 Scanner object, conditional execution "There are only two kinds of programming languages: those people always [complain] about and those nobody uses." Bjarne Stroustroup, creator of C++ Copyright

More information

Lecture 1 Notes: Introduction

Lecture 1 Notes: Introduction Introduction to C++ January 4, 2011 Massachusetts Institute of Technology 6.096 Lecture 1 Notes: Introduction 1 Compiled Languages and C++ 1.1 Why Use a Language Like C++? At its core, a computer is just

More information

Programming Fundamental. Instructor Name: Lecture-2

Programming Fundamental. Instructor Name: Lecture-2 Programming Fundamental Instructor Name: Lecture-2 Today s Lecture What is Programming? First C++ Program Programming Errors Variables in C++ Primitive Data Types in C++ Operators in C++ Operators Precedence

More information

Scanner. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit.

Scanner. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit. Scanner The Scanner class is intended to be used for input. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit. For example, suppose the input

More information

Java How to Program, 9/e

Java How to Program, 9/e Java How to Program, 9/e Education, Inc. All Rights Reserved. 1 Any computing problem can be solved by executing a series of actions in a specific order. An algorithm is a procedure for solving a problem

More information

Variables, Constants, and Data Types

Variables, Constants, and Data Types Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class: L&L, 2.1-2.3, App C 1 Primitive Data There are eight

More information

Programming and Data Structures with Java and JUnit. Rick Mercer

Programming and Data Structures with Java and JUnit. Rick Mercer Programming and Data Structures with Java and JUnit Rick Mercer ii Chapter Title 1 Program Development 2 Java Fundamentals 3 Objects and JUnit 4 Methods 5 Selection (if- else) 6 Repetition (while and for

More information

JAVA PRIMITIVE DATA TYPE

JAVA PRIMITIVE DATA TYPE JAVA PRIMITIVE DATA TYPE Description Not everything in Java is an object. There is a special group of data types (also known as primitive types) that will be used quite often in programming. For performance

More information

Java Basics: Data Types, Variables, and Loops

Java Basics: Data Types, Variables, and Loops Java Basics: Data Types, Variables, and Loops If debugging is the process of removing software bugs, then programming must be the process of putting them in. - Edsger Dijkstra Plan for the Day Variables

More information

Week 1: Review of Java Programming Basics

Week 1: Review of Java Programming Basics Week 1: Review of Java Programming Basics Sources: Chapter 2 in Supplementary Book (Murach s Java Programming) Appendix A in Textbook (Carrano) Slide 1 Outline Objectives A simple Java Program Data-types

More information

Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory.

Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. JAVA TYPES BASIC DATA TYPES GENERAL Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. Based on the data type

More information

AP Computer Science Static Methods, Strings, User Input

AP Computer Science Static Methods, Strings, User Input AP Computer Science Static Methods, Strings, User Input Static Methods The Math class contains a special type of methods, called static methods. A static method DOES NOT operate on an object. This is because

More information

Some Scanner Class Methods

Some Scanner Class Methods Keyboard Input Scanner, Documentation, Style Java 5.0 has reasonable facilities for handling keyboard input. These facilities are provided by the Scanner class in the java.util package. A package is a

More information

Borland C++ Compiler: Operators

Borland C++ Compiler: Operators Introduction Borland C++ Compiler: Operators An operator is a symbol that specifies which operation to perform in a statement or expression. An operand is one of the inputs of an operator. For example,

More information

Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C

Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C Basic Java Constructs and Data Types Nuts and Bolts Looking into Specific Differences and Enhancements in Java compared to C 1 Contents Hello World Program Statements Explained Java Program Structure in

More information

JAVA.UTIL.SCANNER CLASS

JAVA.UTIL.SCANNER CLASS JAVA.UTIL.SCANNER CLASS http://www.tutorialspoint.com/java/util/java_util_scanner.htm Copyright tutorialspoint.com Introduction The java.util.scanner class is a simple text scanner which can parse primitive

More information

Example of a Java program

Example of a Java program Example of a Java program class SomeNumbers static int square (int x) return x*x; public static void main (String[] args) int n=20; if (args.length > 0) // change default n = Integer.parseInt(args[0]);

More information

Scanner sc = new Scanner(System.in); // scanner for the keyboard. Scanner sc = new Scanner(System.in); // scanner for the keyboard

Scanner sc = new Scanner(System.in); // scanner for the keyboard. Scanner sc = new Scanner(System.in); // scanner for the keyboard INPUT & OUTPUT I/O Example Using keyboard input for characters import java.util.scanner; class Echo{ public static void main (String[] args) { Scanner sc = new Scanner(System.in); // scanner for the keyboard

More information

Pemrograman Dasar. Basic Elements Of Java

Pemrograman Dasar. Basic Elements Of Java Pemrograman Dasar Basic Elements Of Java Compiling and Running a Java Application 2 Portable Java Application 3 Java Platform Platform: hardware or software environment in which a program runs. Oracle

More information

AP Computer Science Java Subset

AP Computer Science Java Subset APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall

More information

Handout 3 cs180 - Programming Fundamentals Spring 15 Page 1 of 6. Handout 3. Strings and String Class. Input/Output with JOptionPane.

Handout 3 cs180 - Programming Fundamentals Spring 15 Page 1 of 6. Handout 3. Strings and String Class. Input/Output with JOptionPane. Handout 3 cs180 - Programming Fundamentals Spring 15 Page 1 of 6 Handout 3 Strings and String Class. Input/Output with JOptionPane. Strings In Java strings are represented with a class type String. Examples:

More information

Third AP Edition. Object-Oriented Programming and Data Structures. Maria Litvin. Gary Litvin. Phillips Academy, Andover, Massachusetts

Third AP Edition. Object-Oriented Programming and Data Structures. Maria Litvin. Gary Litvin. Phillips Academy, Andover, Massachusetts Third AP Edition Object-Oriented Programming and Data Structures Maria Litvin Phillips Academy, Andover, Massachusetts Gary Litvin Skylight Software, Inc. Skylight Publishing Andover, Massachusetts Skylight

More information

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui

More information

Scripting with TCL, Part 1

Scripting with TCL, Part 1 Scripting with TCL, Part 1 Axel Kohlmeyer Center for Molecular Modeling University of Pennsylvania SBS 2007 @ JNCASR, Bangalore The VMD Execution Model GUI (FLTK) Internal State Visualization Python Interpreter

More information

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share.

We will learn the Python programming language. Why? Because it is easy to learn and many people write programs in Python so we can share. LING115 Lecture Note Session #4 Python (1) 1. Introduction As we have seen in previous sessions, we can use Linux shell commands to do simple text processing. We now know, for example, how to count words.

More information

VB.NET Programming Fundamentals

VB.NET Programming Fundamentals Chapter 3 Objectives Programming Fundamentals In this chapter, you will: Learn about the programming language Write a module definition Use variables and data types Compute with Write decision-making statements

More information

Programming Languages CIS 443

Programming Languages CIS 443 Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems sjmaybank@dcs.bbk.ac.uk Spring 2015 Week 2b: Review of Week 1, Variables 16 January 2015 Birkbeck

More information

Java Crash Course Part I

Java Crash Course Part I Java Crash Course Part I School of Business and Economics Institute of Information Systems HU-Berlin WS 2005 Sebastian Kolbe skolbe@wiwi.hu-berlin.de Overview (Short) introduction to the environment Linux

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Sample CSE8A midterm Multiple Choice (circle one)

Sample CSE8A midterm Multiple Choice (circle one) Sample midterm Multiple Choice (circle one) (2 pts) Evaluate the following Boolean expressions and indicate whether short-circuiting happened during evaluation: Assume variables with the following names

More information

JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved.

JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved. 1 6 JavaScript: Introduction to Scripting 2 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask,

More information

2. Compressing data to reduce the amount of transmitted data (e.g., to save money).

2. Compressing data to reduce the amount of transmitted data (e.g., to save money). Presentation Layer The presentation layer is concerned with preserving the meaning of information sent across a network. The presentation layer may represent (encode) the data in various ways (e.g., data

More information

1001ICT Introduction To Programming Lecture Notes

1001ICT Introduction To Programming Lecture Notes 1001ICT Introduction To Programming Lecture Notes School of Information and Communication Technology Griffith University Semester 2, 2015 1 3 A First MaSH Program In this section we will describe a very

More information

Course: Introduction to Java Using Eclipse Training

Course: Introduction to Java Using Eclipse Training Course: Introduction to Java Using Eclipse Training Course Length: Duration: 5 days Course Code: WA1278 DESCRIPTION: This course introduces the Java programming language and how to develop Java applications

More information

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.

JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system. http://www.tutorialspoint.com/java/java_quick_guide.htm JAVA - QUICK GUIDE Copyright tutorialspoint.com What is Java? Java is: Object Oriented Platform independent: Simple Secure Architectural- neutral

More information

13 File Output and Input

13 File Output and Input SCIENTIFIC PROGRAMMING -1 13 File Output and Input 13.1 Introduction To make programs really useful we have to be able to input and output data in large machinereadable amounts, in particular we have to

More information

1) Which of the following is a constant, according to Java naming conventions? a. PI b. Test c. x d. radius

1) Which of the following is a constant, according to Java naming conventions? a. PI b. Test c. x d. radius Programming Concepts Practice Test 1 1) Which of the following is a constant, according to Java naming conventions? a. PI b. Test c. x d. radius 2) Consider the following statement: System.out.println("1

More information

PL / SQL Basics. Chapter 3

PL / SQL Basics. Chapter 3 PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic

More information

CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O

CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O CSE 1223: Introduction to Computer Programming in Java Chapter 7 File I/O 1 Sending Output to a (Text) File import java.util.scanner; import java.io.*; public class TextFileOutputDemo1 public static void

More information

Programming in Java. 2013 Course Technology, a part of Cengage Learning.

Programming in Java. 2013 Course Technology, a part of Cengage Learning. C7934_chapter_java.qxd 12/20/11 12:31 PM Page 1 Programming in Java Online module to accompany Invitation to Computer Science, 6th Edition ISBN-10: 1133190820; ISBN-13: 9781133190820 (Cengage Learning,

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

Activity 1: Bits and Bytes

Activity 1: Bits and Bytes ICS3U (Java): Introduction to Computer Science, Grade 11, University Preparation Activity 1: Bits and Bytes The Binary Number System Computers use electrical circuits that include many transistors and

More information

Using Files as Input/Output in Java 5.0 Applications

Using Files as Input/Output in Java 5.0 Applications Using Files as Input/Output in Java 5.0 Applications The goal of this module is to present enough information about files to allow you to write applications in Java that fetch their input from a file instead

More information

Basics of Java Programming Input and the Scanner class

Basics of Java Programming Input and the Scanner class Basics of Java Programming Input and the Scanner class CSC 1051 Algorithms and Data Structures I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/

More information

Computer Programming I

Computer Programming I Computer Programming I COP 2210 Syllabus Spring Semester 2012 Instructor: Greg Shaw Office: ECS 313 (Engineering and Computer Science Bldg) Office Hours: Tuesday: 2:50 4:50, 7:45 8:30 Thursday: 2:50 4:50,

More information

Introduction to Object-Oriented Programming

Introduction to Object-Oriented Programming Introduction to Object-Oriented Programming Programs and Methods Christopher Simpkins chris.simpkins@gatech.edu CS 1331 (Georgia Tech) Programs and Methods 1 / 8 The Anatomy of a Java Program It is customary

More information

Chulalongkorn University International School of Engineering Department of Computer Engineering 2140105 Computer Programming Lab.

Chulalongkorn University International School of Engineering Department of Computer Engineering 2140105 Computer Programming Lab. Chulalongkorn University Name International School of Engineering Student ID Department of Computer Engineering Station No. 2140105 Computer Programming Lab. Date Lab 2 Using Java API documents, command

More information

WA2099 Introduction to Java using RAD 8.0 EVALUATION ONLY. Student Labs. Web Age Solutions Inc.

WA2099 Introduction to Java using RAD 8.0 EVALUATION ONLY. Student Labs. Web Age Solutions Inc. WA2099 Introduction to Java using RAD 8.0 Student Labs Web Age Solutions Inc. 1 Table of Contents Lab 1 - The HelloWorld Class...3 Lab 2 - Refining The HelloWorld Class...20 Lab 3 - The Arithmetic Class...25

More information

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following: In creating objects of the type, we have used statements similar to the following: f = new (); The parentheses in the expression () makes it look like a method, yet we never created such a method in our

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

2/1/2010. Background Why Python? Getting Our Feet Wet Comparing Python to Java Resources (Including a free textbook!) Hathaway Brown School

2/1/2010. Background Why Python? Getting Our Feet Wet Comparing Python to Java Resources (Including a free textbook!) Hathaway Brown School Practical Computer Science with Preview Background Why? Getting Our Feet Wet Comparing to Resources (Including a free textbook!) James M. Allen Hathaway Brown School jamesallen@hb.edu Background Hathaway

More information

COMPUTER SKILLS LESSON 3

COMPUTER SKILLS LESSON 3 COMPUTER SKILLS LESSON 3 Prof. Valeria Cardellini cardellini@ing.uniroma2.it Prof. Emiliano Casalicchio casalicchio@ing.uniroma2.it Computer Skills - Lesson 3 - V. Cardellini 2 The professors Valeria Cardellini,

More information

Python Lists and Loops

Python Lists and Loops WEEK THREE Python Lists and Loops You ve made it to Week 3, well done! Most programs need to keep track of a list (or collection) of things (e.g. names) at one time or another, and this week we ll show

More information

Introduction to Python

Introduction to Python Caltech/LEAD Summer 2012 Computer Science Lecture 2: July 10, 2012 Introduction to Python The Python shell Outline Python as a calculator Arithmetic expressions Operator precedence Variables and assignment

More information

PHP. Intro, Syntax, Variables, Echo, Data Types

PHP. Intro, Syntax, Variables, Echo, Data Types PHP Intro, Syntax, Variables, Echo, Data Types Introduction PHP scripts are executed on the server. What You Should Already Know Before you continue you should have a basic understanding of the following:

More information

1 Introduction. 2 An Interpreter. 2.1 Handling Source Code

1 Introduction. 2 An Interpreter. 2.1 Handling Source Code 1 Introduction The purpose of this assignment is to write an interpreter for a small subset of the Lisp programming language. The interpreter should be able to perform simple arithmetic and comparisons

More information

Programmierpraktikum

Programmierpraktikum Programmierpraktikum Claudius Gros, SS2012 Institut für theoretische Physik Goethe-University Frankfurt a.m. 1 of 21 10/16/2012 09:29 AM Java - A First Glance 2 of 21 10/16/2012 09:29 AM programming languages

More information

Java Cheatsheet. http://introcs.cs.princeton.edu/java/11cheatsheet/ Tim Coppieters Laure Philips Elisa Gonzalez Boix

Java Cheatsheet. http://introcs.cs.princeton.edu/java/11cheatsheet/ Tim Coppieters Laure Philips Elisa Gonzalez Boix Java Cheatsheet http://introcs.cs.princeton.edu/java/11cheatsheet/ Tim Coppieters Laure Philips Elisa Gonzalez Boix Hello World bestand genaamd HelloWorld.java naam klasse main methode public class HelloWorld

More information

Simple C++ Programs. Engineering Problem Solving with C++, Etter/Ingber. Dev-C++ Dev-C++ Windows Friendly Exit. The C++ Programming Language

Simple C++ Programs. Engineering Problem Solving with C++, Etter/Ingber. Dev-C++ Dev-C++ Windows Friendly Exit. The C++ Programming Language Simple C++ Programs Engineering Problem Solving with C++, Etter/Ingber Chapter 2 Simple C++ Programs Program Structure Constants and Variables C++ Operators Standard Input and Output Basic Functions from

More information

A Simple Introduction to Game Programming With C# and XNA 3.1

A Simple Introduction to Game Programming With C# and XNA 3.1 A Simple Introduction to Game Programming With C# and XNA 3.1 No Previous Programming Experience Required Curtis Bennett xnagamemaking.com A Simple Introduction to Game Programming With C# and XNA 3.1

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 4 Lecture 4-1: Scanner; if/else reading: 3.3 3.4, 4.1 Interactive Programs with Scanner reading: 3.3-3.4 1 Interactive programs We have written programs that print console

More information

Chapter 2. println Versus print. Formatting Output withprintf. System.out.println for console output. console output. Console Input and Output

Chapter 2. println Versus print. Formatting Output withprintf. System.out.println for console output. console output. Console Input and Output Chapter 2 Console Input and Output System.out.println for console output System.out is an object that is part of the Java language println is a method invoked dby the System.out object that can be used

More information

Chapter 4 Operators & Arithmetic

Chapter 4 Operators & Arithmetic Chapter 4 Operators & Arithmetic 4-1 Arithmetic in C++ Arithmetic expressions can be made up of constants, variables, operators and parentheses. The arithmetic operators in C++ are as follows + (addition)

More information

The design recipe. Programs as communication. Some goals for software design. Readings: HtDP, sections 1-5

The design recipe. Programs as communication. Some goals for software design. Readings: HtDP, sections 1-5 The design recipe Readings: HtDP, sections 1-5 (ordering of topics is different in lectures, different examples will be used) Survival and Style Guides CS 135 Winter 2016 02: The design recipe 1 Programs

More information

Visit us at www.apluscompsci.com

Visit us at www.apluscompsci.com Visit us at www.apluscompsci.com Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content! www.facebook.com/apluscomputerscience Scanner kb = new Scanner(System.in);

More information

COSC 1020 3.0 Introduction to Computer Science I Section A, Summer 2005. Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

COSC 1020 3.0 Introduction to Computer Science I Section A, Summer 2005. Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19 Term Test #2 COSC 1020 3.0 Introduction to Computer Science I Section A, Summer 2005 Family Name: Given Name(s): Student Number: Question Out of Mark A Total 16 B-1 7 B-2 4 B-3 4 B-4 4 B Total 19 C-1 4

More information

An Introduction to the Java Programming Language History of Java

An Introduction to the Java Programming Language History of Java An Introduction to the Java Programming Language History of Java In 1991, a group of Sun Microsystems engineers led by James Gosling decided to develop a language for consumer devices (cable boxes, etc.).

More information

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void 1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

More information