2nd

Download 2ND

If you can't read please download the document

Upload: farhan-khan-niazi

Post on 05-Dec-2015

215 views

Category:

Documents


2 download

DESCRIPTION

vkjn kvnjkf knvkfv fkfnbg fj

TRANSCRIPT

import java.util.StringTokenizer;import java.util.Scanner; public class stud { public static void main (String[] args) { System.out.println("Enter student Name:"); Scanner keyboard = new Scanner(System.in); String sentence = keyboard.nextLine(); sentence = sentence.toLowerCase(); char firstCharacter = sentence.charAt(0); sentence = Character.toUpperCase(firstCharacter) + sentence.substring(1); System.out.println("The Name is:"); System.out.println(sentence); System.out.println("Enter CGPA,Registration Number and Semester of"+" "+sentence+ " "+"in given format [CGPA,REGISTRATION NUMBER,SEMESTER]:"); Scanner keyboard1 = new Scanner(System.in); String sentence1 = keyboard.nextLine(); String delimiters = ", "; StringTokenizer nameFactory = new StringTokenizer(sentence1, delimiters); String lastName = nameFactory.nextToken();String firstName = nameFactory.nextToken(); String middleName = nameFactory.nextToken(); System.out.println("WELCOME TO STUDENT PORTAL"); System.out.println("Your information is as follows"); System.out.println("your CGPA IS ="+lastName); System.out.println("your REGISTRATION NUMBER IS ="+firstName); System.out.println("your SEMESTER IS ="+middleName); double g; stud Y=new stud(); g = Double.parseDouble(lastName); if (g>3 && g