Bom Dia,
Não tenho experiência na linguagem Visual Basic, mais segue abaixo alguns tópicos do que pretendo fazer.
Cadastro de 1000 nadadores , dividindo-os por categoria: Infantil (de 3 a 12), juvenil (13 a 17) e adulto (18 a 24).
Classifica-los em um ranque com quantidades de Vitorias e Derrotas
Opção de correção de cadastro , se algo for digitado errado.
Um exemplo de algo que comecei a fazer :
Sub Main()
Nadadores()
Matricular()
End Sub
Private aluno(1000) As String
Private ranking(1000) As Integer
Private total, total_insc, total_mens As Double
Private resposta As String = "1"
Private mensagem As String = ""
Private cont As Integer =
Private cont_inf As Integer =
Private cont_juv As Integer =
Private cont_adul As Integer =
Sub Nadadores()
Dim nome, endereco, telefone As String
Dim nasc As String
Dim data_nasc As Date
Console.WriteLine("")
Console.WriteLine("")
Console.WriteLine("********************** NADADORES ************************")
Console.WriteLine("")
Console.WriteLine("")
Console.WriteLine("Preencha todos os campos.")
Console.Write("Nome: ")
nome = Console.ReadLine()
Console.Write("Endereco: ")
endereco = Console.ReadLine()
Console.Write("Telefone: ")
telefone = Console.ReadLine()
Console.Write("Data de nascimento (dd/mm/aaaa): ")
nasc = Console.ReadLine()
Try
data_nasc = Date.Parse(nasc)
Catch variavel As System.FormatException
Console.WriteLine("")
Console.WriteLine("ERRO!")
Console.WriteLine("O formato da data de nascimento deve ser dd/mm/aaaa.")
nasc = ""
End Try
If (nasc = "") Or (endereco = "") Or (telefone = "") Or (nome = "") Then
Console.WriteLine("")
If nome = "" Then
Console.Write("Nome: ")
nome = Console.ReadLine()
End If
If endereco = "" Then
Console.Write("Endereco: ")
endereco = Console.ReadLine()
End If
If telefone = "" Then
Console.Write("Telefone: ")
telefone = Console.ReadLine()
End If
If nasc = "" Then
Console.Write("Data de nascimento: (dd/mm/aaaa): ")
nasc = Console.ReadLine()
End If
End If
If (nome = "") Or (endereco = "") Or (telefone = "") Or (nasc = "") Then
nome = ""
endereco = ""
telefone = ""
nasc = ""
mensagem = "cancelada"
cont -= 1
Console.WriteLine("Inscricao " & mensagem & ".")
Else
aluno(cont) = nome
ranking(cont) =
cont += 1
End If
Matricular()
Console.WriteLine("")
End Sub
Sub Matricular()
Dim categoria, nome_esporte As String
Console.WriteLine("")
Console.WriteLine("*******************************************************************")
Console.WriteLine("********************* MATRICULA ***********************")
Console.WriteLine("*******************************************************************")
Console.WriteLine("")
If mensagem <> "" Then
Console.WriteLine("Por favor, cadastre o aluno.")
Else
nome_esporte = "Natacao"
Console.WriteLine("Desporto: " & nome_esporte)
Console.WriteLine("Categoria (escolha 1 , 2 ou 3):")
Console.WriteLine("1- Infantil 2- Juvenil 3- Adulto")
Console.Write("Digite a categoria: ")
categoria = Console.ReadLine()
If categoria = "1" Then
cont_inf += 1
ElseIf categoria = "2" Then
cont_juv += 1
ElseIf categoria = "3" Then
cont_adul += 1
Else
Console.WriteLine("Indique a categoria corretamente. Escolha 1, 2 ou 3.")
Console.WriteLine("So e possivel tentar mais 1 vez.")
Console.Write("Categoria: ")
categoria = Console.ReadLine()
If (categoria <> "1") And (categoria <> "2") And (categoria <> "3") Then
nome_esporte = ""
categoria = ""
mensagem = "cancelada"
Console.WriteLine("Inscricao " & mensagem & ".")
End If
End If
Pagar_insc()
End If
Console.WriteLine("")
End Sub
End Module