Docsity

Java for Beginners: Mastering the Fundamentals of Programming, Schemes and Mind Maps of Computer science

Partial preview of the text

Download Java for Beginners: Mastering the Fundamentals of Programming and more Schemes and Mind Maps Computer science in PDF only on Docsity!

Java for

Beginners

All the basics knowledge needed for becoming a programmer

Variables

๏‚ง - Variables are the way the program stores the informations. ๏‚ง These informations can be Input Data, Output Data or a Support Variable that we use to keep data while the program is doing other operations.

Operatios

๏‚ง - All basics mathematical operations can be performed in Java(+ - / *). ๏‚ง - Advanced operations can be used adding libraries

Example

๏‚ง - calculator uses numbers and the operation we want to perform ๏‚ง โ€˜11โ€™ โ€˜+โ€™ โ€˜12โ€™ ๏‚ง - The result of the operation ๏‚ง โ€˜33โ€™

FlowChart Diagram

๏‚ง - We use a flowchart before starting code so we have a better understanding of the sequence of operation we want the code to perform.

Int x;

Our Flowchart

X is an integer variables and stores 10

Y is an integer variable and stores 12

Output we give the result of x+y as output

Int x= 10;

Int y= 12;

x+y;

Example

๏‚ง - Input for the calculator are numbers and the operation we want to perform ๏‚ง โ€˜1โ€™ โ€˜+โ€™ โ€˜2โ€™ ๏‚ง - The output is the result of the operation ๏‚ง โ€˜3โ€™

Send Input from Keyboard

๏‚ง Scanner console = new Scanner(System.in); -> lets the data inserted from console go to code ๏‚ง int x = console.nextInt(); -> saves the integer in the variable X that sent by pressing โ€œEnterโ€