Class Notes (811,170)
Canada (494,539)
COMP 1405 (38)


5 Pages
Unlock Document

Carleton University
Computer Science
COMP 1405
Christine Laurendeau

Chapter 1 Definition: Program A sequence of instructions that can be executed by a computer to solve some problem. Programming Language An artificial language designed to automate the task of organizing and manipulating information, and to express algorithms precisely. What’s the difference between procedure programming and object oriented programming? Procedure Programming reads the program line by line from top to bottom. Object oriented programming is similar to procedure programming, except with the way its information is organized. (Class objects) Java is a very popular object oriented programming language from SUN. It is designed to run on multi- platforms. (Except not as fast as other programming languages) Java can be found in many modern day technologies such as video games, webcam, video streaming (youtube), cell phones etc. How to setup Java? Download and install the latest Java SDK (software development kit) - Preferably the 32 bit (Carleton computer labs has 32 bit installed and your assignments will be marked there) Download an IDE (Integrated development Environment) - This course uses JCreatorLE Chapter 1 After installing JCreator, create a java project, and a class fC1_0FirstProgram”. Paste the following codes into the program. Each new function of the program is commented out with explanations. Also if needed, those programs are saved as “*.java” format, in the src folder. (Check the zip file). Program 1 //This is a single line comment /* This is also a comment * But used for multiple*/ //Hit the compile button the run the program class C1_0FirstProgram { //Creates a class Object named "C1_0FirstProgram". public static void main (String args[]) { //Creates the main method for the class object //By default most class object with a main method //(from COMP 1005) starts exactly as the line above System.out.println("My First Program!"); //This prints out the String/Text, "My First Program" //In the output window /* The individual lines that tells * a program to excute such as * System.out.println("My First Program!"); * is also called a statement */ } //closing bracket for the main object //- Always needed if main method gets created //Notice there're also open brackets } //closing bracket for the class object - Always needed if main method exists // - ALways needed if object class gets created //Notice there're also open brackets Chapter 1 Program 2 //This program calculates a simple calculation such as //(34 + 89 + 17) / 3 class C1_1CalculatorProgram { //Creates a class object public static void main (String args[]) { //Creates a main method within the class object System.out.print("The average of 34, 89 and 17 is "); //System.out.print(
More Less

Related notes for COMP 1405

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.