Docsity

Exam Study Guide - Introduction to Computing and Programming | CSCI 1301, Study notes of Computer Science

Toggle sidebar
bg1
CSCI 1301
Exam #1 - Study Guide
General Information
Date: February 26th 2009 in class.
• The exam will be close book and closed notes.
• The exam will consist of practical problems to test your proficiency in the topics taught
in class. The level of difficulty of the practical problems will be comparable to those on
the labs, pre-lab exercise worksheets , projects and the suggested exercises posted in
WebCT./Lectures
The following are topics that may be tested in the 1st Exam.
Introduction to Computers and Java
Reading: Java: An Introduction to Problem Solving and Programming Chapter 1 Sections
1.1, 1.2, 1.3 Testing and Debugging and lecture notes.
• Explain the concepts introduced in class
• Computer System
• Hardware
o Describe the different hardware components
• Software
o Program
• Explain what a programming language is.
o Explain what the Syntax of programming language is.
o Explain what the Semantic of programming language is.
• Programming Languages
o Low-level Programming Language
Machine language
o High Level Programming Language
pf3
pf4
pf5

Partial preview of the text

Download Exam Study Guide - Introduction to Computing and Programming | CSCI 1301 and more Study notes Computer Science in PDF only on Docsity!

CSCI 1301

Exam #1 - Study Guide

General Information

Date: February 26th 2009 in class.

  • The exam will be close book and closed notes.
  • The exam will consist of practical problems to test your proficiency in the topics taught in class. The level of difficulty of the practical problems will be comparable to those on the labs, pre-lab exercise worksheets , projects and the suggested exercises posted in WebCT./Lectures

The following are topics that may be tested in the 1st Exam.

Introduction to Computers and Java

Reading: Java: An Introduction to Problem Solving and Programming Chapter 1 Sections 1.1, 1.2, 1.3 Testing and Debugging and lecture notes.

  • Explain the concepts introduced in class
  • Computer System
  • Hardware o Describe the different hardware components
  • Software o Program
  • Explain what a programming language is. o Explain what the Syntax of programming language is. o Explain what the Semantic of programming language is.
  • Programming Languages o Low-level Programming Language ƒ Machine language o High Level Programming Language

o Differences between low-level programming language and high level programming languages

  • Explain what is o Assembler o Compiler o Interpreter
  • Explain the steps to translate a Java Program o Explain what Java bytecode is. o Explain how Java source code is translated and executed.
  • Explain the steps in program development o Explain what a syntax error is. o Explain what a logic error is. o Explain what a run-time error is.
  • Explain o What is an identifier and how to build valid identifiers in Java? o What is a reserved word, (also called keyword)? o What is a comment and the different types of comments that can be used in java?
  • Describe the structure of a Java Application o You should be able to write a simple Java application as the ones you have develop for your projects and lab assignments. ƒ Declaration of a java class. ƒ Declaration of the main method of the class.
  • Practice Exercises o Self-question in sections 1.1, 1.2, 1.3 Testing and Debugging o Exercises 1, 4 o Programming Projects 1, 6, o Lab exercises.

Basic Computation

Reading: Java: An Introduction to Problem Solving and Programming, Chapter 2 Section 2.1 - 2.4, lecture notes.

  • You should be able to write statements that use the methods println and print of the object System.out o to display string literals on the screen o to display string literal that contains escape sequence o to display strings and number jointly
  • Explain the difference between the method println and print of the System.out
  • Use the string concatenation operator to append one string to another o in System.out.println or System.out.print

Decision Statements

Reading: Java: An Introduction to Problem Solving and Programming, Chapter 3 Sections 3.1 - 3.3, lecture notes.

  • What is flow of control of the statements in a program o Describe the differences among sequence, decision and repetition statements
  • Boolean Expressions : o Comparisons: Relational Operators. o What is lexicographical order? o What is the result of using the following methods of a the class String ƒ equals ƒ equalsIgnoreCase ƒ compareTo o Logical Operators: AND (&&), OR (||), NOT (!) ƒ Truth tables of Logical Operators ƒ Shorcut mode of the logical operator AND (&&) and OR (||) ƒ Order of Precedence to evaluate Boolean expressions o Apply the order of precedence of arithmetic, relational and logical operators and the short-circuit mode of the AND and OR to compute the Truth value of a Boolean expression. o Write simple Booleans expression using comparisons. o Write complex Boolean expressions involving comparisons of arithmetic expressions and Boolean variables/constants combined by logical operators. o Write Boolean expressions from English statements like the exercise worksheet #2.
  • Decision Statements o You should be able to write a Java program that involves if-statement using the appropriate syntax ƒ Simple Decision Statements: if ... ƒ if ... else statements ƒ Multibranch: if else if else statements ƒ Nested decisions statements ƒ Using if-statements to compare two floating-point values: ƒ Explain why it is not appropriate to use the == relational operator to compare the equality of two floating point values. ƒ Conditional Operator ƒ Syntax ƒ Explain how it works. ƒ Be able to write assignment statements that use the conditional operator. o Switch Statement ƒ Syntax ƒ Type of expressions that can be used in a switch statement

ƒ Default case ƒ How it works ƒ Explain how a switch statement is executed ƒ Explain how a break statement works within a switch statement

  • You should be able to use decision statements to write Java code that solves problems as the ones proposed in the labs, projects as well as the examples in the textbook.
  • You should be able to interpret and understand code that uses decision statements ( if, if- else , if-else-if , switch ) to compute and display some values.
  • Practice Exercises o Self-question in sections 3.1 - 3. o Evaluating Boolean Expression exercises (WebCT/Lecture Notes/Lecture 3) o Exercises 1, 2 ,3, 4, 5, 6, 11, 12, 13, 15 and 16. o Programming Projects: 1, 2, 5, 6 , 8 and 9. o Lab exercises and pre-lab woksheet.

Repetition Statements

Reading: Java: An Introduction to Problem Solving and Programming, Chapter 4 Sections 4.1 - 4-2 (except nested loops): while, do-while and for loops and lecture notes.

  • Do-while and while Loops : o Boolean condition as control mechanism of a loop. o While loops : ƒ Syntax ƒ Explain how a while statements executes. o Do while Loops : ƒ Syntax ƒ Explain how a do while is executed. o Indicate the differences between do-while and while statements. o Explain what is a sentinel value
  • For Loops o Syntax of a For Loop. o Identify and explain the characteristics of a for loop. o Explain how a for loop is executed. o Be able to write a for-loop as a while loop
  • Loop Bugs o Infinite Loop ƒ Explain what an infinite loop is. ƒ should be able identify when an infinite loop occurs in a Java code
  • Using loops o Solve simple problems using for, while and do-while loops o Solve a given problem using the appropriate combination of loops
  • You should be able to : o Determine the number of iterations executed by a given while loop.