COP 3502 Chapter 2: Elementary Programming
Document Summary
The focus of this chapter is on learning programming techniques to solve problems. Writing programs involve designing algorithms and translating them into programing instructions (code). Algorithm-describes how problem is solved by listing actions that need to be taken and the order of their execution. Pseudocode-natural language combined with some programming code; usually used for planning when planning to write a program. Variable-represents a value stored in the computer"s memory. Primitive data types (fundamental types)-integers, real numbers, characters, and booleans (i. e. int, short, long, float, double, byte, char, and boolean) Float point numbers-numbers with decimals (i. e. float and double) Declaring variables-creating a variable with a data type. String concatenation-using (cid:498)+(cid:499) to combine other variables with strings (cid:523)e. g. (cid:498)a(cid:499) + (cid:498)b(cid:499) becomes (cid:498)ab(cid:499)(cid:524) To get an input from the console, the scanner class is used. The scanner class must be imported in the beginning of the program from the java. util package before it can be used.