ICOM 4015 Advanced Programming Laboratory. Chapter 1 Introduction to Eclipse, Java and JUnit

Size: px
Start display at page:

Download "ICOM 4015 Advanced Programming Laboratory. Chapter 1 Introduction to Eclipse, Java and JUnit"

Transcription

1 ICOM 4015 Advanced Programming Laboratory Chapter 1 Introduction to Eclipse, Java and JUnit University of Puerto Rico Electrical and Computer Engineering Department by Juan E. Surís

2 1 Introduction This chapter is designed to introduce Eclipse, Junit and the basics of debugging for those of you who have never used an integrated development environment (IDE). It also assumes that this is the first time that you will be programming in Java. After working through the chapter and all the exercises, you will be able to create projects, classes and unit tests as well as perform some basic debugging. 2 Getting to know Eclipse Eclipse is an open source IDE available for the most common operating system platforms. It provides a powerful programming environment rich with features that make software development easier. In this course we will be using only a handful of these features, some of which we will discuss in this chapter. In this section we will get acquainted with the basic functionality needed to start programming in Java using Eclipse. 2.1 Workspace Before we start Eclipse, we must decide where all our work will reside. The code we will write will be saved in various files and we must now choose where these files will be saved. This area is what in Eclipse is known as the workspace. We may have more than one workspace, but typically all the code related to a single activity will reside in the same workspace. The laboratory instructor will instruct you where you may create a directory to serve as your workspace. Figure 1: Create a new Java project 2.2 Project Within your workspace you want to create groups of files that belong to the same activity. As you will see over the course of the semester, each activity will consist of many files. We also wish to keep files from different activities separate. In Eclipse, a group of files that belong to a single activity is known as a project. Figure 1 shows how to create a new project in Eclipse. You may also create a new project by the following menu sequence File New Java Project 1. When we create a new project, we need to enter some information regarding the project. Figure 2 shows the window where we specify the project information. First, we must give 1 From now on, we will use this shorthand to indicate a menu sequence 1

3 Figure 2: Configure new project the project a name. Always try to give the project a meaningful name that describes the activity that the project implements. In this case, we will name the project HelloWorld. Make sure that the JRE selected is JavaSE-1.6. You should leave all other information as default. You may click Finish to create the project. Figure 3: Create a new Java class 2.3 Main class A computer program is nothing but a sequence of instructions that a computer can execute. Like all sequences, a computer program must have a well defined point to start the execution. For those of you with experience in C/C++, this starting point is the function called main. In Java there also exists a function (called method) main which indicates the starting point 2

4 for the program. Since all code must be part of a class, the main method must belong to a class. The class that contains the main method is called the main class. Let s go ahead and create the main class, called HelloWorld, as shown in Figure 3. You may also create a new class by File New Class. Figure 4: Configure the main class Just like we did when creating a new project, we must provide some information regarding the class. Figure 4 shows the windows where we specify the class information. Notice that we need to provide the package it belongs to. For now we will let it belong to the default package, although Eclipse warns that that is discouraged. Give the class the name HelloWorld. Since this is the main class, we will ask Eclipse to create the stub (or signature) for the main method. This is done by selecting the checkbox as shown in the figure. The stub will look like this: public static void main(string[] args) Now that the main class has been created, we are ready to add some code and create our first Java program. As is traditional with Hello World programs, we will add code to write a single line to the console that reads Hello world. This is accomplished by adding the following line of code to the (empty) body of the method main: System.out.println( Hello world ); We now have our first executable Java program. Figure 5 shows how we execute a Java program in Eclipse. We can also do Run Run. The output of the program is shown in the console window, as shown in Figure 6. 3

5 2.4 A closer look at Eclipse Figure 5: Execute HelloWorld Before we continue with the rest of the chapter, let us take a closer look at Eclipse and identify the most important aspects, which we will be using and interacting with throughout the semester. Figure 6 shows the Eclipse window right after execution of the HelloWorld program. We just looked at the console. If we were to execute this program in a command line, whatever would appear on the screen is shown in the console window. Figure 6: Snapshot of current project The leftmost window is called the Package Explorer. In this window, we can see the projects that are in our current workspace. By double-clicking on a project, we can see a tree of all the files that belong to the project. We can see that there exists a file under our project, called HelloWorld.java. This file contains all the code for the HelloWorld class we just created. Java stores each class in its own.java file and in this window we can browse the files for each class in the package. Also, notice that HelloWorld.java resides under the 4

