Answer to Question #187741 in Visual Basic for tafadzwa

Question #187741

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


1
Expert's answer
2021-05-02T11:07:18-0400
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS