I had an interview yesterday, and I mention that I know *some* HTML. I have written a small sample program previously, and have played around with saving pages as txt documents, playing with them, and then running them as HTML files. They told me to send them some of my code. So, as response to this, I have decided to create the following program:
<!DOCTYPE HTML>
<html>
<body>
<h1>Welcome!</h1>
<p>This is my basic hello user program.</p>
<p>
I don't have much experience with HTML, but I can adapt.
I have, however, played around with HTML by saving pages in .txt format
(which shows HTML code), playing around with the code, and then saving it back as a webpage (to see its effect). It is also worth noting that this
program uses ActiveX controls.
<br> </br>
<a href = "http://cs.iupui.edu/~aharris">
This is the guy who taught me the bulk of my programming knowledge!
</a>
<br></br>
By the way, this is something I taught myself
</p>
<script>
var yourName = prompt("What is your name?");
alert ("Hello "+yourName);
var response = "";
var responses = new Array("good", "great", "excellent", "passing", "bad", "horrible", "terrible", "failing", "ok");
function loop_function(x)
{
//var x = 0;
while ((response != responses[x]) && (x < 4))
{
x++;
} //end while 1
while ((response != responses[x]) && (x < 8))
{
x++;
} //end while 2
} //end function
var y = 0;
while (response != responses[y])
{
var response = prompt("How did I do?");
response = response.toLowerCase();
loop_function(y);
alert("response == "+response);
alert("y == "+y);
} //end while
</script>
<pre>
<script>
//loop_function();
//No need to link this into a website: YOU HAVE TO GET A WEB ADDRESS! From there, you need to link this HTML into the personal website you obtained.
document.writeln("Michael Warren did "+ response); //writing your literal response to the page (if it does not contain "ing")
//document.write('\n');
//var x = 0;
loop_function();
//document.writeln("x == "+x);
</script>
<p>
You might want to screencap this and send it to me via email.
Again, my e-mail address is: miwarren@umail.iu.edu
</p>
<script>
if (y<4)
{
alert("Thanks!");
} //end if
else if ((y > 3)&&(y < 8))
{
alert("Thanks for your input. I will work harder.");
} //end else
</script>
</pre>
</body>
</html>
Sorry for posting the whole thing, but as I said, I am almost green-as-grass when it comes to HTML programming. However, I already know C, C++, Python, and Java. Unlike those, and because of the nature of this language (there might also be some Javascript in there...), there is no program for warning you of syntax errors. (Note to self, create one in the future...) The HTML file behaves unexpectedly in the
while (response != responses[y])loop: It acts as if loop_function has no idea what response and responses[] are! Did I neglect one of the rules of HTML programming, or is something else amiss?
Oh, that
alert("response == "+response);
alert("y == "+y);
was to see initially what was going on. Clearly, there must have been a problem as to either how I defined the function, where it was declared, or how I called the function. Or I may be totally wrong.

New Topic/Question
Reply


MultiQuote





|