VB Exercise 5-10 - 5-10 is a variation of the old compound...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
5-10 is a variation of the old compound interest problem. Sue Starts out being paid 1 the first day. Her pay is doubled each day she works, 2 on day 2, 4 on day 3, etc. The exercise is to create an application to calculate her pay for any given number of days; but watch out it adds up fast. The second part of the exercise doesn’t just double her pay; but squares it. Start Program Code Imports Microsoft.VisualBasic.ControlChars 'MicroSoft VB Library Public Class Form1 Private Sub btnExit_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Me .Close() 'Stop program and close form1 End Sub Private Sub btnClear_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click lstResults.Items.Clear() End Sub Private Sub btnPay_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPay.Click Dim NumDays As Integer Dim Line As Double = 0 Dim count As Integer Dim X As Double = 0.01 Try NumDays = txtNumDays.Text If NumDays < 1 Then 'Catches the error if NumDays is less than one
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/09/2011 for the course COP 1332 taught by Professor Ryland during the Spring '11 term at American College of Computer & Information Sciences.

Page1 / 3

VB Exercise 5-10 - 5-10 is a variation of the old compound...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online