Running a Java Program using Blue Jay.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

How to do a print screen!. 1. Find what you want to ‘copy’ as evidence:
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
CPIT 102 CPIT 102 CHAPTER 1 COLLABORATING on DOCUMENTS.
How to Create a Java program CS115 Fall George Koutsogiannakis.
1 Lab Session-I CSIT120 Spring2001 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 continues (Session.
How to Use The Borland C++ Compiler Version 5
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Installing the SAFARIODBC.EXE For use with Excel May 3, 2002.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Shell Scripting Introduction. Agenda What is Shell Scripting? Why use Shell Scripting? Writing and Running a Shell Script Basic Commands -ECHO - REM.
Putting Applets into Web Pages.  Two things are involved in the process of putting applets onto web pages ◦ The.class files of the applet ◦ The html.
CPS120: Introduction to Computer Science Compiling Your Programs Using Visual C++
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
Open a editor Write/Type the program Save the program with “.c” extension Compile the program (alt + F9) Run/Execute the program (ctrl + F9) Check the.
Hello World in the Forte IDE An introduction to the Forte IDE (integrated development environment) writing the classic “Hello World” program in Java.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
Vocabulary in VB So Far. Assignment: Used to change the value of an object at run time Used to change the value of an object at run time.
Lesson 10 - Mail Merge and Reviewing Documents Advanced Microsoft Word.
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
CS320n –Visual Programming More LabVIEW Foundations.
Typing and Formatting a Research Paper WORD 2013.
C++ LANGUAGE TUTORIAL LESSON 1 –WRITING YOUR FIRST PROGRAM.
Introduction to Programming Python Lab 1: My First Program 8 January PythonLab1 lecture slides.ppt Ping Brennan
Building the CarryDrop simulation in Eclipse Creating a new project with existing code from John Murphy’s RePast tutorial.
Computer Science Project Lost? Coordinator: Kristen Davis Designer: Danielle Jones Programmer: Miguel Rivera.
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
Using a set-up file to read ASCII data into Stata
Word Lesson 1 Microsoft Word Basics
POWERTEACHER & GRADEBOOK Day to Day User Tutorial
Visual Basic.NET Windows Programming
Development Environment
Chapter 2: The Visual Studio .NET Development Environment
Release Numbers MATLAB is updated regularly
Step-by-Step: Check Spelling and Grammar
How to Submit a External Tool Assignment
Eclipse Navigation & Usage.
Naming, Saving, & Retrieving Files
Word and the Writing Process
Operating Microcomputer
Microsoft Windows 2000 Professional
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
For a new user you must click on the “Registration for Generator” link
Instructor: Raul Cruz-Cano
Lecture 1: Introduction
Java Programming with BlueJ
How to Run a Java Program
Microsoft Excel 101.
JavaTeaching and Importing a github repository
Introduction to TouchDevelop
Microsoft Office Access 2003
Tonga Institute of Higher Education
Macrosystems EDDIE: Getting Started + Troubleshooting Tips
Signing off Transactions, The 17 Step Process
Stata Basic Course Lab 2.
Using screens and adding two numbers - addda.cbl
Java Programming with BlueJ Objectives
University of Warith AL-Anbiya’a
Getting started – Example 1
Unit 3: Variables in Java
Approving Time in Kronos Manager/Supervisor Reference Guide
Chapter 1 Introducing Small Basic
Welcome to Intro to C/C++ CISC 192
Microsoft Excel 2007 – Level 2
How to Run a Java Program
Presentation transcript:

Running a Java Program using Blue Jay

Start Blue Jay by double clicking on the short cut that appears on your desktop You should see a large window as shown in the following picture

Under project select “New project”.

Under your desktop directory, “ …. /desktop/”, type project1 (“… Under your desktop directory, “ …./desktop/”, type project1 (“…./desktop/project1”). This should create a folder called project1 under your desktop directory

Now Click the New Class … button Write the Class name to be: SimpleOperationTest and click OK Note that there should not be any space between the name you choose. So SimpleOperationTest is all one word. This shows the SimpleOperationTest class in the window as follows. Note that the strips mean that the class has not been compiled yet

Now open the SimpleOperationTest by double clicking on it Now open the SimpleOperationTest by double clicking on it. This opens an editor window where you can write and modify your java code. Note that Blue Jay generates some default code for your SimpleOperationTest class All of the blue code are comments. As we will learn later in the course, comments are non-executable code and programmers add them in order to document their code

Any program that you write for your assignments, you need to put the due date of the assignment and your name in there. This indicates that this program is being developed by you. You can delete the version number section. It is not required for this course Also make sure that any program that you develop, you write the description of the program there. This helps you to understand your code if you refer to it later Now to do your first exercise, type the code that is shown in the next slide The java code is case sensitive. Do not miss quotations, “;”, “,” or anything else that is there.

Compile the java program The reason we need to compile a program is to make sure that syntactically the program is correct and contains no error. So to compile the code, click the compile button

If you have typed everything correctly, you will see “Class compiled – no syntax errors” on the status window at the bottom. Syntax error is reported if you make a mistake. Usually, the compiler is good in reporting your error. However, sometimes it may become a bit challenging to find your syntax error.

Note: Note that some of you may like to type this in a text file and then copy and paste it in the Blue Jay editor. In some cases the double quotation character (“) at the beginning and the end of the System.out.println statements may not be the same as the double quotation character of Blue jay editor. So, you may need to remove the quotations and re-type them so the Blue jay compiler does not complain.

If you make a mistake, (example: missing a semi colon (;) or a bracket or a typo), you can always click on the “?” button in the status window to get more help for your syntax errors. Every time you correct an error or a set of errors, you need to recompile the program. You need to fix all your errors until your program compiles with no error and then you can run your program.

Executing (running) your program: Execution starts from one of you constructors. In this example, we only created one constructor but you can create several constructors in a class as long as their input parameters are different from each other To run the program, right click on the SimpleOperationTest class and select new SimpleOperationTest

The system creates an object for you and gives it a default name: in this case it is called simpleOp1 Give 10 to the value of a and 20 to the value of b and press OK

A new object is created. The name of the object is called simpleOp1, and the value of x and y (the are known as a and b in the parameters) are set to 10 and 20 and the sum is 30 Press ok and you see the result appears in a terminal window. After seeing the result, it is better to save it

Under the options in the dialog box, select “save to file …” to save the results in a file and call it simpleOp1Result.txt

Note that an object called simpleOp1 is created at the status bar

Now run the program again by right clicking on the SimpleOperationTest class Again, choose new SimpleOperationTest to run the constructor and create a new SimpleOperationTest object The system creates another object and gives it a different name like simpleOp2 Enter 5 for a and 10 for b to be assigned to x and y in the program, and click OK

The new object is shown on the bottom of the window and the result is shown in the dialog box

Sometime, when you execute a new object, the result of the previous object is also shown in the dialog box. It is a better idea to clear the output screen and then run the object again. This way you will only see the result of that specific object on the screen To clear the output screen, under option, select “clear” Therefore, when the output box pops up, under option select “clear” first and then re-execute the object. When the result is shown, save it and put it in the assignment folder that you need to hand to the instructor on the due date.

After saving the results, You can destroy the objects (not the class) if you want. In order to do that, right click on the object and select “remove” After you are done with the work, close the project. Do not delete the project folder that are related to your assignment. Keep them up as back up. You can delete them at the end of the course.