Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I suppose to write a function in visual basic the receives three variables of type Double, representing the salary, bonus rate, and bonus amount, and

I suppose to write a function in visual basic the receives three variables of type Double, representing the salary, bonus rate, and bonus amount, and should calculate the bonus amount by multiplying the salary by the bonus rate. I wrote the function but I'm pretty sure it's wrong. Thanks in advance.

Public Class frmBonus Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click ' Variable declaration Dim Salary As Double = 5000 Dim BonusRate As Double = 0.075 Dim BonusAmount As Double CalculateBonus(Salary, BonusRate, BonusAmount) txtBonus.Text = BonusAmount.ToString("N2") End Sub Function CalculateBonus(Salary As Integer, BonusRate As Integer, BonusAmount As Integer) As Double Salary * BonusRate = BonusAmount Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click ' Close the form. Me.Close() End Sub 

End Class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Should there be an insanity defense?

Answered: 1 week ago

Question

To:al S 5-6.230 S40.cx SIN. J50

Answered: 1 week ago

Question

Describe the nature of negative messages.

Answered: 1 week ago