CSE 214 Computer Science II (Spring 2015)
Recitation 1: Java Overview
Objective:
Program #1 [5 min]: Write a program to print “Welcome to java recitation !!!!”
1. Create a new file in your IDE or text editor.
2. Create the shell for your first program by entering:
public class First
{
public static void main(String[] args)
{
// add statement to print here
}
}
3. Save the file as First.java
5. Compile the program and debug, repeating until it compiles successfully.
6. Execute the code
Program #2 [20 min]: Write a program to carry out the following arithmetic computation
Program #3 [25 min]: Write methods with the following signature:
[Note: You can make your program more interactive using switch-case]
This method takes a positive integer and returns true if that number is prime and false otherwise, where a prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
Ex. 2,3, 5, 7 etc.
Ex. 6, 28, 496 etc.
Ex. 131, 1111, 16461 etc.