Formative2Part1 Naong
Formative2Part1 Naong
Formative2Part1 Naong
CCS0023L
(Object Oriented Programming)
EXERCISE
2
Computing using Different Java Operators
Name Role
Members (if Group):
TB21
Section:
Professor:
I. PROGRAM OUTCOME/S (PO) ADRESSED BY THE LABORATORY EXERCISE
a. Apply knowledge of computing appropriate to the discipline.
V. EXPERIMENTAL PROCEDURE:
The user will input a Philippine amount, then the said amount will be converted to different
currencies namely: US Dollar, Euro, Yuan, Koruna, Krone, Sheqel and Dinar
Sample run:
Enter Philippine peso: 43.33089
Source Code:
import java.util.Scanner;
class Formative2 {
public static void main(String[] args) {
Scanner myObj = new Scanner(System.in);
}
}
Screenshot of Code Output:
VI. QUESTION AND ANSWER:
1. Which of the four arithmetic operators can operate on string as well as numeric operands?
The addition (+) & Multiplication (*) operators can be used for string concatenation and
repetition. Other operators cannot be used with strings.
2. Assuming total is a variable, how else could you express in code total = total +2?
total +2? total += 2 ;.
Note: The following rubrics/metrics will be used to grade students’ output in the lab
Exercise 2.
Topic OPERATORS
Lab Activity No 2
Lab Activity Computing using Different Java
Operators
CLO 2
Program execution (20)
Correct output (20)
Design of output (10)
Design of logic (20)
Standards (20)
Delivery (10)
TOTAL