* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package projeto_interface_básica;
import java.util.Scanner;
import javax.swing.JOptionPane;
/**
*
* @author ALLAN
*/
public class Projeto_interface_básica {
/**
* @param args the command line arguments
*/
public staticvoid main(String[] args){
// TODO code application logic here
int n,q,x,v;
q=1;
n= Integer.parseInt(JOptionPane.showInputDialog("Digite a quantidade TOTAL de carros: "));
String A[]=newString[n];
String B[]=newString[n];
String C[]=newString[n];
leitura(n,A,B,C);
while(q==1){
v=1;
while(v==1){
x= Integer.parseInt(JOptionPane.showInputDialog("Digite o número de uma das opções a baixo: "+"\n1.LOCAÇÃO \n2.DEVOLUÇÃO \n3.Verificação de um automóvel \n4.Verificação de todos os automóveis \n5.AJUDA \n6.SAIR"));
if(x<1| x>6){
v=1;
}
else{
if(x==1){
locação(n,A,B,C);
v=0;
}
if(x==2){
devolução(n,A,B,C);
v=0;
}
if(x==3){
verificaçãoPontual(n,A,B,C);
v=0;
}
if(x==4){
verificaçãoGERAL(n,A,B,C);
v=0;
}
if(x==5){
JOptionPane.showMessageDialog(null,"Texto de ajuda");
}
if(x==6){
q=0;
v=0;
}
}
}
}
}
public staticvoid leitura (int k,String[] X,String[]Y,String[]W){
int i;
i=0;
while(i<k){
X[i]="GARAGEM";
Y[i]=" ";
W[i]=" ";
i++;
}
}
public staticvoid locação (int m,String[] G,String[] H,String[]J){
Scanner ent =new Scanner (System.in);
int u,s;
s=1;
while(s==1){
u= Integer.parseInt(JOptionPane.showInputDialog("Digite a posição do carro (1 à "+m+") que deseja locar: "));
if((u-1)<0|(u-1)>=m){
s=1;
}
else{
H[u-1]= JOptionPane.showInputDialog("Digite o nome do cliente: ");
J[u-1]= JOptionPane.showInputDialog("Digite o número do documento do cliente: ");
G[u-1]="LOCADO";
JOptionPane.showMessageDialog(null,"O automóvel número "+1+" foi alugado.");
s=0;
}
}
}
public staticvoid devolução (int m,String[] G,String[] H,String[]J){
Scanner ent =new Scanner (System.in);
int u,s;
s=1;
while(s==1){
u= Integer.parseInt(JOptionPane.showInputDialog("Digite a posição do carro (1 à "+m+") que deseja locar: "));
if((u-1)<0|(u-1)>=m){
s=1;
}
else{
H[u-1]=" ";
J[u-1]=" ";
G[u-1]="GARAGEM";
JOptionPane.showMessageDialog(null,"O automóvel número "+u+" foi devolvido.");
s=0;
}
}
}
public staticvoid verificaçãoGERAL (int m,String[] G,String[] H,String[]J){