0
I’m having a problem with a programming project.
The program calls for the following:
It is a Database of Questions (For example, a ENEM, or Vestibular).
I PRECISE make some commands ,like add students, teachers, say who you are, and if you 'don’t exist', add it, but that part is already completed. I did Arraylist, for both (any suggestions? I’m open to anything!)
I need to add questions if you are a teacher. I made a teacher variable, which is
boolean
, and can "register" into the program as one, or with a student. However, as I doarray
that increases in size when the teacher adds new questions? I’ve done two-dimensional array as I need to add questions for each year (Philosophy[QUESTION][YEAR],Philosophy[3][0],Philosophy[3][1],Philosophy[3][2],different questions of different years!). And also, when it comes to the answers to each question, I made another array that is the same size as the questions, which corresponds to it, for example, an array of sociology, with X questions for the 3 years, I made another, of answers, with the X questions, with each separate answer each with a '|', for each year.
Any suggestions? package design;
package projetofinal;
public class provaQuestoes {
String[][] Biology = new String[0][3];
String[][] BiologyAnswer = new String[0][3];
//Claro que, para cada matéria, mas esse é só um exemplo
String questionBiology(int year, int question){
return Biology [year][question];
}//Cada matéria tem um método que faz isso
void chooseSubject(int y, int subject, int question){
switch(subject){
case 1:
questionBiology(question, y);
break;
// Cada matéria tem um valor que corresponde a um método que envia uma pergunta,
// porquê eu preciso também que eu crie um teste para o aluno,
// mas isso é para depois
[..]
void addQuestion(int subject, String question, String answers,int y){
switch(subject){
case 1:
\\insira o código aqui
break;
This is a class that has all the disciplines of each year. The Main is another class, where I made a menu "decorated", all in text, with a case, which allows user registration (student/teacher), entry as one of these two, with name registration, question record and other things.
It’s nice to format the question: http://answall.com/editing-help And putting your code is important.
– brasofilo
In case you are not using a database even right? Mysql for example?
– João Neto
No, the 'database' would be the same array, since I don’t know how to program in it
– user3718717
Hmmm, got it. It would be nice if you could post your code, you’re very confused to understand.
– João Neto
I’ll post it then
– user3718717
Fine, put it there that afternoon when I give a while I reply.
– João Neto
You are worsening formatting, please do not undo other users' improvements. Check out the editing history to see how is the default of the site shown by the 1st editor. The following post is also worth a read: Oh, no! They edited my question!, and formatting help: http://answall.com/editing-help . Thank you.
– brasofilo
You can see that the code is all sloppy up there, right? And it’s impossible to fix because you put HTML in the middle of the code. As I said before, the formatting here is in Markdown.
– brasofilo
@user3718717 In order to help you and for the question to be readable to future users with the same problem, try to leave the text and codes well formatted. Preferably, use the Text Editor icons to create list, bold, and code indentation effects - avoid HTML tags. Reread your post also after you finish writing it (imagine how you were your mother reading the text). He’s confused.
– Andre Figueiredo