chamsi09

Untitled

Sep 5th, 2024
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.58 KB | None | 0 0
  1. Module MedicationDosageCalculator
  2.     Sub Main()
  3.         ' Input medication strength and patient weight
  4.         Console.Write("Enter medication strength per kg (mg): ")
  5.         Dim strengthPerKg As Single = Single.Parse(Console.ReadLine())
  6. Console.Write("Enter patient's weight (kg): ")
  7.         Dim weight As Double = Double.Parse(Console.ReadLine())
  8. ' Calculate total dosage
  9.         Dim totalDosage As Decimal = CDec(strengthPerKg * weight)
  10. ' Output formatted dosage
  11.         Console.WriteLine("Total medication dosage: " & totalDosage.ToString("F2") & " mg")
  12.     End Sub
  13. End Module
  14.  
Advertisement
Add Comment
Please, Sign In to add comment