www.webdeveloper.com
Results 1 to 5 of 5

Thread: generating a times table?

  1. #1
    Join Date
    Feb 2003
    Posts
    8

    generating a times table?

    Can anyone pls tell me how to do this:

    generate a times table for a particular number (0-12). You will want to validate that the input is 0-12. If it is not an alert, or some type of message, should appear requesting the correct input.
    the following files should be present:
    A form that will ask the user for input. This file should be named:
    times.htm
    the asp file will contain a loop that will write to the screen the following information:
    Times table for 4
    4X0= 0
    till
    4X12=48

    For validation of the users input you can validate in either your times.htm or calc_table.asp file. If you choose to validate in your ASP file use a subform
    After you dim your variables you will need to call your subform.


    I will really appreciate your help
    Thanks,
    Syma.

  2. #2
    Join Date
    Jan 2003
    Location
    Jersey Girl
    Posts
    1,198
    what's the name of the teacher that i should hand this in to?
    LOL!
    k

  3. #3
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Code:
    <%@LANGUAGE="VBSCRIPT"%>
    <html>
    <head>
    <title>Untitled Document</title>
    </head>
    
    <body>
    <%
    cal = request.form("cal")
    if cal = "" then
    %>
    <form action="/timetable.asp" method="post">
      <table width="90%" border="0" cellspacing="0" cellpadding="4">
        <tr>
          <td width="14%">Time table:</td>
          <td width="86%"><select name="multi" id="multi">
    <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
              <option value="5">5</option>
              <option value="6">6</option>
              <option value="7">7</option>
              <option value="8">8</option>
              <option value="9">9</option>
              <option value="10">10</option>
              <option value="11">11</option>
              <option value="12">12</option>
            </select></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Submit" value="Submit">
            <input name="cal" type="hidden" id="cal" value="yes"></td>
        </tr>
      </table>
    </form>
    <%
    else
    multi = request.form("multi")
    startat = 0
    endat = 12
    for i = startat to endat
    total = multi * i
    response.write multi & " X " & i & " = " & total & "<BR>"
    next
    %>
    <a href="/timetable.asp">again</a> 
    <%
    end if
    %>
    </body>
    </html>
    ----------------------------------

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Hi Guys/Girls,
    To answer you question Dave, yes I did at every opportunity to no avail. My school days were mainly spend somewhere else instead of being in classes. I was told to leave school when I was 16 and get a job and never got the opportunity to take any exams. Computers as a subject was nonexistent, our computer class have 20 BBC’s (I think that’s what they were called) and 4 RM nimbus PC’s for around 800 pupils.
    You are correct, I shouldn’t have handed the answer over so easily but I feel Syma still has a bit of work to do to get the code to comply with the assignment criteria, if it is an assignment and were aren’t jumping to conclusions. Anyway if you still feel it is morally wrong of me to help as much as I did then feel free to delete my post. And Taz please in future keep your tongue in your mouth and not sticking out at me. (joking, , lol)
    ----------------------------------

  5. #5
    Join Date
    Feb 2003
    Posts
    8
    It seems like I have generated quite a debate! yes, guys this is an assignment but only a small part of a larger project. Plus I was not asking anyone to hand me the solution on a silver platter. I needed some help and guidance which I thought was the purpose of this forum. We are allowed to seek help as this is an online course, hence the students are pretty much on their own as you cannot get the level of instruction as you can in an "in class" course.
    Its up to you to delete the post if you want, Dave and thanks a lot Ribeyed for trying to help me out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles