PRELIM Lesson 2
PRELIM Lesson 2
Code in JAVA
WHAT IS A FLOWCHART?
Input/Output
flowline
EXAMPLES of a FLOWCHART?
WHAT IS THE RELATIONSHIP OF FLOWCHARTS AND
PSEUDOCODES IN PLANNING?
Identifying System Specification and Requirements
In this substage of Planning, the needed description of the system or
application is acquired. Purposes, system and user interfaces, database
requirements, quality standards, operations, overview of the whole
application, and other requirements needed for the project development is
defined. This substage helps the programmers as well as the clients in
foreseeing the scope and limitation of the application to be made. After
identifying all the needed details, programmers can now create the
application or system's pseudocode and flowchart.
WHAT IS THE RELATIONSHIP OF FLOWCHARTS AND
PSEUDOCODES IN PLANNING?
Below are the data type summary for the programming language.
,
Keyword Common Language Runtime
Type Structure Value Range
Boolean System.Boolean A Boolean value - true or false
Object System.Object (class) Any type can be stored in a variable of type Object
Single (single-
System.Single -3.402823E+38 to -1.401298E-45 for negative values;
precision 1.401298E-45 to 3.402823E+38 for positive values
floating- point)
Byte - data type to be used if you want to store binary data (set of 0s
and 1s). It is an unsigned type that cannot contain negative
values
Ex: Using byte in arithmetic operations:
byte a = 10;
byte b = 20;
byte c = (byte) (a + b);
DATA TYPES
Char - used to hold a single character, specifically a single unicode
character. Unicode is a 16-bit character which represents all the letters and
symbols of all major languages existing.
Ex: Declaring a char variable:
char myChar = 'A';
Date - data type that holds date values, time values, or the combination
of both.
Ex: Creating a Date object representing the current date and time:
Date now = new Date();
DATA TYPES
Decimal - holds decimal values up to 29 significant digits. It is
specifically designed for financial calculations.
Ex: Using the BigDecimal class to represent decimal numbers with arbitrary precision:
BigDecimal bigDecimal1 = new BigDecimal("12345678901234567890.12345678901234567890");
BigDecimal bigDecimal2 = new BigDecimal("0.0000000000000000000000000000000000000123456789");
BigDecimal sum = bigDecimal1.add(bigDecimal2);
BigDecimal product = bigDecimal1.multiply(bigDecimal2);
Double - powerful data type that can hold even the smallest and the
largest approximation of a real number.
Ex: Declaring a double variable:
double myDouble = 3.14159;
DATA TYPES
Integer - holds only whole number, but loads fast compare to other
data types.
Ex: Declaring an int variable:
int myInt = 42;
Single (float) - like double data type, it is also used to contain floating-
point values. The difference is that it is used for much lesser values. float
can be useful in cases where memory usage is a concern and the level of
precision provided by double is not necessary.
Ex: Declaring a float variable:
float myFloat = 1.23f; //Note that the f at the end of the number is required to indicate that it is a float value.
DATA TYPES
String - data type used to hold set or multiple of characters, like words
and sentences.
Ex: Declaring a String variable:
String myString = "Hello, world!";