an egg distributor has an application to calculate the number of dozens 2 and number of eggs remaining 6 from a total number of eggs 30
Module Module1
Sub Main()
Console.Write("Enter the number of eggs: ")
Dim totalEggs As Integer = Integer.Parse(Console.ReadLine())
Dim nDozens As Integer = (totalEggs - (totalEggs Mod 12)) / 12
Dim nEggsRemaining As Integer = (totalEggs - nDozens * 12)
Console.WriteLine("The number of dozens: {0}", nDozens)
Console.WriteLine("The number of eggs remaining: {0}", nEggsRemaining)
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment