You are on page 1of 1

Atrio R.

Alameda

Activity 1 – variables, Datatypes and Concatenation

1. Create a program that will Print the output below.(20pts)

Output:
Hi my name is Your Full Name, I’am 25 Years Old.
My GPA is 2.25
My Blood type is O.

Answer :

public class Main


{
public static void main(String[] args) {

String name = "Atrio Alameda";


int age = 25;
float gpa = 2.25f;
char blood = 'O';

System.out.println("Hi my name is " +name+ ", I'am " +age+ " Years Old.");
System.out.println("MY GPA is " +gpa);
System.out.println("My Blood type is " +blood+ ".");
}
}

// Hi my name is Your Full Name, I’am 25 Years Old.


My GPA is 2.25
My Blood type is O.

2. Identify the output (5pts)


Int x = 30;
Double y=20.34;
char z=’A’;
System.out.println(“int : “+x+”\nfloat : “+y+”\nchar : “+z);
Answer :
int : 30
float : 20.34
char : A

You might also like