Pace University. Fundamental Concepts of CS121 1

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Pace University. Fundamental Concepts of CS121 1"

Transcription

1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction to Java Programming. It serves as a review outline. All questions in quizzes and exams will be based on concepts listed in this document. Most of the skills that you need for writing Java programs are also listed in this document. Make sure that you can answer all the questions or understand the listed concepts for each section that we have covered. Copyright Dr. Lixin Tao, Pace University, This document should not be copied partially or in full, or published in any form, without the permission of the author.

2 1 Computer Systems and Programming Languages 1.1 Problem vs. problem instances 1. What are the differences between a problem and a problem instance for the problem? 2. Is a computer program supposed to solve a problem or a problem instance? 3. What is the function of a computer program in problem-solving? 4. What do we mean when we say that a program is correct? 5. What do we mean when we say that a program is robust? 1.2 Structure of a personal computer 1. What is a machine language program? 2. What are the relationship among computer hardware, software, and data? 3. What are the functions of CPU, main memory, hard disk, keyboard, and display? 4. Can data in CPU and main memory survive power failure? 5. Can data in hard disk survive power failure? 6. How many devices can send data through the system bus simultaneously? 7. How many devices can receive data through the system bus simultaneously? 8. Why we need the main memory, instead of letting CPU run programs on the hard disk directly? 1.3 CPU 1. Which computer device defines and implements the machine language of a computer architecture? 2. What is the function of the program counter? 3. What is the function of general-purpose registers in a CPU? 4. Which are the major phases for the CPU to execute a machine instruction? 5. How are activities of a CPU synchronized? 1.4 Memory 1. For a computer, what is a bit, a byte, or a word? 2. How is the main memory organized? 3. What is memory address? 4. What is the smallest memory address? 5. What is memory value corresponding to a memory address? 6. When a value is written into a memory cell, what happens to the original value in that cell? 7. When a value is read out of a memory cell, is the current value in the memory cell modified? 8. The main memory is used to store programs or data? 9. Even though memory hardware can only store binary bits, how can a memory store different types of data like integers, floating-point numbers, strings, and programs? 1

3 1.5 Disk file system 1. What is the basic unit for storing programs or data on a hard disk? 2. What components a file name may contain? 3. What is the function of a file name extension? 4. What is a file system directory? 5. Can a directory contain another directory? 6. Should we use short and encrypt file names, or concise file names that convey the purpose of the files? 7. What is a file system directory tree? 8. What is the working directory for a Command Prompt window? 9. What is the absolute path of a file? 10. What is the relative path of a file? 11. Which directory does period (.) represent? 12. Which directory do double periods (..) represent? 1.6 Display 1. What is the main function of a computer display? 2. What is a pixel? 3. What is the resolution of a display? 4. What are the text mode and graphics mode of a display? 5. In the text mode of a display, what is the function of a display cursor? 6. Which key strike will cause the display cursor to terminate the current line and move to the beginning of the following line? 7. In the graphics mode of a display, what kind of coordinate system is used to define the position of a pixel? 1.7 Keyboard 1. What is the function of a keyboard? 2. What is an active window? 3. Which keys can generate white space characters? 1.8 Computer Software 1. What is computer software? 2. What are the two major types of software? Give examples. 3. Can you list the names of three high-level programming languages? 1.9 Java programming language 1. What is a Java keyword or reserved word? 2. Why we need high-level programming languages? 3. What is source code? 4. What is executable code? 5. What is a bytecode file? 6. What is a class file? 7. What is an interpreted programming language? 2

4 8. What is a compiled programming language? 9. How is Java program source code translated into machine instructions to be executed by a CPU? 10. What is Java virtual machine? 11. What is the name of the command for compiling Java source files into bytecode files? 12. What is the name of the command for executing the Java bytecode files? 13. Is a Java bytecode file hardware or operating system dependent? 14. Java was launched by which company and in which year? 15. What is the syntax structure of an identifier? 16. What is good practice for identifiers so Java program maintenance can be easier? 17. What are Java reserved words or keywords? 18. Does a Java class s name capitalize its first letter? 19. Does a Java method s name capitalize its first letter? 20. Does a Java variable s name capitalize its first letter? 2 Software Installation 1. What is J2SE (Java 2 Standard Edition) for? 2. What is J2SE SDK (Software Development Kit), also called JDK, for? 3. What is J2SE JRE (Java Runtime Environment) for? 4. What is the current version of J2SE? 5. What is the base URL for downloading Sun J2SE SDK? 6. Does the installation of J2SE SDK also install J2SE JRE as part of it? 7. Where are commands javac.exe and java.exe located in a J2SE SDK installation? 8. What is the composition and function of environment variable PATH? 9. What is the composition and function of environment variable CLASSPATH? 10. How to temporarily change the value of CLASSPATH in a Command Prompt window? 11. If we don t set any value for CLASSPATH, what is CLASSPATH s default value? 12. How to start a Command Prompt window? 13. Inside a Command Prompt window, how to change the working directory, how to compile and run a Java program? 3 Java Basics 3.1 Basic Hello World program 1. How to write the basic Hello World program (as simple as possible, but it can compile and run)? 2. Are public, class, static, and void Java s reserved words? 3. Are Java programs case-sensitive? 4. What file name should be used for holding the declaration of a public class named Welcome? 5. Can a Java source code file contain more than one public class? 6. To print a message to the display and then move the display cursor to the beginning of the following line, use System.out.println("MessageToBeDisplayed"); 7. Each statement must terminate with semicolon (;). 3

5 8. A Java program contains one or more classes, and a class contains one or more methods. 9. The body of a class or a method is enclosed in a pair of curly braces. 10. Java character string constants (literals) are enclosed in straight double quotes, as "Hello world". 11. When a Java program is run, its method main() is the first method to be called and executed. Method main() must read as public static void main(string[] args) { }. 3.2 Code style and command-line arguments 1. On any source code line, // signifies the beginning of a Java comment, and the comment ends at the end of the line. A comment will be replaced by the compiler with a white space character. 2. It is important to add proper comments inside a source file so people can understand the program s logic. Comment is an important form of software documentation. 3. Space, Tab, and Enter keys generate white space characters, and in a Java source code file, a single white space is equivalent to any number of white space characters. 4. How source code should be indented for supporting a good source code style? 5. What are the two main styles of writing Java source code as to the position of the opening curly braces? 6. Should we use a mixture of the two source code styles in the same project? 7. What are command-line arguments of a Java program? 8. How to access the command-line arguments inside method main()? 9. How to print a message and then leave the display cursor to the right of the last character printed? 10. How can operator + concatenate a few strings into a single one? 3.3 Java package 1. What are Java packages for? 2. Can a Java package contain another package? 3. How to declare that a class belongs to a particular package? 4. Where must the package declaration be in a source code file? 5. Does a package declaration need a semicolon to terminate it? 6. How is Java package implemented in a file system? 7. If a class belongs to package cs121, in which directory that the bytecode file for the class must be kept? 8. What is the most convenient way to compile a Java class into a specified class base directory and generate the necessary directories for the corresponding packages on the package path for the class automatically? 9. How to run a class that belongs to a package? 3.4 Best practice for organizing multiple class projects 1. What is the best practice for organizing multiple class projects? 2. Where should we save the source files for classes belonging to some Java packages? 3. What is the advantage of separating Java source code from the bytecode files? 4. How should we set up CLASSPATH value so that we can run the projects from any working directory? 4

6 5. In which working directory should we compile a project? 6. Do we need to compile explicitly each Java class source code file in a multiple-class project? 7. How can we compile a project so that the bytecode files are stored in the same directories as their corresponding Java source files? 8. Can the class-level variables of a class be accessed by all methods of the class? 9. If a class-level variable has no value initialization during declaration, what will be its default value? 10. If a variable has value null, what is the meaning? 11. How can we access a public and static variable of a class? 12. What is the meaning for a method to invoke another method? 3.5 Local variables, expressions, and assignment 1. Where can local variables be declared? 2. The local variables will be accessible in which scope? 3. Why a variable needs to be declared to have a fixed data type? 4. What do people mean when they say that Java is a strongly-typed language? 5. Will the value stored in a variable be modified if we read the variable s value out? 6. Will the value stored in a variable be modified if we store a new value into the variable? 7. If a local variable is declared with no initial value, is the variable going to have a default initial value? 8. How to declare local variables with initial values? 9. How to declare multiple local variables of the same type in the same Java declaration? 10. Can we declare the type of a variable more than once in the same method? 11. Can we read the value of a variable before it is declared? 12. Can we read the value of a variable before it is initialized? 13. What is the difference between the = operator in a Java assignment from the mathematical relational operator =? 14. How is an assignment statement executed? 15. Can the left side of operator = in an assignment statement be anything other than a variable? 16. What is the meaning for a variable to appear to the right side of operator = in an assignment statement? 17. Assume x = 1. What is the value of variable x after the execution of expression ++x? 18. Assume x = 1. What is the value of expression ++x? 19. Assume x = 1. What is the value of variable x after the execution of expression x++? 20. Assume x = 1. What is the value of expression x++? 21. What is the result of applying operator + to a string value and an integer value, like "CS" + 121? 22. What kind of expressions has side effects? 3.6 Basic built-in data types and type casting 1. List four popular Java built-in data types. 2. Do Java data types have fixed lengths on all hardware and operating system platforms? 3. How many bits are used to store a Java int value? 4. How many bits are used to store a Java double value? 5. How many bits are used to store a Java char value? 5

7 6. What is the data type for literal 12? 7. What is the data type for literal 12.0? 8. What is the value of 7/2? 9. What is the value of 7.0/2? 10. What is 5 % 2? 11. What is type promotion? 12. How can we change the operator evaluation order in an arithmetic expression? 13. Literal values of type char must be enclosed in what kind of delimiters? 14. What is implicit data type casting? 15. Can we assign a double value into an int type variable? 16. What is explicit data type casting? 17. When do we need to use explicit data type casting? 18. What are the valid values of a boolean type variable? 19. Is a relational expression also a boolean expression? 20. What is the value of (1 >= 1)? 21. What are the three most important Boolean operators? 22. When will the conjunction of two Boolean expressions be true? 23. What is the value of ((i < 5) && (i >= 5))? 24. When will the disjunction of two Boolean expressions be false? 25. What is the value of ((i < 5) (i >= 5))? 26. How to convert a string-form int value into an int value? 27. How to convert a string-form double value into a double value? 28. How to convert a string-form boolean value into a boolean value? 29. How to retrieve the second character of a string? 30. How to convert a lower-case letter into its upper-case counterpart? 31. What are the values of the following method invocations against class Math? a. abs(-2) b. ceil(1.5) c. floor(1.5) d. exp(0.0) e. log(1) f. max(1, 2) g. min(1.0, 2.0) h. pow(2.0, 3.0) i. sqrt(4.0) j. random() 3.7 Command-line arguments and loops 1. How to specify a command-line value that contains space characters? 2. Assume the method main() has parameter args. Which command-line argument will be stored in args[0]? 3. If there is no command-line arguments used for a run, what is the value of expression args.length? 4. Which Java library class can be used to sort an array of numbers or strings? 5. What is a compound statement? 6. Can a compound statement contain local variable declarations? Where? 7. Is the body of a method a compound statement? 6

8 8. Is the body of a class a compound statement? 9. Can we replace any statement in a program with a compound statement without violating the syntax specification for Java? 10. If we declare a local variable inside a compound statement, can we access that variable outside of the compound statement? 11. When will a while loop terminate? 12. Can the body of a while loop be a single statement? 13. Enumerate the steps for a while loop to be executed. 14. What is a loop iteration? 15. What is a loop variable? 16. Where should the loop variable for a while loop be declared and initialized? 17. What will happen if we don t modify the value of the loop variable for a while loop during its iteration? 18. What is the control block of a for loop? 19. What is the function of each of the three components of the control block of a for loop? 20. Which character should be used to separate the three components of the control block of a for loop? 21. If we declare the loop variable in a for loop s control block, can we access this loop variable outside the loop body? 22. Enumerate the steps for a for loop to be executed. 23. Normally where do we declare a loop variable and initialize it for a for loop? 24. If a program runs into an infinite loop for some special input data, can the program still be a correct program? 25. What is lexicographic order for character strings? 3.8 Calculator with if-else statements 1. How to find the length of a one-dimensional array? 2. What is \n for in a string literal? 3. What is \t for in a string literal? 4. How is an if statement executed? 5. Is the pair of parentheses for the Boolean expression of an if statement optional? 6. How to chain a list of several if statements together? 7. What is System.exit(int); for? 8. What is the meaning of values for variable x in System.exit(x);? 9. When must we use System.exit(int);? 10. When can we use * as a command-line argument? 3.9 Calculator with switch statement 1. Variables of which data types can be used for the switch expression of a switch statement? 2. Can we omit the pair of parentheses around the switch expression? 3. Do we need a semicolon at the end of a compound statement? 4. Can the case values of the case labels be of different data types from that of the switch expression? 5. Can multiple case labels have the same case value? 7

9 6. Is the default case mandatory? 7. Is the order of the cases important? 8. Can a statement have multiple case labels in a switch statement? 9. What is the meaning of a break statement in a switch statement? 10. How is a switch statement executed? 11. What will happen if the statements for a switch case is not terminated with a break statement or a System.exit(int); statement? 3.10 Calculator with exception processing 1. What is a Java exception? 2. Give two examples that Java code will throw exception objects? 3. If a method receives an exception object not caught by a try-catch block, what will happen? 4. What is a try-catch block for? 5. Is the try clause of a try-catch block optional? 6. Are the catch clauses of a try-catch block optional? 7. Is the finally clause of a try-catch block optional? 8. What statements should be put in the try clause? 9. What is the parameter of a catch clause for? 10. When will a catch clause be executed? 11. When will a finally clause be executed? 12. What kind of exceptions will be caught by catch (Exception e) { }? 13. How does a try-catch block work? 14. What will happen if an exception is thrown to method main() and it is not caught by a catch clause? 15. What is the difference between Java comments delimited by // and those delimited by /* and */? 16. What will happen if // form of comments are embedded inside a pair of /* and */? 3.11 Conditionally interrupting loops 1. If a loop executes statement break, what will happen? 2. If a loop executes statement continue, what will happen? 3.12 Arrays 1. How to declare 1000 int-type variables on one Java source code line? 2. How to declare that variable x is of type array of ints? 3. How many bits will be used to implement an array variable? 4. Does the declaration of an array variable also allocate space for the array? 5. How to allocate an array for 10 integers and connect this array with an int array variable x? 6. If an array has length 10, what are its valid index values? 7. What is the easiest way to declare y to be an int array variable and connect it with an int array of length 1 containing value 1? 8

10 8. How to declare a 2-D int array variable with name z? 9. How to allocate space for a 4 x 4 square int array and connect it with variable z? 10. To access the cell at row 2 and column 3 of array z, should we use expression z[2][3], or z[3][2], or z[2, 3]? 11. How to declare that z3 is a 3-D int array variable? 12. How to allocate space for a 4 x 5 x 6 int array and connect it with a 3-D int array variable z3? 13. To access the cell on plane 1, row 2 and column 3, should we use expression z3[1][2][3], or z3[3][2][1], or z3[1, 2, 3]? 3.13 Method declaration and invocation 1. What are Java methods for? 2. What is a method s signature? 3. Are parameter names parts of a method s signature? 4. What is method return type? 5. What do we mean if we say that a method has void as its return type? 6. What is method parameter list? 7. What is a method declaration? 8. What is a method invocation? 9. What is a method s body? 10. If a method has no parameters, do we still need the pair of parentheses for the parameter list? 11. If a method has two parameters x and y both of type int, can we declare them as in (int x, y)? 12. Can we declare local variables inside a method declaration? Where? 13. Can we declare the type of a variable more than once in the same method? 14. What are the differences between method parameters and method arguments? 15. How are the values of method arguments passed to method parameters? 16. Can a method invocation contain different number of arguments that the number parameters in that method s declaration? 17. How is a method invocation executed? 18. Are parameters of a method part of the local variables of the method? 19. Where can the method parameters be accessed? 20. If a method contains only one statement, can we omit the enclosing curly braces for the method body? 21. Should we capitalize the initial letter of a method s name? 22. What character is used to separate the successive parameters declarations in a method s parameter list? 23. How can we change the name of a parameter without changing the containing method s signature or function? 24. If a method s body executes statement return;, what will happen? 25. If a method s body executes statement return 2*2;, what will happen? 26. If method a() calls method b(), which in turn calls method c(), what is the order for the three methods to complete their executions? 27. Is the order of method declarations in a class important? 28. Can a static method s body invoke a non-static method? 29. What is the value of expression (1 > 2? 1 : 2)? 9

11 3.14 Java documentation comments 1. How to write a Java doc comment? 2. What are Java doc comments for? 3. Where should Java doc comments be located? 4. What is the general structure of a Java doc comment? 5. Which tag should be used to specify a parameter in a Java doc comment? 6. Which tag should be used to specify the method return value in a Java doc comment? 7. How to generate Java documentation HTML files for all the Java source code files in the current working directory? 8. Which generated file is the root file for the resulting HTML documentation? 9. How to let the Java documentation list both public and private methods? 3.15 Scopes of local variables 1. Where can the method parameters be accessed? 2. What is the scope of a local variable? 3. Can a local variable declared in a compound statement be accessed from a nested compound statement after this declaration? 4. If a loop variable is declared in the control block of a for statement, can we access that variable outside of the for loop? 3.16 Formatting output 1. What is the purpose of method System.out.printf()? 2. What is the first parameter of System.out.printf() for? 3. What does %4.2f stand for as part of the first argument to System.out.printf()? 4. What does %6d stand for as part of the first argument to System.out.printf()? 5. If the first argument of System.out.printf() contains 3 substrings of form similar to %4.2f or %6d, how many total arguments must be used in this method invocation? 6. What is the major difference between a variable of type int and a variable of type Random? 7. How can we generate random integers between 0 and 9 inclusive? 8. How can we generate random double values between 0.0 (inclusive) and 10.0 (exclusive)? 9. What is the meaning of importing a class? 10. How to declare that a class needs to import a particular class from a particular package? 3.17 Timing the evaluation of π 1. Can Java double typed variables store all accurate floating-point numbers? 10

12 2. What may happen if a loop is controlled by a Boolean expression that checks whether a double variable has a particular value? 3. What value will be returned by an invocation to method System.currentTimeMillis()? 4. How many bits are used to store a Java long typed variable? 3.18 Matrix multiplication 1. What is the function of method setseed(int) of class Random? 2. How to check the number columns that a two-dimensional array a[][] has? 3. How to avoid repeating similar code in a program? 3.19 Interactive command-line data input 1. How to use class java.util.scanner to get the next integer from a Command Prompt window? 2. How to use class java.util.scanner to get the next double value from a Command Prompt window? 3. How to use class java.util.scanner to get the next line from a Command Prompt window? 4. What should we do before we wait for some user input from a Command Prompt window? 3.20 Window-based data input/output 1. How to pop up a window and request the user to input a string? 2. How to pop up a window to print out some message? 3. When should we use System.exit(int) to terminate a program s execution? 3.21 Text file input/output 1. How to open a text file for reading its contents line by line? 2. How to open a text file for writing text data into it with methods print(), println(), or printf()? 3. How to check whether a file is in existence already? 4. How to close a file? 5. Why do we need to close a file? 6. When should we use a clause like throws IOException for a method? 7. How to remove the leading and trailing white space characters in a string? 8. How to parse a string into white-space-separated tokens (strings that don t contain white space characters)? 9. How to import all classes in a package? 10. What type of exception that the file manipulation methods may throw? 3.22 Recursive vs. iterative methods: factorial 11

13 1. What kind of methods are iterative methods? 2. What kind of methods are recursive methods? 3. What is an activation record for a method s invocation? 4. Can we have multiple unfinished invocations to the same method? 5. Are the local variables of a method shared by multiple unfinished invocations to the method? 6. What will happen if a method executes statement throw new Exception( reason for this exception )? 7. When should we use recursive solutions? 8. When should we use iterative solutions? 3.23 Recursive vs. iterative methods: Fibonacci numbers 1. Why the recursive solution for Fibonacci numbers is much slower than that based on a loop? 2. Which version of the solution is easier to write and read? 3.24 Algorithm and Towers of Hanoi 1. What is an algorithm? 2. Does an algorithm have to stop for any valid input data? 3. What is the time complexity of an algorithm? 4. What is the space complexity of an algorithm? 5. What is the Towers of Hanoi problem? 3.25 Bubble sort 1. What do we mean for sorting an array of integers? 2. What is the main idea of bubble sort? 3. What is the function of the outside loop of the bubble sort method? 4. What is the function of the inner loop of the bubble sort method? 5. The running time of the bubble sort method will be proportional to what expression of the input size? 3.26 Binary search 1. What is a data record? 2. What is the key field of a data record? 3. Can different data records have the same value for their key field? 4. What is the data search problem? 5. How does sequential search work? 6. What are the best-case and worst-case time complexities of sequential search? 7. How does binary search work? 8. What are the best-case and worst-case time complexities of binary search? 12

Program Fundamentals

Program Fundamentals Program Fundamentals /* HelloWorld.java * The classic Hello, world! program */ class HelloWorld { public static void main (String[ ] args) { System.out.println( Hello, world! ); } } /* HelloWorld.java

More information

Key Differences Between Python and Java

Key Differences Between Python and Java Python Python supports many (but not all) aspects of object-oriented programming; but it is possible to write a Python program without making any use of OO concepts. Python is designed to be used interpretively.

More information

CS 152: Data Structures with Java Hello World with the IntelliJ IDE

CS 152: Data Structures with Java Hello World with the IntelliJ IDE CS 152: 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: Electrical and Computer Engineering building

More information

Games Course, summer Introduction to Java. Frédéric Haziza

Games Course, summer Introduction to Java. Frédéric Haziza Games Course, summer 2005 Introduction to Java Frédéric Haziza (daz@it.uu.se) Summer 2005 1 Outline Where to get Java Compilation Notions of Type First Program Java Syntax Scope Class example Classpath

More information

Lecture Set 2: Starting Java

Lecture Set 2: Starting Java Lecture Set 2: Starting Java 1. Java Concepts 2. Java Programming Basics 3. User output 4. Variables and types 5. Expressions 6. User input 7. Uninitialized Variables 0 This Course: Intro to Procedural

More information

Java Bytecode (binary file)

Java Bytecode (binary file) Java is Compiled Unlike Python, which is an interpreted langauge, Java code is compiled. In Java, a compiler reads in a Java source file (the code that we write), and it translates that code into bytecode.

More information

An overview of Java, Data types and variables

An overview of Java, Data types and variables An overview of Java, Data types and variables Lecture 2 from (UNIT IV) Prepared by Mrs. K.M. Sanghavi 1 2 Hello World // HelloWorld.java: Hello World program import java.lang.*; class HelloWorld { public

More information

Lecture Set 2: Starting Java

Lecture Set 2: Starting Java Lecture Set 2: Starting Java 1. Java Concepts 2. Java Programming Basics 3. User output 4. Variables and types 5. Expressions 6. User input 7. Uninitialized Variables 0 This Course: Intro to Procedural

More information

Java Primer 1: Types, Classes and Operators

Java Primer 1: Types, Classes and Operators Java Primer 1 3/18/14 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Java Primer 1: Types,

More information

ARG! Language Reference Manual

ARG! Language Reference Manual ARG! Language Reference Manual Ryan Eagan, Mike Goldin, River Keefer, Shivangi Saxena 1. Introduction ARG is a language to be used to make programming a less frustrating experience. It is similar to C

More information

Values and Variables 1 / 30

Values and Variables 1 / 30 Values and Variables 1 / 30 Values 2 / 30 Computing Computing is any purposeful activity that marries the representation of some dynamic domain with the representation of some dynamic machine that provides

More information

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Programming Language Basics

Programming Language Basics Programming Language Basics Lecture Outline & Notes Overview 1. History & Background 2. Basic Program structure a. How an operating system runs a program i. Machine code ii. OS- specific commands to setup

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 603 203 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING QUESTION BANK B.E. - Electrical and Electronics Engineering IV SEMESTER CS6456 - OBJECT ORIENTED

More information

Chapter 4 Introduction to Control Statements

Chapter 4 Introduction to Control Statements Introduction to Control Statements Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives 2 How do you use the increment and decrement operators? What are the standard math methods?

More information

Computer Programming C++ (wg) CCOs

Computer Programming C++ (wg) CCOs Computer Programming C++ (wg) CCOs I. The student will analyze the different systems, and languages of the computer. (SM 1.4, 3.1, 3.4, 3.6) II. The student will write, compile, link and run a simple C++

More information

CSC 307 DATA STRUCTURES AND ALGORITHM ANALYSIS IN C++ SPRING 2011

CSC 307 DATA STRUCTURES AND ALGORITHM ANALYSIS IN C++ SPRING 2011 CSC 307 DATA STRUCTURES AND ALGORITHM ANALYSIS IN C++ SPRING 2011 Date: 01/18/2011 (Due date: 01/20/2011) Name and ID (print): CHAPTER 6 USER-DEFINED FUNCTIONS I 1. The C++ function pow has parameters.

More information

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011 Lectures 1-22 Moaaz Siddiq Asad Ali Latest Mcqs MIDTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please

More information

Elementary Programming

Elementary Programming Elementary Programming EECS1022: Programming for Mobile Computing Winter 2018 CHEN-WEI WANG Learning Outcomes Learn ingredients of elementary programming: data types [numbers, characters, strings] literal

More information

Lecture 2 Tao Wang 1

Lecture 2 Tao Wang 1 Lecture 2 Tao Wang 1 Objectives In this chapter, you will learn about: Modular programs Programming style Data types Arithmetic operations Variables and declaration statements Common programming errors

More information

Chapter 3. Selections

Chapter 3. Selections Chapter 3 Selections 1 Outline 1. Flow of Control 2. Conditional Statements 3. The if Statement 4. The if-else Statement 5. The Conditional operator 6. The Switch Statement 7. Useful Hints 2 1. Flow of

More information

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question Page 1 of 6 Template no.: A Course Name: Computer Programming1 Course ID: Exam Duration: 2 Hours Exam Time: Exam Date: Final Exam 1'st Semester Student no. in the list: Exam pages: Student's Name: Student

More information

Programming Language Concepts: Lecture 2

Programming Language Concepts: Lecture 2 Programming Language Concepts: Lecture 2 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2011 PLC 2011, Lecture 2, 6 January 2011 Classes and

More information

The Math Class. Using various math class methods. Formatting the values.

The Math Class. Using various math class methods. Formatting the values. The Math Class Using various math class methods. Formatting the values. The Math class is used for mathematical operations; in our case some of its functions will be used. In order to use the Math class,

More information

TOPICS TO COVER:-- Array declaration and use.

TOPICS TO COVER:-- Array declaration and use. ARRAYS in JAVA TOPICS TO COVER:-- Array declaration and use. One-Dimensional Arrays. Passing arrays and array elements as parameters Arrays of objects Searching an array Sorting elements in an array ARRAYS

More information

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette COMP 250: Java Programming I Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette Variables and types [Downey Ch 2] Variable: temporary storage location in memory.

More information

CS201 Latest Solved MCQs

CS201 Latest Solved MCQs Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

What did we talk about last time? Examples switch statements

What did we talk about last time? Examples switch statements Week 4 - Friday What did we talk about last time? Examples switch statements History of computers Hardware Software development Basic Java syntax Output with System.out.print() Mechanical Calculation

More information

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine. 1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent

More information

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Contents 1 Introduction...2 2 Lexical Conventions...2 3 Types...3 4 Syntax...3 5 Expressions...4 6 Declarations...8 7 Statements...9

More information

Review. Primitive Data Types & Variables. String Mathematical operators: + - * / % Comparison: < > <= >= == int, long float, double boolean char

Review. Primitive Data Types & Variables. String Mathematical operators: + - * / % Comparison: < > <= >= == int, long float, double boolean char Review Primitive Data Types & Variables int, long float, double boolean char String Mathematical operators: + - * / % Comparison: < > = == 1 1.3 Conditionals and Loops Introduction to Programming in

More information

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal

Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program

More information

FRAC: Language Reference Manual

FRAC: Language Reference Manual FRAC: Language Reference Manual Justin Chiang jc4127 Kunal Kamath kak2211 Calvin Li ctl2124 Anne Zhang az2350 1. Introduction FRAC is a domain-specific programming language that enables the programmer

More information

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program Syntax What the Compiler needs to understand your program 1 Pre-Processing Any line that starts with # is a pre-processor directive Pre-processor consumes that entire line Possibly replacing it with other

More information

Section 2.2 Your First Program in Java: Printing a Line of Text

Section 2.2 Your First Program in Java: Printing a Line of Text Chapter 2 Introduction to Java Applications Section 2.2 Your First Program in Java: Printing a Line of Text 2.2 Q1: End-of-line comments that should be ignored by the compiler are denoted using a. Two

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

Java for Python Programmers. Comparison of Python and Java Constructs Reading: L&C, App B

Java for Python Programmers. Comparison of Python and Java Constructs Reading: L&C, App B Java for Python Programmers Comparison of Python and Java Constructs Reading: L&C, App B 1 General Formatting Shebang #!/usr/bin/env python Comments # comments for human readers - not code statement #

More information

Chapter 3 Selection Statements

Chapter 3 Selection Statements Chapter 3 Selection Statements 3.1 Introduction Java provides selection statements that let you choose actions with two or more alternative courses. Selection statements use conditions. Conditions are

More information

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 2 (Minor modifications by the instructor) 1 Scope Rules A variable declared inside a function is a local variable Each local variable in a function comes into existence when the function

More information

JAVA Programming Fundamentals

JAVA Programming Fundamentals Chapter 4 JAVA Programming Fundamentals By: Deepak Bhinde PGT Comp.Sc. JAVA character set Character set is a set of valid characters that a language can recognize. It may be any letter, digit or any symbol

More information

Computer Science 1 Ah

Computer Science 1 Ah UNIVERSITY OF EDINBURGH course CS0077 COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS Computer Science 1 Ah Resit Examination Specimen Solutions Date: Monday 1st September 2003 Time: 09:30 11:00

More information

Use of scanf. scanf("%d", &number);

Use of scanf. scanf(%d, &number); Use of scanf We have now discussed how to print out formatted information to the screen, but this isn't nearly as useful unless we can read in information from the user. (This is one way we can make a

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming 3/18/14 Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia, and M. H. Goldwasser, Wiley, 2014 Object-Oriented

More information

Formatting Output & Enumerated Types & Wrapper Classes

Formatting Output & Enumerated Types & Wrapper Classes Formatting Output & Enumerated Types & Wrapper Classes Quick review of last lecture September 8, 2006 ComS 207: Programming I (in Java) Iowa State University, FALL 2006 Instructor: Alexander Stoytchev

More information

Type Conversion. and. Statements

Type Conversion. and. Statements and Statements Type conversion changing a value from one type to another Void Integral Floating Point Derived Boolean Character Integer Real Imaginary Complex no fractional part fractional part 2 tj Suppose

More information

JME Language Reference Manual

JME Language Reference Manual JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.

More information

CS 251 Intermediate Programming Java Basics

CS 251 Intermediate Programming Java Basics CS 251 Intermediate Programming Java Basics Brooke Chenoweth University of New Mexico Spring 2018 Prerequisites These are the topics that I assume that you have already seen: Variables Boolean expressions

More information

1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4. Epic Test Review 5 Epic Test Review 6 Epic Test Review 7 Epic Test Review 8

1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4. Epic Test Review 5 Epic Test Review 6 Epic Test Review 7 Epic Test Review 8 Epic Test Review 1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4 Write a line of code that outputs the phase Hello World to the console without creating a new line character. System.out.print(

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 2 : C# Language Basics Lecture Contents 2 The C# language First program Variables and constants Input/output Expressions and casting

More information

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson Introduction History, Characteristics of Java language Java Language Basics Data types, Variables, Operators and Expressions Anatomy of a Java Program

More information

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath UNIT - I Introduction to C Programming Introduction to C C was originally developed in the year 1970s by Dennis Ritchie at Bell Laboratories, Inc. C is a general-purpose programming language. It has been

More information

Lecture 3 Tao Wang 1

Lecture 3 Tao Wang 1 Lecture 3 Tao Wang 1 Objectives In this chapter, you will learn about: Arithmetic operations Variables and declaration statements Program input using the cin object Common programming errors C++ for Engineers

More information

COSC 123 Computer Creativity. Introduction to Java. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 123 Computer Creativity. Introduction to Java. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 123 Computer Creativity Introduction to Java Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Key Points 1) Introduce Java, a general-purpose programming language,

More information

Functions. Systems Programming Concepts

Functions. Systems Programming Concepts Functions Systems Programming Concepts Functions Simple Function Example Function Prototype and Declaration Math Library Functions Function Definition Header Files Random Number Generator Call by Value

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Scala : an LLVM-targeted Scala compiler

Scala : an LLVM-targeted Scala compiler Scala : an LLVM-targeted Scala compiler Da Liu, UNI: dl2997 Contents 1 Background 1 2 Introduction 1 3 Project Design 1 4 Language Prototype Features 2 4.1 Language Features........................................

More information

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline :: Module Title Duration : Intro to JAVA SE7 and Programming using JAVA SE7 : 9 days Course Description The Java SE 7 Fundamentals course was designed to enable students with little or no programming experience

More information

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. CMSC 131: Chapter 28 Final Review: What you learned this semester The Big Picture Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach. Java

More information

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University

AN OVERVIEW OF C, PART 3. CSE 130: Introduction to Programming in C Stony Brook University AN OVERVIEW OF C, PART 3 CSE 130: Introduction to Programming in C Stony Brook University FANCIER OUTPUT FORMATTING Recall that you can insert a text field width value into a printf() format specifier:

More information

Lecture 6. Assignments. Summary - Variables. Summary Program Parts 1/29/18. Reading: 3.1, 3.2, 3.3, 3.4

Lecture 6. Assignments. Summary - Variables. Summary Program Parts 1/29/18. Reading: 3.1, 3.2, 3.3, 3.4 Assignments Lecture 6 Complete for Project 1 Reading: 3.1, 3.2, 3.3, 3.4 Summary Program Parts Summary - Variables Class Header (class name matches the file name prefix) Class Body Because this is a program,

More information

APCS Semester #1 Final Exam Practice Problems

APCS Semester #1 Final Exam Practice Problems Name: Date: Per: AP Computer Science, Mr. Ferraro APCS Semester #1 Final Exam Practice Problems The problems here are to get you thinking about topics we ve visited thus far in preparation for the semester

More information

Michele Van Dyne Museum 204B CSCI 136: Fundamentals of Computer Science II, Spring

Michele Van Dyne Museum 204B  CSCI 136: Fundamentals of Computer Science II, Spring Michele Van Dyne Museum 204B mvandyne@mtech.edu http://katie.mtech.edu/classes/csci136 CSCI 136: Fundamentals of Computer Science II, Spring 2016 1 Review of Java Basics Data Types Arrays NEW: multidimensional

More information

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

More information

CSE101-lec#12. Designing Structured Programs Introduction to Functions. Created By: Amanpreet Kaur & Sanjeev Kumar SME (CSE) LPU

CSE101-lec#12. Designing Structured Programs Introduction to Functions. Created By: Amanpreet Kaur & Sanjeev Kumar SME (CSE) LPU CSE101-lec#12 Designing Structured Programs Introduction to Functions Created By: Amanpreet Kaur & Sanjeev Kumar SME (CSE) LPU Outline Designing structured programs in C: Counter-controlled repetition

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 04: Exception Handling MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Creating Classes 2 Introduction Exception Handling Common Exceptions Exceptions with Methods Assertions

More information

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Parts of a C++ Program Parts of a C++ Program // sample C++ program

More information

Java Language Basics: Introduction To Java, Basic Features, Java Virtual Machine Concepts, Primitive Data Type And Variables, Java Operators,

Java Language Basics: Introduction To Java, Basic Features, Java Virtual Machine Concepts, Primitive Data Type And Variables, Java Operators, Java Language Basics: Introduction To Java, Basic Features, Java Virtual Machine Concepts, Primitive Data Type And Variables, Java Operators, Expressions, Statements and Arrays. Java technology is: A programming

More information

The Java Language The Java Language Reference (2 nd ed.) is the defining document for the Java language. Most beginning programming students expect

The Java Language The Java Language Reference (2 nd ed.) is the defining document for the Java language. Most beginning programming students expect The Java Language The Java Language Reference (2 nd ed.) is the defining document for the Java language. Most beginning programming students expect such a document to be totally beyond them. That expectation

More information

DECISION STRUCTURES: USING IF STATEMENTS IN JAVA

DECISION STRUCTURES: USING IF STATEMENTS IN JAVA DECISION STRUCTURES: USING IF STATEMENTS IN JAVA S o far all the programs we have created run straight through from start to finish, without making any decisions along the way. Many times, however, you

More information

Topics. Chapter 5. Equality Operators

Topics. Chapter 5. Equality Operators Topics Chapter 5 Flow of Control Part 1: Selection Forming Conditions if/ Statements Comparing Floating-Point Numbers Comparing Objects The equals Method String Comparison Methods The Conditional Operator

More information

CCHAPTER SELECTION STATEMENTS HAPTER 3. Objectives

CCHAPTER SELECTION STATEMENTS HAPTER 3. Objectives LIANMC03v3_0132221586.QXD 5/15/06 7:41 PM Page 67 CCHAPTER HAPTER 3 1 SELECTION STATEMENTS Objectives To declare boolean type and write Boolean expressions ( 3.2). To distinguish between conditional and

More information

MODULE 02: BASIC COMPUTATION IN JAVA

MODULE 02: BASIC COMPUTATION IN JAVA MODULE 02: BASIC COMPUTATION IN JAVA Outline Variables Naming Conventions Data Types Primitive Data Types Review: int, double New: boolean, char The String Class Type Conversion Expressions Assignment

More information

Decision Making in C

Decision Making in C Decision Making in C Decision making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed

More information

SMURF Language Reference Manual Serial MUsic Represented as Functions

SMURF Language Reference Manual Serial MUsic Represented as Functions SMURF Language Reference Manual Serial MUsic Represented as Functions Richard Townsend, Lianne Lairmore, Lindsay Neubauer, Van Bui, Kuangya Zhai {rt2515, lel2143, lan2135, vb2363, kz2219}@columbia.edu

More information

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary GATE- 2016-17 Postal Correspondence 1 C-Programming Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts, Analysis

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG 1 Notice Assignments Reading Assignment: Chapter 3: Introduction to Parameters and Objects The Class 10 Exercise

More information

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE PART A UNIT I 1. Differentiate object oriented programming from procedure oriented programming. 2. Define abstraction and encapsulation. 3. Differentiate

More information

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial 1 Matlab Tutorial 2 Lecture Learning Objectives Each student should be able to: Describe the Matlab desktop Explain the basic use of Matlab variables Explain the basic use of Matlab scripts Explain the

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CA4003 Compiler Construction Assignment Language Definition

CA4003 Compiler Construction Assignment Language Definition CA4003 Compiler Construction Assignment Language Definition David Sinclair 2017-2018 1 Overview The language is not case sensitive. A nonterminal, X, is represented by enclosing it in angle brackets, e.g.

More information

Sprite an animation manipulation language Language Reference Manual

Sprite an animation manipulation language Language Reference Manual Sprite an animation manipulation language Language Reference Manual Team Leader Dave Smith Team Members Dan Benamy John Morales Monica Ranadive Table of Contents A. Introduction...3 B. Lexical Conventions...3

More information

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation.

Functions. Lab 4. Introduction: A function : is a collection of statements that are grouped together to perform an operation. Lab 4 Functions Introduction: A function : is a collection of statements that are grouped together to perform an operation. The following is its format: type name ( parameter1, parameter2,...) { statements

More information

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15

School of Computer Science CPS109 Course Notes 5 Alexander Ferworn Updated Fall 15 Table of Contents 1 INTRODUCTION... 1 2 IF... 1 2.1 BOOLEAN EXPRESSIONS... 3 2.2 BLOCKS... 3 2.3 IF-ELSE... 4 2.4 NESTING... 5 3 SWITCH (SOMETIMES KNOWN AS CASE )... 6 3.1 A BIT ABOUT BREAK... 7 4 CONDITIONAL

More information

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017 Control Structures Lecture 4 COP 3014 Fall 2017 September 18, 2017 Control Flow Control flow refers to the specification of the order in which the individual statements, instructions or function calls

More information

Appendix G C/C++ Notes. C/C++ Coding Style Guidelines Ray Mitchell 475

Appendix G C/C++ Notes. C/C++ Coding Style Guidelines Ray Mitchell 475 C/C++ Notes C/C++ Coding Style Guidelines -0 Ray Mitchell C/C++ Notes 0 0 0 0 NOTE G. C/C++ Coding Style Guidelines. Introduction The C and C++ languages are free form, placing no significance on the column

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Course Outline Introduction to C-Programming

Course Outline Introduction to C-Programming ECE3411 Fall 2015 Lecture 1a. Course Outline Introduction to C-Programming Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: {vandijk,

More information

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University Lecture 2 COMP1406/1006 (the Java course) Fall 2013 M. Jason Hinek Carleton University today s agenda a quick look back (last Thursday) assignment 0 is posted and is due this Friday at 2pm Java compiling

More information

YOLOP Language Reference Manual

YOLOP Language Reference Manual YOLOP Language Reference Manual Sasha McIntosh, Jonathan Liu & Lisa Li sam2270, jl3516 and ll2768 1. Introduction YOLOP (Your Octothorpean Language for Optical Processing) is an image manipulation language

More information

Creating a C++ Program

Creating a C++ Program Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer. 1 Creating a C++ Program created using an

More information

Section 2: Introduction to Java. Historical note

Section 2: Introduction to Java. Historical note The only way to learn a new programming language is by writing programs in it. - B. Kernighan & D. Ritchie Section 2: Introduction to Java Objectives: Data Types Characters and Strings Operators and Precedence

More information

Define a method vs. calling a method. Chapter Goals. Contents 1/21/13

Define a method vs. calling a method. Chapter Goals. Contents 1/21/13 CHAPTER 2 Define a method vs. calling a method Line 3 defines a method called main Line 5 calls a method called println, which is defined in the Java library You will learn later how to define your own

More information

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries 1 CONTENTS 1. Introduction to Java 2. Holding Data 3. Controllin g the f l o w 4. Object Oriented Programming Concepts 5. Inheritance & Packaging 6. Handling Error/Exceptions 7. Handling Strings 8. Threads

More information

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 1 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) WHO

More information

Information Science 1

Information Science 1 Information Science 1 Fundamental Programming Constructs (1) Week 11 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 10 l Flow of control

More information

Chapter 3 - Functions

Chapter 3 - Functions Chapter 3 - Functions 1 Outline 3.1 Introduction 3.2 Program Components in C++ 3.3 Math Library Functions 3.4 Functions 3.5 Function Definitions 3.6 Function Prototypes 3.7 Header Files 3.8 Random Number

More information

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements Programming Languages Third Edition Chapter 9 Control I Expressions and Statements Objectives Understand expressions Understand conditional statements and guards Understand loops and variation on WHILE

More information

The return Statement

The return Statement The return Statement The return statement is the end point of the method. A callee is a method invoked by a caller. The callee returns to the caller if the callee completes all the statements (w/o a return

More information

Chapter 2: Data and Expressions

Chapter 2: Data and Expressions Chapter 2: Data and Expressions CS 121 Department of Computer Science College of Engineering Boise State University April 21, 2015 Chapter 2: Data and Expressions CS 121 1 / 53 Chapter 2 Part 1: Data Types

More information

Lab # 02. Basic Elements of C++ _ Part1

Lab # 02. Basic Elements of C++ _ Part1 Lab # 02 Basic Elements of C++ _ Part1 Lab Objectives: After performing this lab, the students should be able to: Become familiar with the basic components of a C++ program, including functions, special

More information