Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Student {
  4.  
  5. String nazwisko;
  6. String imie;
  7. int dataUr;
  8. int nrAlbumu;
  9. int rokStudiow;
  10. double srednia;
  11. public String getNazwisko() {
  12. return nazwisko;
  13. }
  14. public void setNazwisko(String nazwisko) {
  15. this.nazwisko = nazwisko;
  16. }
  17. public String getImie() {
  18. return imie;
  19. }
  20. public void setImie(String imie) {
  21. this.imie = imie;
  22. }
  23. public int getDataUr() {
  24. return dataUr;
  25. }
  26. public void setDataUr(int dataUr) {
  27. this.dataUr = dataUr;
  28. }
  29. public int getNrAlbumu() {
  30. return nrAlbumu;
  31. }
  32. public void setNrAlbumu(int nrAlbumu) {
  33. this.nrAlbumu = nrAlbumu;
  34. }
  35. public int getRokStudiow() {
  36. return rokStudiow;
  37. }
  38. public void setRokStudiow(int rokStudiow) {
  39. this.rokStudiow = rokStudiow;
  40. }
  41. public double getSrednia() {
  42. return srednia;
  43. }
  44. public void setSrednia(double srednia) {
  45. this.srednia = srednia;
  46. }
  47.  
  48. public Student(String nazwisko, String imie, int dataUr, int nrAlbumu, int rokStudiow, double srednia) {
  49. super();
  50. this.nazwisko = nazwisko;
  51. this.imie = imie;
  52. this.dataUr = dataUr;
  53. this.nrAlbumu = nrAlbumu;
  54. this.rokStudiow = rokStudiow;
  55. this.srednia = srednia;
  56. }
  57. public void czytaj() {
  58. Scanner sc = new Scanner(System.in);
  59. System.out.print("Wpisz nazwisko:");
  60. nazwisko=sc.nextLine();
  61. System.out.print("Wpisz imie:");
  62. imie=sc.nextLine();
  63. System.out.print("Wpisz date urodzenia:");
  64. dataUr=sc.nextInt();
  65. System.out.print("Wpisz numerAlbumu:");
  66. nrAlbumu=sc.nextInt();
  67. System.out.print("Wpisz rok studiów:");
  68. rokStudiow=sc.nextInt();
  69. System.out.print("Wpisz średnią ocen:");
  70. srednia=sc.nextDouble();
  71.  
  72.  
  73. }
  74. @Override
  75. public String toString() {
  76. return "Student [nazwisko=" + nazwisko + ", imie=" + imie + ", dataUr=" + dataUr + ", nrAlbumu=" + nrAlbumu
  77. + ", rokStudiow=" + rokStudiow + ", srednia=" + srednia + "]";
  78. }
  79.  
  80.  
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement