CSE 110 - 1st set of Notes
CSE 110 - 1st set of Notes CSE 110
Popular in Prin of Programming with Java Lecture
Popular in ComputerScienence
This 3 page Class Notes was uploaded by RianMartins on Thursday October 15, 2015. The Class Notes belongs to CSE 110 at Arizona State University taught by Justin Selgrad in Fall 2015. Since its upload, it has received 148 views. For similar materials see Prin of Programming with Java Lecture in ComputerScienence at Arizona State University.
Reviews for CSE 110 - 1st set of Notes
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/15/15
CSE 110 PRINCIPLES OF PROGRAMMING IN JAVA WEEKLY NOTES 1 Fundamental Concepts Algorithm Algorithm is a solution for programming stepbystep procedure Compile In order to run your program you need first to compile it That is very important to check if you wrote everything right Casesensitive Java is a language casesensitive This means that a variable named myint is different from myInt In other words the upper and lower case is very important Objectoriented programming language Java is an obiectoriented programming language You will learn about that latter on this course but in short we can say that this is an important feature for programming languages and will be very helpful Pseudocode sourcecode java file class file A pseudocode is the detailed steps that describes a procedure When you write a code and save it with extension w you are creating the sourcecode file when you compile it the compiler creates the class file that will be interpreted by the machine to run your program Syntaxerror logicerror After write your code is completely normal have errors in it There are three main types of error each programming language has their own syntax like any other language we speak when you misspell a keyword or any other type of writing error is a syntaxerror The logicerror is usually detected when your program has no syntaxerror compile and runs but it get a wrong result different from the expected output IDE The IDE is the program that you use to write your code Eclipse TextPad NetBeans Visual Studio etc Computer and Program Computers execute very basic instructions in rapid succession A computer program is a sequence of instructions Programming is the act of designing and implementing computer programs The central processing unit CPU performs program control and data processing Storage devices include memory and secondary storage Hard Disk Java Java is an Objectoriented programming language It was developed in 1990s by Sun Microsystems The main features are safety and portability Java is case sensitive Complier makes bytecode class files from source code java files Java runs the program with Virtual Machine Textpad is one of IDEs and it needs JDK to compile java files and show the syntax errors interactively Simple Program public class HelloPrinter public static void main String args Systemoutprintln quotHello World Important Things to Remember The file name must be the same as the class name The top level is a class block and the function blocks are inside the class block A semicolon is required at the end of any statement The println is a function to print out a set of characters and change the line The print is another function to print it without changing the line brace parenthesis bracket Comments are typed after or between Variables Declaration Assignment Data Type Arithmetic Identifiers Words used in writing programs Java valid identifier starts from an alphabetic character or underscore Variable A name for a location in memory used to hold a data value Types For an integer int For an real number double For a text String Other types short long float char byte boolean Declaration lttypegt ltvariabenamegt int age double weight String lastname Declaration and Assignment at the same time lttypegt ltvariablenamegt ltvauegt int age 22 double weight 1856 String astname Jones Assign or update the value int age 22 int estimatedage 95 age 23 ageage1 1 age 1 2 age 3 int remainningage estimatedage age Obs The lines 1 2 and 3 does the exact same thing They are only different ways to do the same procedure increment the variable age by 1