a book store needs to calculate the price of an order from the book price and the number of books that were ordered .Add tax 15 % and a shipping charge of R 12.50 per book. The tax is calculated on the sum of the total book price and the shipping price. Book price R502.50 and number of books 3 .Display the order price
Module Module1
Sub Main()
'Read the the book price
Console.Write("Enter the book price: ")
Dim bookPrice As Double = Double.Parse(Console.ReadLine())
''Read the number of book
Console.Write("Enter the number of book: ")
Dim numberBook As Integer = Integer.Parse(Console.ReadLine())
Dim subTotal As Double = bookPrice * numberBook
'The tax is calculated on the sum of the total book price and the shipping price
'Add tax 15 % and a shipping charge of R 12.50 per book.
subTotal += numberBook * 12.5D
Dim tax As Double = subTotal * 0.15D
Dim orderPrice As Double = subTotal + tax
Console.WriteLine("Subtotal: R" + orderPrice.ToString("C"))
Console.WriteLine("Tax: R" + tax.ToString("C"))
Console.WriteLine("Order price: R" + orderPrice.ToString("C"))
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment