lunes, 17 de junio de 2013

Como Obtener El Promedio De Un Estudiante

En este programa necesitamos obtener el promedio de un estudiante a partir de sus tres notas parciales. 

Para obtener el promedio de cualquier dato simples, sabemos que es sumando todos los datos y dividiéndolo dentro del numero de datos sumados.

Espero que puedas entenderme y captarme muy bien !!! ...

Identificadores: Promedio (P), Primera Nota Parcial (N1), Segunda Nota Parcial (N2), Tercera Nota Parcial (N3).

Solución:

Module Module1
    Dim PrimerNotaP As Integer
    Dim SegNotaP As Integer
    Dim TerNotaP As Integer
    Dim P As String


    Sub Main()
        Console.WriteLine(" Ing Primer Nota Parcial ")
        PrimerNotaP = Console.ReadLine()
        Console.WriteLine(" Ing Segunda Nota Parcial ")
        SegNotaP = Console.ReadLine()
        Console.WriteLine(" Ing Tercer Nota Parcial ")
        TerNotaP = Console.ReadLine()
        P = (PrimerNotaP + SegNotaP + TerNotaP) / 3
        Console.WriteLine(" El Promedio es {0}", P)
        Console.ReadLine()


    End Sub

End Module

No hay comentarios:

Publicar un comentario