This site requires JavaScript, please enable it in your browser!
Greenfoot back
Helvete
Helvete wrote ...

2012/5/5

A School Project

Helvete Helvete

2012/5/5

#
Hello, i am from germany, so my english is not so good (sorry for this). In school we had to do a project with greenfoot. The Problem is that we are not so good in programming and that we should look for all what we need on our own in the internet or something else. So first i write what we have to do here in german, and then i try to translate^^ German: 1. Erstelle ein tabellarisches Eingabefenster zur Eingabe von Schülernamen und den zugehörigen Durchschnitten in Mathe, Deutsch und Englisch. Name: Max Mustermann Deutschnote: 3 Mathenote: 2 Englischnote: 2,5 2. Die eingegebenen Schülernamen sollen Variablen zugewiesen werden: S1 - string: Max Mustermann D1 - Zahl: 3 M1 - Zahl: 2 E1 - Zahl: 2,5 3. Die Variablen werden in Listen gespeichert: Schülerliste: Deutschliste: Matheliste: Englischliste: Now in English (I hope u can understand): 1.) You should make a table in which you can fill in names from pupils and there Score in maths, english, and german (subjects) Example: Name: xXXx Mark in German: 3 Mark in Maths: 2 Mark in English: 2,5 2.) To every pupil in the table should be assigned a variable: S1- string: xXXx (name) G1 - Number: 3 (german) M1 - Number: 2 (maths) E1 - Number: 2,5 (english) 3.) The variables should be saved in arrays: Array of students: Array of the German marks: Array of Math marks: Array of English marks: So i hope you can understand and i hope somebody can help me with this. We have never do sth. with arrays, we only do some with loops, or easier things. Nice greetings from germany Helvete
sci-fair-guy sci-fair-guy

2012/5/5

#
Hi, my son knows some German, but I don't, so I'll try sticking to code ;-) You'll need to declare your arrays: Initialized: String students = new String { "Peter", "Nathan", "Lisa"}; int germanScores = new int { 100, 78, 89}; int mathScores = new int { 100, 78, 89}; int englishScores = new int { 100, 78, 89}; or not initialized: String students = new String ; int germanScores = new int ; int mathScores = new int ; int englishScores = new int ; for (int i = 0; i < students.length; i++) { // some way of getting a name and 3 scores like reading from a text field. students = name; germanScores = gs; mathScores = ms; englishScores = es; } Use something like int ms = mathScores to get the 3rd student's math score. Remember, java arrays start at 0 (zero-initial or zero based arrays).
Helvete Helvete

2012/5/6

#
Hey thank you for your answer. (; I will try this thanks.
You need to login to post a reply.