write vb code to calculate the number of dozens and number of eggs remaining from a total number of eggs
Module Module1
Sub Main()
'get the total number of eggs
Console.Write("Enter the total number of eggs: ")
Dim totalNumberEggs As Integer = Integer.Parse(Console.ReadLine())
Dim modValue As Integer = (totalNumberEggs Mod 12)
Dim numberDozens As Integer = (totalNumberEggs - modValue) / 12
'display the number of dozens
Console.WriteLine("The number of dozens: {0}", numberDozens)
'display the number of eggs remaining from a total number of eggs
Console.WriteLine("The number of eggs remaining from a total number of eggs: {0}", (totalNumberEggs - numberDozens * 12))
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment