Me ajuda galera não estou conseguindo concluir.
import javax.swing.JOptionPane;
/**
*
-
@author Elisabete
*/
public class P {/**
-
@param args the command line arguments */ public static void main(String[] args) { String cidade = null; String nCidade; String nHabitantes; String prefeito; String Vizinho; String cidadeInicial; String cidadeAtual;
int x = 0, cont =1;String Cidade =JOptionPane.showInputDialog(null, “ESCOLHA A OPÇÃO DESEJADA”CADASTRAR CIDADE”
+ “\n1)
+ “\n2) MOSTRA CIDADES CADASTRADAS”
+ “\n3) ESCOLHA A CIDADE”
+ “\n4) MENOR CAMINHO”,“CIDADE VIZINHA”, JOptionPane.PLAIN_MESSAGE);do { if(Cidade.toUpperCase().equals(“1”)){ nCidade = JOptionPane.showInputDialog(null,"Nome Da Cidade: ",“CADASTRO”, JOptionPane.PLAIN_MESSAGE); nHabitantes = JOptionPane.showInputDialog(null,"QUANTIDADE DE HABITANTES: ",“CADASTRO”, JOptionPane.PLAIN_MESSAGE); prefeito = JOptionPane.showInputDialog(null,"NOME DO PREFEITO: ",“CADASTRO”, JOptionPane.PLAIN_MESSAGE); Vizinho = JOptionPane.showInputDialog(null,"VIZINHOS: ",“CADASTRO”, JOptionPane.PLAIN_MESSAGE); x = Integer.parseInt(JOptionPane.showInputDialog(null,“Digite a tecla 1 para sair ou 0 para cadastrar outra cidade”)); }cont++; }while ((x==0)&&(cont<=7));
if(.equals(“2”)){Cidade.toUpperCase()} switch (cidade) { case ‘A’: cidadeAtual = Vizinho b & c; break; case ‘B’: cidadeAtual = Vizinho c & e; break; case ‘C’: cidadeAtual = Vizinho d & b; break; case ‘D’: cidadeAtual = Vizinho e & c; break; case ‘E’: cidadeAtual = Vizinho F & D; break; case ‘F’: cidadeAtual = Vizinho e & g; break; case ‘G’: cidadeAtual = Vizinho f;
if(.equals(“3”)){Cidade.toUpperCase()
Object[] cidade = {“Cidade A”,“Cidade B”, “Cidade C”, “Cidade D”, “Cidade E”, “Cidade F”, “Cidade G”};String c = String.valueOf(JOptionPane.showInputDialog( null, "Escolha a cidade desejada", "Escolha", JOptionPane.QUESTION_MESSAGE,null, cidade, cidade[1])); System.out.println(c); }cont++; }while ((x==0)&&(cont<=7)); if(Cidade.toUpperCase().equals("")){ }
}
} -