[go: up one dir, main page]

0% found this document useful (0 votes)
83 views4 pages

Formative2Part2 Naong

This document outlines a laboratory exercise on computing currency conversions using Java operators. Students will write a program that takes in a Philippine peso amount and outputs the equivalent amounts in US dollars, Euros, yuan, koruna, krone, sheqels, and dinars. The program demonstrates the use of arithmetic, relational, and assignment operators. It provides sample source code and output for a program that converts 43.33089 Philippine pesos. Evaluation criteria are also listed to grade students' programs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views4 pages

Formative2Part2 Naong

This document outlines a laboratory exercise on computing currency conversions using Java operators. Students will write a program that takes in a Philippine peso amount and outputs the equivalent amounts in US dollars, Euros, yuan, koruna, krone, sheqels, and dinars. The program demonstrates the use of arithmetic, relational, and assignment operators. It provides sample source code and output for a program that converts 43.33089 Philippine pesos. Evaluation criteria are also listed to grade students' programs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

COLLEGE OF COMPUTER STUDEIS

INFORMATION TECHNOLOGY DEPARTMENT

CCS0023L
(Object Oriented Programming)

EXERCISE

2
Computing using Different Java Operators

Student Name / Group Joshua Miguel D Naong


Name:

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.

II. COURSE LEARNING OUTCOME/S (CLO) ADDDRESSED BY LABORATORY


EXERCISE
2 Apply knowledge of computing fundamentals and develop computer programs as a result
of evaluating possible alternative program constructs that will address the need for
automating real life tasks, taking into account the efficiency and effects of their choice of
constraints.

III. INTENDED LEARNING OUTOME/S (ILO) ADDRESSES BY THE LABORATORY


EXERCISE
● Create Java programs using the Java Operators
● Create Java programs using the different flow control structures
● Create Java programs using single and multi-dimensional arrays

IV. BACKGROUND INFORMATION

Use unary and arithmetic operators for basic mathematical operations


• Use string operator to concatenate strings
• Use relational operators to compare objects
• Use logical operators to compare boolean values
• Use assignment operators to assign values to variables

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

The amount's equivalent to:


US Dollar is : 1.000
Euro : 0.734719
Yuan : 6.346934
Koruna : 18.77263
Krone : 5.449007
Sheqel : 3.726334
Dinar : 0.274588

Suppose, 1.000 US Dollar is equivalent to Php. 43.33089, 0.734719Euro,


6.346934 Yuan, 18.77263 Koruna, 5.449007 Krone, 3.726334 Sheqel, and 0.274588
Dinar.
Source Code:
public class Main
{
public static void main(String[] args) {
double php = 43.33089;
double usd = 1.000;
double euro = 0.734719;
double yuan = 6346934;
double koruma = 18.77263;
double krone = 5.449007;
double sheqel = 3.726334;
double dinar = 0.274588;

System.out.println("Philipine peso: "+php);


System.out.println("\nAmount is equivalent to: ");
System.out.println("US dollar \tis :" + "\t" + usd);
System.out.println("Euro \tis :" + "\t" + euro);
System.out.println("Yuan \tis :" + "\t" + yuan);
System.out.println("Koruma \tis :" + "\t" + koruma);
System.out.println("Krone \tis :" + "\t" + krone);
System.out.println("Sheqel \tis :" + "\t" + sheqel);
System.out.println("Dinar \tis :" + "\t" + dinar);

}
}

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.

Program (100 pts.) (Excellent) (Good) (Fair) (Poor)


Program Program executes Program executes Program executes Program does not
execution (20pts) correctly with no with less than 3 with more than 3 execute (10-11pts)
syntax or runtime errors (15-17pts) errors (12-14pts)
errors (18-20pts)
Correct output Program displays Output has minor Output has Output is incorrect
(20pts) correct output errors (15-17pts) multiple errors (10-11pts)
with no errors (12-14pts)
(18-20pts)
Design of output Program displays Program displays Program does not Output is poorly
(10pts) more than minimally display the designed (5pts)
expected (10pts) expected output required output (6-
(8-9pts) 7pts)
Design of logic Program is Program has slight Program has Program is
(20pts) logically well logic errors that do significant logic incorrect (10-
designed (18- no significantly errors (3-5pts) 11pts)
20pts) affect the results
(15-17pts)
Standards Program code is Few inappropriate Several Program is poorly
(20pts) stylistically well design choices inappropriate written (10-11pts)
designed (18- (i.e. poor variable design choices
20pts) names, improper (i.e. poor variable
indentation) (15- names, improper
17pts) indentation) (12-
14pts)
Delivery The program was The program was The program was The program was
(10pts) delivered on time. delivered a day delivered two days delivered more
(10pts) after the deadline. after the deadline. than two days after
(8-9pts) (6-7pts) the deadline. (5pts)

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

You might also like