You are on page 1of 1

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"+" "+senten
ce+ " "+"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<=4)
{
System.out.println("We hope that your cgpa will be ="+ +Math.ceil(g)+"
in next Semester");
}
else
{
System.out.println("Do work Hard to improve your CGPA");
}
}
}

You might also like