Problem No. 1
Problem No. 1
Problem No. 1
Write a program that declares two integers and initializes them to 199 and 76.
Display the sum, difference, product, average, square and remainder of the values
Source Code:
End Sub
End Sub
End Sub
End Sub
End Sub
End Class
Problem no. 2
Write a program that computes the amount of money the computer club will receive
from the proceeds of their candy sales project. They sold 37 cases, which had 12
bars per case. The candy was sold for 0.75 per bar. Each case cost $5.00. They are
required to give the student government association 10% of their earnings. Display
their proceeds Formatted with currency.
Source Code:
Problem no. 4
Write a program that calculates the take home pay for an employee. The two types of
employees are salaried and hourly. Allow the user to input the employee type. If an
employee is salaried, allow the user to input the salary amount. If an employee is hourly,
allow the user to input the hourly rate and the numbers of hour clocked for the week. For
hourly employees, overtime is paid for hours over 40 at a rate of 1.5 of the base rate. For all
employees take home pay federal tax of 18% is deducted. A retirement contribution of 10%
and social security tax rate of 6% should be deducted. Use an appropriate constant.
Source Code:
End Sub
End Sub
End Class
A. Give at least 2 sample code using array.
Sometimes you have an array that needs to keep growing, and you don't know what
the upper bound will end up being. Maybe you are making a crappy MP3 player and need to
ask the user to input song names. You might do something like this:
Do
'Yes, so extend the array one element large than its current upper bound.
'Without the "Preserve" keyword below, the previous elements in our array would be
erased with the resizing
ReDim Preserve strSongNames(0 To UBound(strSongNames) + 1) As String
Else
End If
End If
MsgBox strSongNames(lngPosition)
Next lngPosition
'Erase array
Erase strSongName
Imports System.Console
Module Module1
Sub Main()
Dim sport(5) As String
'declaring an array
sport(0) = "Soccer"
sport(1) = "Cricket"
sport(2) = "Rugby"
sport(3) = "Aussie Rules"
sport(4) = "BasketBall"
sport(5) = "Hockey"
'storing values in the array
WriteLine("Name of the Sport in the third location" & " " & sport(2))
'displaying value from array
End Sub
End Module
1. Open the Add New Item dialog box by clicking Project and then clicking Add Class.
2. Set the Name property to Line and click OK.
You will now see a new file appear in your project and a code window within the Visual
Studio .NET environment. In the Code window, there will be some code that looks like this