1 / 3

Note: Number of Pounds Lost = ((200 * [cycle hrs] + 475 * [run hrs] + 275 * [swim hrs]) / 3500)

IS1102 Autumn Exam 2007.

mira
Download Presentation

Note: Number of Pounds Lost = ((200 * [cycle hrs] + 475 * [run hrs] + 275 * [swim hrs]) / 3500)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IS1102 Autumn Exam 2007 The number of calories burned per hour by cycling, jogging and swimming are 200, 475 and 275 respectively. A person loses 1pound of weight for each 3500 calories burned. Write a program that allows the user to input the numbers of hours spent at each activity and then calculate the number of pounds worked off. Note: Number of Pounds Lost = ((200 * [cycle hrs] + 475 * [run hrs] + 275 * [swim hrs]) / 3500)

  2. Private Sub cmdCompute_Click ‘declare the variables Dim sngCycling As Single, sngRunning AsSingle Dim sngSwimming As Single, sngPounds AsSingle picWtLoss.Cls ‘clears the picture box sngCycling = Val(txtCycle.Text) ‘assign the text… sngRunning = Val(txtRunning.Text) ‘property of the text-boxes… sngSwimming = Val(txtSwim.Text) ‘to the variables sngPounds = ((200 * sngCycling + 475 * sngRunning + 275 * sngSwimming) / 3500) picWtLoss.Print sngPounds; “pounds were lost.” End Sub

More Related