Programming Tasks: Apply all the things you have learned in this module. All program
should detect events like click on the buttons and keypress to detect inputs.
Task 1: Design and develop a program that will accept inputs like Name, Course and
Year Level. These inputs will be displayed in a message box after a button is clicked.
Task 2: Design and develop a program that will compute the take home amount for the
loanable amount of the customer. For example, if the customer’s loanable amount is
100,000.00 and has a 3% per annum interest. The company will deduct the interest for 5
years which is (15,000.00) to the loanable amount, so, the take home amount of the
customer is 85,000.00. Your program allows the user to input loanable amount and how
many years for the customer to pay the loan. Set the interest per annum to 3%.
Task 1:
Public Class Form1
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim info As String = "Name: " + txtName.Text + Environment.NewLine
info += "Course: " + txtCourse.Text + Environment.NewLine
info += "Year Level: " + txtYearLevel.Text + Environment.NewLine
MessageBox.Show(info)
End Sub
End Class
Task 2:
Imports System.IO
Module Module1
Sub Main()
'Set the interest per annum to 3%.
Const interestPerAnnum As Double = 0.03D
Console.Write("Enter loanable amount: ")
Dim loanableAmount As Double = Double.Parse(Console.ReadLine())
Console.Write("How many years for the customer to pay the loan?: ")
Dim years As Integer = Integer.Parse(Console.ReadLine())
Dim takeHomeAmount As Double = loanableAmount - (loanableAmount * (years * interestPerAnnum))
Console.WriteLine("The take home amount of the customer is : {0}", takeHomeAmount.ToString("C"))
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment