You are on page 1of 7

January 19, 2022

INTERMEDIATE PROGRAMMING
MW 2:30 - 4:00 pm

Name: Gabriella Louise I. Arroyo Program: BSCS


Student Number: 2021-0031 Year level: 1st

A. Program Coding and Debugging:

1. Refer to your Output as of January 10, 2022. Analyze the Program


Codes. List all the Program errors and apply necessary
action/debugging. (Refer to highlighted items). Place your answer after
each item. (Minimum of (5) program errors. Refer to reference below.

Step 1. Click the link below.


https://www.programiz.com/java-programming/examples

Step 2. Click the Tab Tutorials. Select View All Tutorials.

1. Java Introduction

o 1.1 Java Hello World


o 1.2 Java JVM, JRE and JDK
o 1.3 Java Variables and Literals
o 1.4 Java Data Types
o 1.5 Java Operators

1.5.1. Java Arithmetic Operators


1.5.2. Java Assignment Operators
Program errors:
LINE 12: cannot find symbol vqr
LINE 15: Unclosed string literal
LINE 18: Not a statement
LINE 21: unexpected type
LINE 24: bad operand types for binary operator

Process/Debugging Output
1.5.3. Increment and Decrement Operators

Program errors
LINE 7: Variable resultnum2 is never written to
LINE 9: unexpected type
LINE 11: illegal start of expression
LINE 14: <identifier> expected
LINE 16: variable resultnum2 might not have been initialized

Process/Debugging Output
1.5.4. Java instanceof Operator

Program errors
Line 7: missing method body, initializer can be static
LINE 8: Empty character literal
Line 9: variable result is never read
Line 11: empty statement
Line 12: as of release 9’_’ is a keyword, and may not be used as an identifier

Process/Debugging Output
1.5.5. Java Ternary Operator

Program errors
LINE 10: Variable februaryDays is never read
LINE 11: Illegal start of expression
LINE 13: : expeted
LINE 13: incompatible types int cannot be converted to boolean
LINE 14: void cannot be dereferenced

Process/Debugging Output
o 1.6 Java Input and Output

1.6.1. Java Output


1.6.2. print() and println()
1.6.3. Printing Variables and Literals
1.6.4. Print Concatenated Strings
1.6.5. Get Integer Input From the User
1.6.6. Get float, double and String Input

o 1.7 Java Expressions & Blocks


1.7.1. Java Blocks
o 1.8 Java Comment

1.8.1. Single-line Comment


1.8.2. Multi-line Comment

2. Java Flow Control

o 2.1 Java if...else


o 2.2 Java switch Statement
o 2.3 Java for Loop
o 2.4 Java for-each Loop
o 2.5 Java while Loop
o 2.6 Java break Statement
o 2.7 Java continue Statement

Reference:
https://www.programiz.com/java-programming/examples

You might also like