Advertisement
Guest User

info_000001

a guest
Feb 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1.  
  2. /**
  3. * This project has been created to manage school marks in a programm.
  4. *
  5. * If doesn't work try switch off and on again.
  6. *
  7. * @author Joshua Elfert
  8. * @version 02/17/2017
  9. */
  10.  
  11. public class noten {
  12. static int[] noten = new int[6];
  13. static boolean running= true;
  14. public static void main (String[] args) {
  15. int in;
  16.  
  17. while(running){
  18. printMen();
  19.  
  20. in = Kon.readInt();
  21.  
  22. switch(in) {
  23. case 1: eingabe();
  24. break;
  25. case 2: ausgabe();
  26. break;
  27. case 3: rechnen();
  28. break;
  29. case 4: exit();
  30. break;
  31. }
  32. }
  33. }
  34. public static void eingabe() {
  35. clearScreen();
  36. System.out.println("----------------------------");
  37. System.out.println("Wieviele Einsen gibt es?");
  38. System.out.println("----------------------------");
  39. noten[0]= Kon.readInt();
  40. clearScreen();
  41. System.out.println("----------------------------");
  42. System.out.println("Wieviele Zweien gibt es?");
  43. System.out.println("----------------------------");
  44. noten[1]= Kon.readInt();
  45. clearScreen();
  46. System.out.println("----------------------------");
  47. System.out.println("WievieleDreien gibt es?");
  48. System.out.println("----------------------------");
  49. noten[2]= Kon.readInt();
  50. clearScreen();
  51. System.out.println("----------------------------");
  52. System.out.println("Wieviele Vieren gibt es?");
  53. System.out.println("----------------------------");
  54. noten[3]= Kon.readInt();
  55. clearScreen();
  56. System.out.println("----------------------------");
  57. System.out.println("Wieviele F�nfen gibtb es?");
  58. System.out.println("----------------------------");
  59. noten[4]= Kon.readInt();
  60. clearScreen();
  61. System.out.println("----------------------------");
  62. System.out.println("Wieviele Sechsen gibt es?");
  63. System.out.println("----------------------------");
  64. noten[5]= Kon.readInt();
  65. clearScreen();
  66. }
  67. public static void ausgabe() {
  68. clearScreen();
  69. System.out.println("----------------------------");
  70. System.out.println("| Notenspiegel |");
  71. System.out.println("| 1 || "+ noten[0] +" |");
  72. System.out.println("| 2 || "+ noten[1] +" |");
  73. System.out.println("| 3 || "+ noten[2] +" |");
  74. System.out.println("| 4 || "+ noten[3] +" |");
  75. System.out.println("| 5 || "+ noten[4] +" |");
  76. System.out.println("| 6 || "+ noten[5] +" |");
  77. System.out.println("----------------------------");
  78. }
  79. public static void rechnen() {
  80. int anzahl=0;
  81. int durch=0;
  82. for(int i=0; i<6; i++){
  83.  
  84. }
  85. }
  86. public static void exit() {
  87. clearScreen();
  88. running=false;
  89. System.out.println("----------------------------");
  90. System.out.println("| Auf Wiedersehen! |");
  91. System.out.println("----------------------------");
  92. }
  93. public static void printMen() {
  94. clearScreen();
  95. System.out.println("----------------------------");
  96. System.out.println("| Waehlen Sie eine Option! |");
  97. System.out.println("----------------------------");
  98. System.out.println("| Eingabe der Noten (1)|");
  99. System.out.println("----------------------------");
  100. System.out.println("| Ausgabe der Noten (2)|");
  101. System.out.println("----------------------------");
  102. System.out.println("| Durchschnitt berechnen(3)|");
  103. System.out.println("----------------------------");
  104. System.out.println("| Programm beenden (4)|");
  105. System.out.println("----------------------------");
  106. }
  107. public static void clearScreen() {
  108. System.out.print('\u000C');
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement