Professional Documents
Culture Documents
SANTIAGO
BSCS – 1A
18-020007
EXERCISE 1
import java.util.Scanner;
int width;
int height;
int area;
void getWidth(int w) {
this.width = w;
}
void getHeight(int h) {
this.height = h;
}
void computeArea() {
this.area = this.width * this.height;
}
}
if (rectangle1.area == rectangle2.area) {
System.out.println("The area of the rectangles are the same.");
} else {
System.out.println("The area of the rectangles are not the same.");
}
}
}
EXERCISE 2
import java.util.Scanner;
System.out.println("Calendar Assistant");
import java.util.Scanner;
public class Constructor3
{
float us, eu, bp;
float usdollar;
float euro;
float british;
float usamount;
float euroamount;
float britishamount;
Constructor 3(){
System.out.println("Enter Amount:");
float Valueus=solve(currency.usdollar,currency.usd,currency.usamount);
float Valueeu=solve(currency.euro,currency.eu,currency.euroamount);
float Valuebp=solve(currency.british,currency.bp,currency.britishamount);
else if (Valueeu > Valueus && Valueeu > Valuebp ){System.out.println("Largest amount
is EU Account: " +Valueeu); }
}
}