6 entry src. This means that the file is in the source directory called src. Later on we will create another source directory. Having different source directories helps us separate different portions of our project. Next we have the open file tabs. Here Eclipse displays all the source files we have opened for browsing and/or editing. In this case, when we created the class HelloWorld, a tab was for the source file was opened by Eclipse. We can also open a tab for a given source file by double-clicking the file name in the Package Explorer or by File Open File... and then selecting the file. Try closing the file by clicking on the x on the tab and opening it again. Now let us examine the file tab for HelloWorld. In it we can see the declaration of the class. We can also see the body of the main method. The file tab is the place where we will be interacting the most with Eclipse while we are programming. Finally, at the upper right corner we can see the Perspective Menu. A perspective in Eclipse is an arrangement of windows within Eclipse. This concept is very useful, as we desire different window arrangements depending on the task we are performing. The current perspective is Java. Later on, we will switch to the Debug perspective. 3 Another class In this section we are going to create another class that we will use in the main method of the HelloWorld class. Go ahead as before and create another class named Summation. This time do not select the checkbox to create the stub for a main method. You should now see in the Package Browser a file named Summation.java and a new tab for the file with the class declaration and an empty body. 3.1 Code for Summation class Copy the code in Figure 7 (by hand!) in the Summation. The code for the Summation class consists of a member field, a constructor and a method. The member field is public, of type int and is named sumub. The method is public, has a return type of int and is named dosum(). By inspecting the code, we can gather that the method calculates the sum of the integers from 1 to sumub 2. Constructors will be discussed in a later chapter. Now modify the code of the main method of the HelloWorld class as in Figure 8. Execute the program as before. You should see results in the console as follows: Hello world The sum of 1 to 20 = 210 Now change the value of s.sumub in method main to What is the result? Can you explain why? Finally, let us add some comments to our Summation code, so that when we look at this code 2 years from now we can remember what we did (or somebody else can use it without having to read the code). Fortunately, Eclipse can get us started by creating a placeholder for our comments by simply placing the cursor on the line containing the element we wish to create the comment on and do Source Generate Element Comment. Fill in the comments with something appropriate. 2 Actually, there is a an error which we will catch later. 5

7 Figure 7: Code for Summation class Figure 8: Code for main method 4 Unit Testing A crucial part of programming is testing the code we write to verify that the functionality is as we intend. Unit testing is a verification technique where programs are broken done into units. We then write test(s) for each individual unit. Each test case is self-contained and individual from the others. For the purposes of this course, most of the times a unit will be a method. In this section we will try unit testing with JUnit and Eclipse. 4.1 Unit test for Summation class As mentioned above, usually our units are methods. In this case, the unit we wish to test is the method dosum(). They way we will test this method is by creating an instance of a Summation object, set a value for the sumub and verify that the method returns the correct value. 6

8 To create a unit test, first we will create a new source directory to store the unit test. It is convenient to store the testing code separate from the rest of the code. Do Project Properties Java Build Path and select the Source tab. Click the Add Folder... button, then the Create New Folder... button. Name the new folder Test and click Finish. You should see the new folder in the Package Browser. Figure 9: Create a new JUnit test (a) Window #1 (b) Window #2 Figure 10: Configure the new JUnit test Figure 9 shows how to create a new JUnit test. You may also do File New JUnit Test Case. Just like when we created the project and the class, we need to provide some information about the new test. Figure 9 shows the windows where we provide the information. 7

9 On Figure 10(a) notice the option to create a JUnit 4 Test was selected. Throughout the course we will be using JUnit 4. We must change the Source folder to HelloWorld/Test and name the test test dosum. Specify the class under test as Summation and click the button Next. This leads to the window shown in Figure 10(b) where we specify the method(s) we are going to test. Select the method dosum and click the button Finish. Notice on the Package Explorer that the test should be under the source directory Test. Eclipse may ask if you want to add JUnit 4 library to the build path. If so, select Yes. Type the test code (by hand) as shown in Figure 11. Most of the code should have been generated by Eclipse. Run the test the same way you have run the previous programs. Figure 11 shows the state after the test has been run. Notice that where the Package Explorer used to be there is a summary of the tests run and a Failure Trace. We can see from the Failure Trace that our test failed. In the next section we will figure out why. Figure 11: Code for new test 5 Debugging While we always strive to write our code perfect the first time, seldom are we so lucky. We have just discussed how to test our code to verify functionality. We actually found that the code does not actually work as it should, since our test failed. Testing helped us find out there was an error, debugging is the technique we use to find out why and where the error is so we can fix it. The essential element of debugging is what is called a breakpoint. A breakpoint is a signal that tells Eclipse to temporarily suspend execution of the program or test at a certain point. Once suspended, we can examine the state of the program, such as variable values. By observing the state of the program, we can verify that it is as we expect it to be. 8

10 To facilitate debugging, Eclipse provides us with a Debugging Perspective. Change to the debugging perspective by clicking the Debug button in the Perspective Menu, or by doing Window Open Perspective Debug. Figure 12: Debug Perspective Figure 12 shows the window arrangement in Debug Perspective, while a debugging session is active for the execution of HelloWorld. To start the debug session, first we need to set a breakpoint. Go to Summation.java and place a breakpoint on the line shown in the figure (13). You can place a breakpoint by double-clicking on the blue horizontal bar next to the line of code where you wish to place the breakpoint. The mouse point in Figure 12 shows how to set the breakpoint in the desired line of code. Now that we have the breakpoint we desire, we can start the debugging session. Figure 13 shows how to start the debugging session. You may also do Run Debug. Figure 13: Start debugging session Now that the debugging session is started, your program should have executed up tu the line where we placed the breakpoint. You should see exactly as in Figure 12. The first area we want to notice is the Variables tab. We can see the value of the variable in the current scope: i and sum. Since this is the first iteration of the for loop, the values as are expected. 9

11 Once the execution of a program is suspended, we have several options as to how to proceed. In the debug window, there is a menu with several buttons. Float your mouse over them and Eclipse will pop-up a note with the function that each button performs. The functions that we will be interested in today are: 1. Continue - Commence the execution of the program at the point where it was last suspended. The execution will continue until a breakpoint is reached or the program terminates. 2. Stop - Terminate execution of the program and the debugging session. 3. Step Over - This executes the next line of code. If this line of code calls any methods, the entire code of these methods is executed, unless a breakpoint is encountered. 4. Step Into - This executes the next line of code. However, if this line of code calls any methods, the debugger will enter the code for the first method executed and stop at the first line of code it encounters. This is useful if we want to debug the code for these method calls. Be careful not to try to step into code for method calls of classes you do not have the code to. The best way to get a sense for how these work, continue your debug session trying all of of them. Try to anticipate what will happens and when you are incorrect figure out why. After a couple of debugging session, you should have a good idea of how these work. After you have entered a few debugging session for HelloWorld, select the Test dotest.java tab and start a debug session. This debug session is now executing the unit test we created earlier, which we know failed. Now your job is to figure out why. (Notice that the breakpoints we set earlier are still set). Fix the Summation code so that the method dosum() returns the sum of all integers from 1 to sumub. Show the code to the instructor when you think you have fixed the error. 6 Exercise Create the following: (a) A new project named LetterCountExample (b) A main class for the project named the same of the project. (c) A class called LetterCounter, with the following members: i. A field of type char named letter. ii. A method of return type int, named docount(string) that takes one argument of type String and returns the number of times the character in the variable letter occurs in the given String. (d) Create a Junit test that uses the test string abracadabra and verifies that the method returns the correct value. 10

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below. CS520 Setting Up the Programming Environment for Windows Suresh Kalathur 1. Java8 SDK Java8 SDK (Windows Users) For Windows users, download the Java8 SDK as shown below. The Java Development Kit (JDK)

More information

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

2 Getting Started. Getting Started (v1.8.6) 3/5/2007 2 Getting Started Java will be used in the examples in this section; however, the information applies to all supported languages for which you have installed a compiler (e.g., Ada, C, C++, Java) unless

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

Getting Started (1.8.7) 9/2/2009

Getting Started (1.8.7) 9/2/2009 2 Getting Started For the examples in this section, Microsoft Windows and Java will be used. However, much of the information applies to other operating systems and supported languages for which you have

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 1: Introduction, HelloWorld Program and use of the Debugger 17 January 2019 SP1-Lab1-2018-19.pptx Tobi Brodie (tobi@dcs.bbk.ac.uk) 1 Module Information Lectures: Afternoon

More information

Comp Assignment 2: Object-Oriented Scanning for Numbers, Words, and Quoted Strings

Comp Assignment 2: Object-Oriented Scanning for Numbers, Words, and Quoted Strings Comp 401 - Assignment 2: Object-Oriented Scanning for Numbers, Words, and Quoted Strings Date Assigned: Thu Aug 29, 2013 Completion Date: Fri Sep 6, 2013 Early Submission Date: Wed Sep 4, 2013 This work

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 1: Introduction, HelloWorld Program and use of the Debugger 11 January 2018 SP1-Lab1-2017-18.pptx Tobi Brodie (tobi@dcs.bbk.ac.uk) 1 Module Information Lectures: Afternoon

More information

SDKs - Eclipse. SENG 403, Tutorial 2

SDKs - Eclipse. SENG 403, Tutorial 2 SDKs - SENG 403, Tutorial 2 AGENDA - SDK Basics - - How to create Project - How to create a Class - Run Program - Debug Program SDK Basics Software Development Kit is a set of software development tools

More information

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software.

The NetBeans IDE is a big file --- a minimum of around 30 MB. After you have downloaded the file, simply execute the file to install the software. Introduction to Netbeans This document is a brief introduction to writing and compiling a program using the NetBeans Integrated Development Environment (IDE). An IDE is a program that automates and makes

More information

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Testing and Debugging

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Testing and Debugging WIT COMP1000 Testing and Debugging Testing Programs When testing your code, always test a variety of input values Never test only one or two values because those samples may not catch some errors Always

More information

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS INTRODUCTION A program written in a computer language, such as C/C++, is turned into executable using special translator software.

More information

CS 201 Software Development Methods Spring Tutorial #1. Eclipse

CS 201 Software Development Methods Spring Tutorial #1. Eclipse CS 201 Software Development Methods Spring 2005 Tutorial #1 Eclipse Written by Matthew Spear and Joseph Calandrino Edited by Christopher Milner and Benjamin Taitelbaum ECLIPSE 3.0 DEVELOPING A SIMPLE PROGRAM

More information

S8352: Java From the Very Beginning Part I - Exercises

S8352: Java From the Very Beginning Part I - Exercises S8352: Java From the Very Beginning Part I - Exercises Ex. 1 Hello World This lab uses the Eclipse development environment which provides all of the tools necessary to build, compile and run Java applications.

More information

ICOM 4015 Advanced Programming Laboratory. Chapter 4 Introduction to Object Oriented Programming

ICOM 4015 Advanced Programming Laboratory. Chapter 4 Introduction to Object Oriented Programming ICOM 4015 Advanced Programming Laboratory Chapter 4 Introduction to Object Oriented Programming University of Puerto Rico Electrical and Computer Engineering Department by Juan E. Surís 1 Introduction

More information

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to:

Get JAVA. I will just tell you what I did (on January 10, 2017). I went to: Get JAVA To compile programs you need the JDK (Java Development Kit). To RUN programs you need the JRE (Java Runtime Environment). This download will get BOTH of them, so that you will be able to both

More information

C02: Overview of Software Development and Java

C02: Overview of Software Development and Java CISC 3120 C02: Overview of Software Development and Java Hui Chen Department of Computer & Information Science CUNY Brooklyn College 08/31/2017 CUNY Brooklyn College 1 Outline Recap and issues Brief introduction

More information

COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE. Instructor: Prasun Dewan (FB 150,

COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE. Instructor: Prasun Dewan (FB 150, COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE Instructor: Prasun Dewan (FB 150, dewan@unc.edu) SCOPE: BASICS AND BEYOND Basic use: CS 1 Beyond basic use: CS2 2 DOWNLOAD FROM WWW.ECLIPSE.ORG Get the

More information

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont.

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. Today! Build HelloWorld yourself in BlueJ and Eclipse. Look at all the Java keywords. Primitive Types. HelloWorld in BlueJ 1. Find BlueJ in the start menu, but start the Select VM program instead (you

More information

7 The Integrated Debugger

7 The Integrated Debugger 7 The Integrated Debugger Your skill set for writing programs would not be complete without knowing how to use a debugger. While a debugger is traditionally associated with finding bugs, it can also be

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 05 / 31 / 2017 Instructor: Michael Eckmann Today s Topics Questions / Comments? recap and some more details about variables, and if / else statements do lab work

More information

Laboratory Assignment #4 Debugging in Eclipse CDT 1

Laboratory Assignment #4 Debugging in Eclipse CDT 1 Lab 4 (10 points) November 20, 2013 CS-2301, System Programming for Non-majors, B-term 2013 Objective Laboratory Assignment #4 Debugging in Eclipse CDT 1 Due: at 11:59 pm on the day of your lab session

More information

13 th Windsor Regional Secondary School Computer Programming Competition

13 th Windsor Regional Secondary School Computer Programming Competition SCHOOL OF COMPUTER SCIENCE 13 th Windsor Regional Secondary School Computer Programming Competition Hosted by The School of Computer Science, University of Windsor WORKSHOP I [ Overview of the Java/Eclipse

More information

Java Programming Constructs Java Programming 2 Lesson 1

Java Programming Constructs Java Programming 2 Lesson 1 Java Programming Constructs Java Programming 2 Lesson 1 Course Objectives Welcome to OST's Java 2 course! In this course, you'll learn more in-depth concepts and syntax of the Java Programming language.

More information

Summer Assignment for AP Computer Science. Room 302

Summer Assignment for AP Computer Science. Room 302 Fall 2016 Summer Assignment for AP Computer Science email: hughes.daniel@north-haven.k12.ct.us website: nhhscomputerscience.com APCS is your subsite Mr. Hughes Room 302 Prerequisites: You should have successfully

More information

1.00 Lecture 2. What s an IDE?

1.00 Lecture 2. What s an IDE? 1.00 Lecture 2 Interactive Development Environment: Eclipse Reading for next time: Big Java: sections 3.1-3.9 (Pretend the method is main() in each example) What s an IDE? An integrated development environment

More information

Javac and Eclipse tutorial

Javac and Eclipse tutorial Javac and Eclipse tutorial Author: Balázs Simon, BME IIT, 2013. Contents 1 Introduction... 2 2 JRE and JDK... 2 3 Java and Javac... 2 4 Environment variables... 3 4.1 Setting the environment variables

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

Lab 1: First Steps in C++ - Eclipse

Lab 1: First Steps in C++ - Eclipse Lab 1: First Steps in C++ - Eclipse Step Zero: Select workspace 1. Upon launching eclipse, we are ask to chose a workspace: 2. We select a new workspace directory (e.g., C:\Courses ): 3. We accept the

More information

At the shell prompt, enter idlde

At the shell prompt, enter idlde IDL Workbench Quick Reference The IDL Workbench is IDL s graphical user interface and integrated development environment. The IDL Workbench is based on the Eclipse framework; if you are already familiar

More information

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang Eclipse Tutorial For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Getting Started with Eclipse Choosing a Perspective Creating a Project Creating a Java

More information

CMPSCI 187 / Spring 2015 Postfix Expression Evaluator

CMPSCI 187 / Spring 2015 Postfix Expression Evaluator CMPSCI 187 / Spring 2015 Postfix Expression Evaluator Due on Thursday, 05 March, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015

More information

Mobile App:IT. Methods & Classes

Mobile App:IT. Methods & Classes Mobile App:IT Methods & Classes WHAT IS A METHOD? - A method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name. -

More information

Lecture 1 - Introduction (Class Notes)

Lecture 1 - Introduction (Class Notes) Lecture 1 - Introduction (Class Notes) Outline: How does a computer work? Very brief! What is programming? The evolution of programming languages Generations of programming languages Compiled vs. Interpreted

More information

Java Program Structure and Eclipse. Overview. Eclipse Projects and Project Structure. COMP 210: Object-Oriented Programming Lecture Notes 1

Java Program Structure and Eclipse. Overview. Eclipse Projects and Project Structure. COMP 210: Object-Oriented Programming Lecture Notes 1 COMP 210: Object-Oriented Programming Lecture Notes 1 Java Program Structure and Eclipse Robert Utterback In these notes we talk about the basic structure of Java-based OOP programs and how to setup and

More information

Using Eclipse Europa - A Tutorial

Using Eclipse Europa - A Tutorial Abstract Lars Vogel Version 0.7 Copyright 2007 Lars Vogel 26.10.2007 Eclipse is a powerful, extensible IDE for building general purpose applications. One of the main applications

More information

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Lecture 04 Software Test Automation: JUnit as an example

More information

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM CS 215 Software Design Homework 3 Due: February 28, 11:30 PM Objectives Specifying and checking class invariants Writing an abstract class Writing an immutable class Background Polynomials are a common

More information

CMPSCI 187 / Spring 2015 Hangman

CMPSCI 187 / Spring 2015 Hangman CMPSCI 187 / Spring 2015 Hangman Due on February 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015 Hangman Contents Overview

More information

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Java Basics

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Java Basics WIT COMP1000 Java Basics Java Origins Java was developed by James Gosling at Sun Microsystems in the early 1990s It was derived largely from the C++ programming language with several enhancements Java

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

Code::Blocks Student Manual

Code::Blocks Student Manual Code::Blocks Student Manual Lawrence Goetz, Network Administrator Yedidyah Langsam, Professor and Theodore Raphan, Distinguished Professor Dept. of Computer and Information Science Brooklyn College of

More information

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple magazine data system. Milestones:

More information

Mechatronics Laboratory Assignment #1 Programming a Digital Signal Processor and the TI OMAPL138 DSP/ARM

Mechatronics Laboratory Assignment #1 Programming a Digital Signal Processor and the TI OMAPL138 DSP/ARM Mechatronics Laboratory Assignment #1 Programming a Digital Signal Processor and the TI OMAPL138 DSP/ARM Recommended Due Date: By your lab time the week of January 29 th Possible Points: If checked off

More information

Getting Started with Eclipse/Java

Getting Started with Eclipse/Java Getting Started with Eclipse/Java Overview The Java programming language is based on the Java Virtual Machine. This is a piece of software that Java source code is run through to produce executables. The

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Introduction to Computation and Problem Solving

Introduction to Computation and Problem Solving Class 3: The Eclipse IDE Introduction to Computation and Problem Solving Prof. Steven R. Lerman and Dr. V. Judson Harward What is an IDE? An integrated development environment (IDE) is an environment in

More information

An Introduction to Komodo

An Introduction to Komodo An Introduction to Komodo The Komodo debugger and simulator is the low-level debugger used in the Digital Systems Laboratory. Like all debuggers, Komodo allows you to run your programs under controlled

More information

CSCI 161: Introduction to Programming I Lab 1a: Programming Environment: Linux and Eclipse

CSCI 161: Introduction to Programming I Lab 1a: Programming Environment: Linux and Eclipse CSCI 161: Introduction to Programming I Lab 1a: Programming Environment: Linux and Eclipse Goals - to become acquainted with the Linux/Gnome environment Overview For this lab, you will login to a workstation

More information

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio ECE2049 Embedded Computing in Engineering Design Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio In this lab, you will be introduced to the Code Composer Studio

More information

Just Enough Eclipse What is Eclipse(TM)? Why is it important? What is this tutorial about?

Just Enough Eclipse What is Eclipse(TM)? Why is it important? What is this tutorial about? Just Enough Eclipse What is Eclipse(TM)? Eclipse is a kind of universal tool platform that provides a feature-rich development environment. It is particularly useful for providing the developer with an

More information

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE PART 1 Eclipse IDE Tutorial Eclipse Java IDE This tutorial describes the usage of Eclipse as a Java IDE. It describes the installation of Eclipse, the creation of Java programs and tips for using Eclipse.

More information

Your password is: firstpw

Your password is: firstpw SHARE Session #9777: WebSphere and Rational Developer Hands-on-Labs Building Java application on System z with RDz Lab exercise (estimate duration) Part 1: Your first Java application on z/os (~35 min).

More information

Hello World on the ATLYS Board. Building the Hardware

Hello World on the ATLYS Board. Building the Hardware 1. Start Xilinx Platform Studio Hello World on the ATLYS Board Building the Hardware 2. Click on Create New Blank Project Using Base System Builder For the project file field, browse to the directory where

More information

DOMAIN TECHNOLOGIES. Getting Started Guide Version 1.1. BoxView IDE. Integrated Development Environment

DOMAIN TECHNOLOGIES. Getting Started Guide Version 1.1. BoxView IDE. Integrated Development Environment Getting Started Guide Version 1.1 BoxView IDE Integrated Development Environment Table of Contents INTRODUCTION...3 System Requirements...3 INSTALLATION...4 License Server...4 Registration...5 Node Locked

More information

CS50 Supersection (for those less comfortable)

CS50 Supersection (for those less comfortable) CS50 Supersection (for those less comfortable) Friday, September 8, 2017 3 4pm, Science Center C Maria Zlatkova, Doug Lloyd Today s Topics Setting up CS50 IDE Variables and Data Types Conditions Boolean

More information

Sun ONE Integrated Development Environment

Sun ONE Integrated Development Environment DiveIntoSunONE.fm Page 197 Tuesday, September 24, 2002 8:49 AM 5 Sun ONE Integrated Development Environment Objectives To be able to use Sun ONE to create, compile and execute Java applications and applets.

More information

Eclipse CDT Tutorial. Eclipse CDT Homepage: Tutorial written by: James D Aniello

Eclipse CDT Tutorial. Eclipse CDT Homepage:  Tutorial written by: James D Aniello Eclipse CDT Tutorial Eclipse CDT Homepage: http://www.eclipse.org/cdt/ Tutorial written by: James D Aniello Hello and welcome to the Eclipse CDT Tutorial. This tutorial will teach you the basics of the

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

Workbook A dialog box will appear asking for you to select your "workspace". Leave the default as is, which should be /home/crsid/workspace.

Workbook A dialog box will appear asking for you to select your workspace. Leave the default as is, which should be /home/crsid/workspace. In this workbook you will learn how to use Eclipse as a development environment for Java programs. Using Eclipse, you will then write a simple Java messaging client which will allow you to send and receive

More information

The User Experience Java Programming 3 Lesson 2

The User Experience Java Programming 3 Lesson 2 The User Experience Java Programming 3 Lesson 2 User Friendly Coding In this lesson, we'll continue to work on our SalesReport application. We'll add features that make users happy by allowing them greater

More information

Using Eclipse for C, MPI, and Suzaku

Using Eclipse for C, MPI, and Suzaku Using Eclipse for C, MPI, and Suzaku Modification date May 30, 2015 B. Wilkinson General. Eclipse is an IDE with plugs for various programming environments including Java and C. Eclipse-PTP (Eclipse with

More information

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently. Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple movie data system. Milestones: 1. Use

More information

INF 111 / CSE 121. Homework 3: Code Reading

INF 111 / CSE 121. Homework 3: Code Reading Homework 3: Code Reading Laboratory Date: Thursday, July 2, 2009 Take Home Due: Monday, July 2, 2009 Name : Student Number : Laboratory Time : Instructions for the Laboratory Objectives Open a project

More information

Math Modeling in Java: An S-I Compartment Model

Math Modeling in Java: An S-I Compartment Model 1 Math Modeling in Java: An S-I Compartment Model Basic Concepts What is a compartment model? A compartment model is one in which a population is modeled by treating its members as if they are separated

More information

Lab #1: A Quick Introduction to the Eclipse IDE

Lab #1: A Quick Introduction to the Eclipse IDE Lab #1: A Quick Introduction to the Eclipse IDE Eclipse is an integrated development environment (IDE) for Java programming. Actually, it is capable of much more than just compiling Java programs but that

More information

CHAPTER 1INTRODUCTION... 3 CHAPTER 2INSTALLING ECLIPSE...

CHAPTER 1INTRODUCTION... 3 CHAPTER 2INSTALLING ECLIPSE... Table of Contents CHAPTER 1INTRODUCTION... 3 CHAPTER 2INSTALLING ECLIPSE... 4 2.1ABOUT JAVA... 4 2.2DIFFERENT EDITIONS OF JAVA... 5 CHAPTER 3DOWNLOADING AND INSTALLING JAVA... 6 CHAPTER 4INSTALLING THE

More information

Outline. Overview. Control statements. Classes and methods. history and advantage how to: program, compile and execute 8 data types 3 types of errors

Outline. Overview. Control statements. Classes and methods. history and advantage how to: program, compile and execute 8 data types 3 types of errors Outline Overview history and advantage how to: program, compile and execute 8 data types 3 types of errors Control statements Selection and repetition statements Classes and methods methods... 2 Oak A

More information

Introduction to Eclipse

Introduction to Eclipse Introduction to Eclipse ENGI 9859, Fall 2013 September 8, 2013 1 Installation Skip this section if Eclipse is already installed and working. ThissectionappliestoWindows7,buttheprocedureshouldbesimilarforotherOSs

More information

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic BIT 3383 Java Programming Sem 1 Session 2011/12 Chapter 2 JAVA basic Objective: After this lesson, you should be able to: declare, initialize and use variables according to Java programming language guidelines

More information

Implement an ADT while using Subversion

Implement an ADT while using Subversion 1 Objectives Learn to use Subversion Implement an ADT while using Subversion In this lab, you learn about the version control tool called Subversion and you will implement a Java class given an interface.

More information

Assignment 1. Application Development

Assignment 1. Application Development Application Development Assignment 1 Content Application Development Day 1 Lecture The lecture provides an introduction to programming, the concept of classes and objects in Java and the Eclipse development

More information

There are several files including the start of a unit test and the method stubs in MindNumber.java. Here is a preview of what you will do:

There are several files including the start of a unit test and the method stubs in MindNumber.java. Here is a preview of what you will do: Project MindNumber Collaboration: Solo. Complete this project by yourself with optional help from section leaders. Do not work with anyone else, do not copy any code directly, do not copy code indirectly

More information

CPS109 Lab 1. i. To become familiar with the Ryerson Computer Science laboratory environment.

CPS109 Lab 1. i. To become familiar with the Ryerson Computer Science laboratory environment. CPS109 Lab 1 Source: Partly from Big Java lab1, by Cay Horstmann. Objective: i. To become familiar with the Ryerson Computer Science laboratory environment. ii. To obtain your login id and to set your

More information

Debugging in AnyLogic. Nathaniel Osgood CMPT

Debugging in AnyLogic. Nathaniel Osgood CMPT Debugging in AnyLogic Nathaniel Osgood CMPT 858 4-5-2011 Avoiding Debugging Defensive Programming Offensive Programming Offensive Programming: Try to Get Broken Program to Fail Early, Hard Asserts: Actually

More information

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018 Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 1: Types and Control Flow http://courses.cs.cornell.edu/cs2110/2018su Lecture 1 Outline 2 Languages Overview Imperative

More information

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail.

Outline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail. OOP in Java 1 Outline 1. Getting started, primitive data types and control structures 2. Classes and objects 3. Extending classes 4. Using some standard packages 5. OOP revisited Parts 1 to 3 introduce

More information

Introduction to Java Applications

Introduction to Java Applications 2 Introduction to Java Applications OBJECTIVES In this chapter you will learn: To write simple Java applications. To use input and output statements. Java s primitive types. Basic memory concepts. To use

More information

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS) GETTING STARTED: YOUR FIRST JAVA APPLICATION 15 3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS) GETTING STARTED: YOUR FIRST JAVA APPLICATION Checklist: The most recent version of Java SE Development

More information

3 Getting Started with Objects

3 Getting Started with Objects 3 Getting Started with Objects If you are an experienced IDE user, you may be able to do this tutorial without having done the previous tutorial, Getting Started. However, at some point you should read

More information

1. Go to the URL Click on JDK download option

1. Go to the URL   Click on JDK download option Download and installation of java 1. Go to the URL http://www.oracle.com/technetwork/java/javase/downloads/index.html Click on JDK download option 2. Select the java as per your system type (32 bit/ 64

More information

Debugging in AVR32 Studio

Debugging in AVR32 Studio Embedded Systems for Mechatronics 1, MF2042 Tutorial Debugging in AVR32 Studio version 2011 10 04 Debugging in AVR32 Studio Debugging is a very powerful tool if you want to have a deeper look into your

More information

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs.

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs. Java SE11 Development Java is the most widely-used development language in the world today. It allows programmers to create objects that can interact with other objects to solve a problem. Explore Java

More information

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to A PROGRAM IS A SEQUENCE of instructions that a computer can execute to perform some task. A simple enough idea, but for the computer to make any use of the instructions, they must be written in a form

More information

Prerequisites for Eclipse

Prerequisites for Eclipse Prerequisites for Eclipse 1 To use Eclipse you must have an installed version of the Java Runtime Environment (JRE). The latest version is available from java.com/en/download/manual.jsp Since Eclipse includes

More information

In this lab we will practice creating, throwing and handling exceptions.

In this lab we will practice creating, throwing and handling exceptions. Lab 5 Exceptions Exceptions indicate that a program has encountered an unforeseen problem. While some problems place programmers at fault (for example, using an index that is outside the boundaries of

More information

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java)

CSCI 161: Introduction to Programming I Lab 1b: Hello, World (Eclipse, Java) Goals - to learn how to compile and execute a Java program - to modify a program to enhance it Overview This activity will introduce you to the Java programming language. You will type in the Java program

More information

Resource 2 Embedded computer and development environment

Resource 2 Embedded computer and development environment Resource 2 Embedded computer and development environment subsystem The development system is a powerful and convenient tool for embedded computing applications. As shown below, the development system consists

More information

Programming Basics. Digital Urban Visualization. People as Flows. ia

Programming Basics.  Digital Urban Visualization. People as Flows. ia Programming Basics Digital Urban Visualization. People as Flows. 28.09.2015 ia zuend@arch.ethz.ch treyer@arch.ethz.ch Programming? Programming is the interaction between the programmer and the computer.

More information

Lab 9 Loops, Debugging

Lab 9 Loops, Debugging Lab 9 Loops, Debugging The following exercises are to be completed during lab class. If you do not have time to finish during lab, they must be completed before the beginning of the following lab session.

More information

IBM WebSphere Java Batch Lab

IBM WebSphere Java Batch Lab IBM WebSphere Java Batch Lab What are we going to do? First we are going to set up a development environment on your workstation. Download and install Eclipse IBM WebSphere Developer Tools IBM Liberty

More information

Code::Blocks Student Manual

Code::Blocks Student Manual Code::Blocks Student Manual Lawrence Goetz, Network Administrator Yedidyah Langsam, Professor and Theodore Raphan, Distinguished Professor Dept. of Computer and Information Science Brooklyn College of

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

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015

ActiveSpaces Transactions. Quick Start Guide. Software Release Published May 25, 2015 ActiveSpaces Transactions Quick Start Guide Software Release 2.5.0 Published May 25, 2015 Important Information SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED

More information

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics Eclipse JVM, main method and using Eclipse Produced by: Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list Files in Java. Java Virtual Machine. main method. Eclipse

More information

News in RSA-RTE 10.2 updated for sprint Mattias Mohlin, May 2018

News in RSA-RTE 10.2 updated for sprint Mattias Mohlin, May 2018 News in RSA-RTE 10.2 updated for sprint 2018.18 Mattias Mohlin, May 2018 Overview Now based on Eclipse Oxygen.3 (4.7.3) Contains everything from RSARTE 10.1 and also additional features and bug fixes See

More information

3. NetBeans IDE 6.0. Java. Fall 2009 Instructor: Dr. Masoud Yaghini

3. NetBeans IDE 6.0. Java. Fall 2009 Instructor: Dr. Masoud Yaghini 3. NetBeans IDE 6.0 Java Fall 2009 Instructor: Dr. Masoud Yaghini Outline Installing the NetBeans IDE First NetBeans IDE Project IDE Windows Source Editor Customizing the IDE References Installing the

More information

Programming with Java

Programming with Java Programming with Java Variables and Output Statement Lecture 03 First stage Software Engineering Dep. Saman M. Omer 2017-2018 Objectives ü Declare and assign values to variable ü How to use eclipse ü What

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG 1 Notice Reading Assignment Chapter 1: Introduction to Java Programming Homework 1 It is due this coming Sunday

More information

Building and Running a Simple UML RT Model in RSARTE

Building and Running a Simple UML RT Model in RSARTE Building and Running a Simple UML RT Model in RSARTE Mattias Mohlin Senior Software Architect IBM In this tutorial we will learn how to use RSARTE for transforming a simple UML RT model into C++ code compiling

More information

Department of Computer Science University of Pretoria. Introduction to Computer Science COS 151

Department of Computer Science University of Pretoria. Introduction to Computer Science COS 151 Department of Computer Science University of Pretoria Introduction to Computer Science COS 151 Practical 1 16 February 2018 1 Plagiarism Policy The Department of Computer Science considers plagiarism as

More information