Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class printEvaluate {
- public printEvaluate(){
- }
- public static void main(String[] args) {
- printEvaluate prog = new printEvaluate();
- prog.doWork();
- }
- private void doScan(){
- Scanner scan = new Scanner(System.in);
- if (scan.next() == “Hello”)
- System.out.println(“Hello to you”);
- else
- System.out.println(“Goodbye”);
- }
- private void doWork(){
- int i = 2, j = 3, k = 6;
- if (i < k / j)
- System.out.println("Good");
- else {
- System.out.println("Bad");
- System.out.println("Done");
- }
- if (i == k % j)
- System.out.println("True");
- else {
- if (i / k == k % j)
- System.out.println("Almost true");
- else {
- System.out.println("False");
- }
- }
- switch (i * (j + k))
- {
- case 0:
- System.out.println("Zero");
- break;
- case 1:
- System.out.println("One");
- break;
- case 2:
- System.out.println("Two");
- break;
- default:
- System.out.println("None of the above");
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment