Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- 'This is where i am declaring the variables and assigning data types to them variables
- Dim hoursworked As Integer
- Dim hourlypay As Decimal
- Dim grosspay As Decimal
- Dim choice As String
- Dim charityincome As Single
- '######################################################
- Sub Main()
- Do 'This is the beginning of my loop
- getinput() 'Calls upon my procedure where i get the inputs from the user
- calcwage() 'Calls upon the calculations from the input of the user
- displaywages() 'Outputs the calculation answers in a suitable display
- Loop Until choice = "no" 'This is the end of the loop of the user decideds to type no it will end
- End Sub
- '######################################################
- Sub getinput() 'This is the name of the procedure
- Console.WriteLine("Enter your hours worked") 'This is what will be displayer for the user
- hoursworked = Console.ReadLine() 'User input will be stored to this variable
- Console.WriteLine("Enter your hourly pay rate")
- hourlypay = Console.ReadLine()
- End Sub 'End subroutine
- '######################################################
- Sub calcwage() 'This is the name of the procedure
- grosspay = hoursworked * hourlypay 'The variable "grosspay" will be assigned to the calculation of the other two variables
- charityincome = (grosspay - 100) * 0.1
- End Sub
- '######################################################
- Sub displaywages() 'This is the name of the procedure
- Console.WriteLine("Your gross wage is £" & grosspay) 'This will be outputted at the end for the user to see
- If grosspay >= 100 Then 'Initiated the selection loop if it is more than or equal to 100 then it will procede to do the next task
- Console.WriteLine("Your charity donation is £" & charityincome) 'Will output this is "grosspay" is more than or equal to 100
- End If 'Ends the IF statement loop
- Console.WriteLine("Would you like to perform another calculation? Type 'yes' or 'no' ") 'Asks the user with an output if they want to continute
- choice = Console.ReadLine() 'The variable is assigned to the input answer of the user
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement