Full Transcript

M R. K E N N M I G A N V I N C E N T C. G U M O N A N , L P T , M S I T C E B U I N S T I T U T E O F T E C H N O L O G Y – U N I V E R S I T Y VISION STATEMENT...

M R. K E N N M I G A N V I N C E N T C. G U M O N A N , L P T , M S I T C E B U I N S T I T U T E O F T E C H N O L O G Y – U N I V E R S I T Y VISION STATEMENT WE ENVISION TO BE A TOP Philippine University in 2025 TRUSTED EDUCATION PROVIDER OUTCOMES-BASED INSTITUTION OF RESEARCH AND LEARNING PEOPLE-ORIENTED ORGANIZATION 1 P R O G R A M M I N G MISSION STATEMENT We GEAR for Life. CIT commits to: Guide learners to become industry-preferred and life ready professionals Empower people for knowledge generation and creativity Accelerate community development O R I E I E N T E D Respond proactively to a fast-changing world O B J E C T C E B U I N S T I T U T E O F T E C H N O L O G Y – U N I V E R S I T Y CORE VALUES CULTURE OF EXCELLENCE A commitment to go beyond the ordinary; steadfast in delivering data- driven, value-optimized and client-centric service. 1 INTEGRITY Uncompromising adherence to moral and ethical principles, P R O G R A M M I N G TEAMWORK Promoting a culture of collaboration and empowerment/ Commitment to purposeful collaboration to advocate for innovative solutions. UNIVERSALITY Regard for the welfare of people and nature/ Respect for all and stewardship of God's creation / Promotion of common good of, by and for all. O R I E I E N T E D O B J E C T C E B U I N S T I T U T E O F T E C H N O L O G Y – U N I V E R S I T Y VIRTUS IN SCIENTIA ET TECNOLOGIA Virtue in Science and Technology (Virtus in Scientia et Tecnologia) is the 1 P R O G R A M M I N G motto of CIT University. This statement articulates Science and Technology as the institution’s core competence which shall be achieved as young people develop to become values driven individuals O R I E I E N T E D in their pursuit for knowledge and social advancement. O B J E C T C E B U I N S T I T U T E O F T E C H N O L O G Y – U N I V E R S I T Y VISION A leading Center of Excellence in Computing Education. 1 MISSION P R O G R A M M I N G To provide quality industry-standard computing education. GOAL To produce values-driven, industry-preferred and competent computing professionals through: proficient, supportive and O R I E I E N T E D highly-trained faculty; appropriate facilities; programs and pedagogy responsive to the community; as well as a culture that encourages Creativity, Innovation, and Team-work. O B J E C T ILO1. Identify and apply the different data types in a java program. 1 ILO2. Identify and apply type casting, P R O G R A M M I N G operators, and operator precedence in java. O R I E I E N T E D O B J E C T What Data Types? Data types in programming define the kind of data that variables can 1 P R O G R A M M I N G hold. They determine the size, range, and behavior of variables, allowing programmers to work O R I E I E N T E D with different types of data efficiently. O B J E C T What Data Types? Data types in programming define the kind of data that variables can 1 P R O G R A M M I N G hold. They determine the size, range, and behavior of variables, allowing programmers to work with O R I E I E N T E D different types of data efficiently. O B J E C T What is Primitive Data Types? Primitive data types are basic data types provided by the language, and 1 P R O G R A M M I N G they are not objects. They are used to represent simple values. Here are the commonly used primitive data O R I E I E N T E D types in Java: O B J E C T O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 What is Variables? Variables are essential components in programming that allow us to 1 store and manipulate data. They P R O G R A M M I N G play a crucial role in defining and managing information within a Java O R I E I E N T E D program. O B J E C T O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 Declaring and Initializing Variables O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 What is Typecasting? In Java programming, typecasting, also known as type conversion, refers to the process of converting a value from one data type to another. Typecasting allows you 1 to modify the interpretation of a value, enabling you to P R O G R A M M I N G perform operations and assignments that involve different data types. Typecasting involves changing the data type of a value temporarily to perform a specific operation or assignment that requires a different data type. It allows O R I E I E N T E D you to ensure compatibility between operands in expressions, manipulate data in a desired format, and avoid potential data loss or truncation. O B J E C T O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 In this example, we start with the character 'A' and explicitly cast it to an int, resulting in the ASCII value 65. Then, we perform the reverse operation by explicitly casting an integer 98 back to a char, which corresponds to the character 'b'. 1 P R O G R A M M I N G Typecasting in Java allows you to manipulate data by converting values from one data type to another. It provides flexibility and control over how data is interpreted and used in different contexts. Implicit typecasting occurs automatically by the compiler, while O R I E I E N T E D explicit typecasting requires the programmer to specify the desired conversion. However, it's essential to use typecasting with caution, ensuring compatibility and O B J E C T handling potential data loss or truncation issues. What is Input Operations? To accept user input in Java, you can use the Scanner class, which is part 1 P R O G R A M M I N G of the java.util package. The Scanner class allows you to read different types of input from the O R I E I E N T E D user and store them in variables. O B J E C T O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 Java divides the operators into the following groups: Arithmetic operators 1 P R O G R A M M I N G Assignment operators Comparison operators O R I E I E N T E D Logical operators O B J E C T Arithmetic operators are used to perform common mathematical operations. Operator Name Description Example + Addition Adds together two values x+y - Subtraction Subtracts one value from another x-y 1 P R O G R A M M I N G * Multiplication Multiplies two values x*y / Division Divides one value by another x/y % Modulus Returns the division remainder x%y O R I E I E N T E D ++ Increment Increases the value of a variable by 1 ++x O B J E C T -- Decrement Decreases the value of a variable by 1 --x O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 O B J E C T O R I E I E N T E D P R O G R A M M I N G 1 Assignment operators are used to assign values to variables. In the example below, we use the assignment operator (=) to assign the value 10 to a variable called x: Operator Example Same As 1 P R O G R A M M I N G = x=5 x=5 += x += 3 x=x+3 -= x -= 3 x=x-3 O R I E I E N T E D *= x *= 3 x=x*3 /= x /= 3 x=x/3 O B J E C T %= x %= 3 x=x%3 Are used to compare two values (or variables). This is important in programming, because it helps us to find answers and make decisions. The return value of a comparison is either true or false. These values are known as Boolean values. 1 Operator Name Example P R O G R A M M I N G == Equal to x == y != Not equal x != y O R I E I E N T E D > Greater than x>y < Less than x= Greater than or equal to x >= y

Use Quizgecko on...
Browser
Browser