Showing posts with label year level in java. Show all posts
Showing posts with label year level in java. Show all posts

Wednesday, July 22, 2015

Year Level in Java

In this article I would like to share with you a sample program that I wrote in Java using NetBeans as my integrated development environment I called this program year level checker or determiner that show the user how to use if else statement in Java. This program is for beginners that are very new in Java programming.

I hope you will find my work useful and beneficial. If you have some questions about programming, about my work please send me an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com. People here in the Philippines can contact me at  my mobile number 09173084360.

Thank you very much and Happy Programming.



Sample Program Output


Program Listing

/*
year_level2.java
Programmer By: Mr. Jake R. Pomperada, MAED-IT
Date : July 20, 2015
Tools: NetBeans 8.0.2, Java SE 8.0

Problem No. 4:

Design a program to display the year level of students based on their
year entry number. Here are the given criteria: 
(using if-else statement).

*/


import java.util.Scanner;

class year_level2 {
    
public static void main(String[] args) {
      
     Scanner input = new Scanner(System.in);
     char ch;
    
  do { 
      
      System.out.print("\t\t MARMELO V. ABANTE INSTITUTE OF SCIENCE AND TECHNOLOGY ");
      System.out.println();
      System.out.print("\t\t 12 Mangga St., Brgy.Papaya, Tingloy, Batangas, Batangas City");
      System.out.println("\n");
      System.out.print("Enter your year level now : ");
      int year_level = input.nextInt();
          
      if (year_level == 1) {
          System.out.println();
          System.out.print("You are in a Freshman Status.");
          }
      if (year_level == 2) {
          System.out.println();
          System.out.println("You are in a Sophomore Status.");
         }
     if (year_level == 3) {
          System.out.println();
          System.out.print("You are in a Junior Status.");
         }
      if (year_level == '4') {
          System.out.println();
          System.out.print("You are in Senior Status.");
         }
      else if (year_level > 4 || year_level < 1) {
          System.out.println("Sorry You are out of school youth.");
      }  
     System.out.print("\nDo you want to continue (Type y or n) : ");
     ch = input.next().charAt(0);                        
     } while (ch == 'Y'|| ch == 'y');  
     System.out.println();
     System.out.print("\t THANK YOU FOR USING THIS PROGRAM");
     System.out.println("\n\n");
  }
}