†Asian Ins†i†u†e Of Compu†er Studies†
†Asian Ins†i†u†e Of Compu†er Studies†

Java Central and Sub Class Downlo10
Please Register To Log in...
†Asian Ins†i†u†e Of Compu†er Studies†
†Asian Ins†i†u†e Of Compu†er Studies†

Java Central and Sub Class Downlo10
Please Register To Log in...
†Asian Ins†i†u†e Of Compu†er Studies†
Would you like to react to this message? Create an account in a few clicks or log in to continue.

†Asian Ins†i†u†e Of Compu†er Studies†


 
HomeGalleryLatest imagesSearchRegisterLog in
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
†AE1DA†MixPOD†

Latest topics
» JAVA CALCULATE
Java Central and Sub Class I_icon_minitimeMon Sep 17, 2012 2:14 pm by †`Li†o`†

» Grid Layout
Java Central and Sub Class I_icon_minitimeMon Aug 13, 2012 3:43 pm by †`Li†o`†

» Flow Layout
Java Central and Sub Class I_icon_minitimeMon Aug 13, 2012 3:41 pm by †`Li†o`†

» Border Layout
Java Central and Sub Class I_icon_minitimeMon Aug 13, 2012 3:38 pm by †`Li†o`†

» InputStreamAndOutputStream
Java Central and Sub Class I_icon_minitimeMon Aug 13, 2012 3:31 pm by †`Li†o`†

» Triangles Task 1 & 2
Java Central and Sub Class I_icon_minitimeMon Jul 23, 2012 3:32 pm by †`Li†o`†

» Java Central and Sub Class
Java Central and Sub Class I_icon_minitimeMon Jul 09, 2012 3:40 pm by †`Li†o`†

» Payroll Code Part 2
Java Central and Sub Class I_icon_minitimeMon Jul 02, 2012 4:03 pm by †`Li†o`†

» pakyu to .i.
Java Central and Sub Class I_icon_minitimeMon Jun 25, 2012 4:20 pm by `jhajha lanqs`

» Payroll Code
Java Central and Sub Class I_icon_minitimeMon Jun 25, 2012 3:58 pm by †`Li†o`†

» this is it ! xDD !!
Java Central and Sub Class I_icon_minitimeTue Feb 28, 2012 8:11 am by `jhajha lanqs`

» Summary/ Plot Of DATE MOVIE!!
Java Central and Sub Class I_icon_minitimeTue Feb 28, 2012 8:06 am by †`Li†o`†

» about valentines day !
Java Central and Sub Class I_icon_minitimeFri Feb 17, 2012 7:24 am by `jhajha lanqs`

» cos3 Number Guessing Game !
Java Central and Sub Class I_icon_minitimeMon Feb 13, 2012 7:49 am by @†`JeRoLD`†

» eto yown e....
Java Central and Sub Class I_icon_minitimeMon Feb 13, 2012 6:22 am by †`Li†o`†

Top posters
†`Li†o`† (80)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
`jhajha lanqs` (42)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
Jasper ! (12)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
@†`JeRoLD`† (9)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
hEEcHuL05 (9)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
†.frAnCis.† (6)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
jenny (5)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
†Yaphe†S† (3)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
Lhuisi†0 (1)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
julie cko (1)
Java Central and Sub Class I_vote_lcapJava Central and Sub Class I_voting_barJava Central and Sub Class I_vote_rcap 
May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar

 

 Java Central and Sub Class

Go down 
AuthorMessage
†`Li†o`†
Admin
†`Li†o`†


Male Scorpio Posts : 80
Points : 168
Reputation : 9
Birthday : 1995-11-16
Join date : 2011-08-31
Age : 28
Location : Mayapa Calamba Laguna
Job/hobbies : Playing Computer Games.

Java Central and Sub Class Empty
PostSubject: Java Central and Sub Class   Java Central and Sub Class I_icon_minitimeMon Jul 09, 2012 3:40 pm

Quote :
import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;

class Central{
public static Student register(){
Student kid = new Student();Scanner scnr = new Scanner(System.in);

System.out.println("Enter information about the student");
System.out.print("Student ID: ");
kid.StudentIdentificationNumber = scnr.nextInt();
System.out.print("First Name: ");
kid.FirstName = scnr.next();
System.out.print("Last Name: ");
kid.LastName = scnr.next();
System.out.print("Number of credits so far: ");
kid.CreditsSoFar = scnr.nextInt();
System.out.print("Grade point average: ");
kid.GPA = scnr.nextDouble();

return kid;

}

public static void save(Student pupil)throws Exception{
String strFilename = "";
Scanner scnr = new Scanner(System.in);
System.out.print("Enter the file name: ");
strFilename = scnr.next();

if(!strFilename.equals("")){
File fileExample = new File(strFilename);
PrintWriter wrtStudent = new PrintWriter(fileExample);

wrtStudent.println(pupil.StudentIdentificationNumber);
wrtStudent.println(pupil.FirstName);
wrtStudent.println(pupil.LastName);
wrtStudent.println(pupil.CreditsSoFar);
wrtStudent.println(pupil.GPA);

wrtStudent.close();
System.out.println("The file has been created");

}

}


public static void show(Student std)throws Exception{
System.out.println("Student Record");
System.out.println("Student ID: "+std.StudentIdentificationNumber);
System.out.println("First Name: "+std.FirstName);
System.out.println("Last Name: "+std.LastName);
System.out.println("Number of credits so far: "+std.CreditsSoFar);
System.out.println("Grade point average: "+std.GPA);
}

public static void main(String[]args)throws Exception{
String answer = "n";
Student std = register();
Scanner scnr = new Scanner(System.in);

System.out.print("Do you want to save this information (Y/N)?");

answer = scnr.next();

if((answer.equals("Y"))||(answer.equals("Y"))){
show(std);
save(std);
}
}

}




nc Java Central and Sub Class 1698616450 lol!
Back to top Go down
https://ae3ea.forumtl.com
 
Java Central and Sub Class
Back to top 
Page 1 of 1
 Similar topics
-
» TASK 3 sa JAVA :)
» import java
» JAVA CALCULATE
» TASK 2 sa JAVA :)
» TASK 1 sa JAVA :))

Permissions in this forum:You cannot reply to topics in this forum
†Asian Ins†i†u†e Of Compu†er Studies† :: †AE1DA†Computer†Programming†Section† :: †JAVA†-
Jump to: