abarnett 0 Newbie Poster

Alright here's the problem:

3. Fahrenheit to Centigrade calculation. Your F should start at 98 and go to 106, by an increment of .1. You will only have two columns, F and C

and our requirements:

Requirements for all programs
Each program will use a function to do the calculation (at least one calculation per program)
Each program will display the data in a list view control
Each program will print the data to an html file (copy and past the code to reuse it over and over)
Send me the executable
The program should ask for the name of the html file. Use an input box. Use concatenation to make the open string. When I run the exe, it will ask for the name of the file and I will enter something like “c:\test.html”. I can then open c:\test.html in Internet Explorer.


here's my code so far: (I'm probably wayyy off)

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        strUserInput = InputBox("Enter HTML file name", "Input Needed")
    End Sub

    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        lvTemp.Items.Clear()
        Dim temp As Double
        temp = getTemp()


    End Sub
    Function getTemp()


        Dim f As Double
        Dim c As Double
        lvTemp.Items.Clear()
        FileOpen(1, "b:\tempconversion.htm", OpenMode.Output)

        Print(1, "<html><head><title>Temp Table</title></head><body>")
        Print(1, "<table width =400 border = 1>") 'define table in html file
        Print(1, "<thead>")
        Print(1, "<th width = 400 >Fahrenheit</th>")
        Print(1, "<th width = 400 >Centigrade</th>")
        Print(1, "</thead>")

        For f = 98 To 106 Step 0.1
            c = (f - 32) * 5 / 9

        Next
        Print(1, "<tr><td align = center >")
        Print(1, f)
        Print(1, "</td>")

        Print(1, "<td align = center>")
        Print(1, c)
        Print(1, "</td>")
        Print(1, "</tr>") 'end of table row
        FileClose(1)


        Return 0

    End Function
End Class

any help would be appreciated - the program runs but the calculate button isn't working it doesn't print anything out???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.