Answer to Question #185494 in Visual Basic for tafadzwa

Question #185494

Sue sells day old chicks after they hatch from eggs. She buys the eggs at a fixed cost of 11c per egg. She determined that she spends R1.10 on electricity and other costs per egg to hatch it. she needs a program to calculate the sales price of the chicks. she would like to make 15% profit per chick. Number of chicks 5 .The program must accept the number of chicks that a client wants and then calculate and display the sales price.


1
Expert's answer
2021-04-27T09:35:30-0400
Module Module1


    Sub Main()
        Const FIXED_COST_PER_EGG As Double = 0.11D
        Const ELECTRICITY_COST As Double = 1.1D
        Const PROFIT_PERCENT As Double = 0.15D
        'Read the the number of chicks
        Console.Write("Enter the the number of chicks: ")
        Dim numberChicks As Integer = Integer.Parse(Console.ReadLine())
        Dim spentMoney As Double = numberChicks * (FIXED_COST_PER_EGG + ELECTRICITY_COST)
        'calculate the sales price
        Dim salesPrice As Double = (spentMoney + spentMoney * PROFIT_PERCENT) / numberChicks
        'Display the sales price
        Console.WriteLine("The sales price: R" + salesPrice.ToString("N"))


        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