Semester 3 pog
BIN
Semester 1/Assignments/JavaScript/.DS_Store
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"directory": "public_html/bower_components"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/Gruntfile.js to edit this template
|
||||
*/
|
||||
module.exports = function (grunt) {
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
});
|
||||
};
|
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "Chapter3Examples",
|
||||
"version": "1.0.0",
|
||||
"main": "path/to/main.css",
|
||||
"ignore": [
|
||||
".jshintrc",
|
||||
"**/*.txt"
|
||||
],
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/gulpfile.js to edit this template
|
||||
*/
|
||||
|
||||
var gulp = require('gulp');
|
||||
|
||||
gulp.task('default', function () {
|
||||
// place code for your default task here
|
||||
});
|
@@ -0,0 +1,5 @@
|
||||
file.reference.Chapter3Examples-public_html=public_html
|
||||
file.reference.Chapter3Examples-test=test
|
||||
files.encoding=UTF-8
|
||||
site.root.folder=${file.reference.Chapter3Examples-public_html}
|
||||
test.folder=${file.reference.Chapter3Examples-test}
|
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.web.clientproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
|
||||
<name>Chapter3Examples</name>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "Chapter3Examples",
|
||||
"version": "1.0.0",
|
||||
"keywords": ["util", "functional", "server", "client", "browser"],
|
||||
"author": "caleb",
|
||||
"contributors": [],
|
||||
"dependencies": {}
|
||||
}
|
BIN
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/.DS_Store
vendored
Executable file
146
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/carla/carla.css
Executable file
@@ -0,0 +1,146 @@
|
||||
body {
|
||||
background-color: #FFFFFF;
|
||||
background-image: url(background.gif);
|
||||
color: #0000FF;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
#container { margin-left: auto;
|
||||
margin-right: auto;
|
||||
width:85%;
|
||||
min-width:700px;
|
||||
}
|
||||
|
||||
|
||||
#logo {
|
||||
text-align:center;
|
||||
margin: 0;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
}
|
||||
#nav {
|
||||
float: left;
|
||||
width: 200px;
|
||||
padding-top: 10px;
|
||||
text-align:left;
|
||||
color: #FF0000;
|
||||
font-size: 14px;
|
||||
}
|
||||
#nav a {
|
||||
text-decoration:none;
|
||||
margin: 15px;
|
||||
display: block;
|
||||
color: #FF0000;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#content {
|
||||
margin-left: 150px;
|
||||
padding: 30px;
|
||||
overflow:auto;
|
||||
border: medium groove #0000FF;
|
||||
line-height: 135%;
|
||||
|
||||
}
|
||||
|
||||
.floatright {padding-left:20px;
|
||||
float:right;
|
||||
}
|
||||
.floatleft {
|
||||
float:left;
|
||||
padding: 2px 30px 20px;
|
||||
}
|
||||
#footer {
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
text-align: justify;
|
||||
border-top: thin none;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
color: #FF0000;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2 { text-transform: uppercase;
|
||||
color: #0000FF;
|
||||
font-size: 36px;
|
||||
border-bottom: 1px none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
h3 {
|
||||
color: #0000FF;
|
||||
font-size: 1em;
|
||||
border-bottom: thin none;
|
||||
margin-right: auto;
|
||||
text-align: left;
|
||||
padding-top: 20px;
|
||||
padding-right: 150px;
|
||||
padding-bottom: 20px;
|
||||
padding-left: 150px;
|
||||
line-height: 130%;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-left-style: none;
|
||||
}
|
||||
.details { padding-left:20%;
|
||||
padding-right:20%;
|
||||
}
|
||||
|
||||
|
||||
img {border:0 none; }
|
||||
|
||||
|
||||
.content {
|
||||
margin: 20px;
|
||||
padding: 20px;
|
||||
height: 3700px;
|
||||
width: 500px;
|
||||
}
|
||||
a {
|
||||
color: #FF0000;
|
||||
text-decoration: none;
|
||||
margin: 15px;
|
||||
color: #FF0000;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #FFFF00;
|
||||
background-color: #0000FF;
|
||||
}
|
||||
h4 {
|
||||
line-height: 150%;
|
||||
margin-right: 20%;
|
||||
margin-left: 15%;
|
||||
text-align: center;
|
||||
}
|
||||
h1 {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 36pt;
|
||||
text-align: center;
|
||||
margin-right: 15%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
p {
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-size: 16px;
|
||||
line-height: 130%;
|
||||
font-weight: bold;
|
||||
color: #0000FF;
|
||||
}
|
||||
.flt_img {
|
||||
float: none;
|
||||
padding-top: 3px;
|
||||
padding-right: 20px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
specialh4 {
|
||||
line-height: 150%;
|
||||
margin-right: 20%;
|
||||
margin-left: 15%;
|
||||
text-align: center;
|
||||
}
|
@@ -0,0 +1,329 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Carla's Classroom | It All Adds Up</title>
|
||||
<link href="carla.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
|
||||
function addIt()
|
||||
{
|
||||
var num1a = 0;
|
||||
var num1b = 0;
|
||||
var sum1 = 0;
|
||||
var count1 = 0;
|
||||
var response = " ";
|
||||
var result = " ";
|
||||
levelOne();
|
||||
function levelOne()
|
||||
{
|
||||
//problem 1
|
||||
var num1a = (Math.floor(Math.random() * 10)) + 1;
|
||||
var num1b = (Math.floor(Math.random() * 10)) + 1;
|
||||
var sum1 = num1a + num1b;
|
||||
var response = parseInt(prompt("What is the sum of " + num1a + " and " + num1b + " ?"));
|
||||
if (response == sum1)
|
||||
{
|
||||
count1 = count1 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count1 == 3)
|
||||
{
|
||||
levelTwo();
|
||||
return;
|
||||
}
|
||||
//problem 2
|
||||
var num1a = (Math.floor(Math.random() * 10)) + 1;
|
||||
var num1b = (Math.floor(Math.random() * 10)) + 1;
|
||||
var sum1 = num1a + num1b;
|
||||
var response = parseInt(prompt("What is the sum of " + num1a + " and " + num1b + " ?"));
|
||||
if (response == sum1)
|
||||
{
|
||||
count1 = count1 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count1 == 3)
|
||||
{
|
||||
levelTwo();
|
||||
return;
|
||||
}
|
||||
//problem 3
|
||||
var num1a = (Math.floor(Math.random() * 10)) + 1;
|
||||
var num1b = (Math.floor(Math.random() * 10)) + 1;
|
||||
var sum1 = num1a + num1b;
|
||||
var response = parseInt(prompt("What is the sum of " + num1a + " and " + num1b + " ?"));
|
||||
if (response == sum1)
|
||||
{
|
||||
count1 = count1 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count1 == 3)
|
||||
{
|
||||
levelTwo();
|
||||
return;
|
||||
}
|
||||
//problem 4
|
||||
var num1a = (Math.floor(Math.random() * 10)) + 1;
|
||||
var num1b = (Math.floor(Math.random() * 10)) + 1;
|
||||
var sum1 = num1a + num1b;
|
||||
var response = parseInt(prompt("What is the sum of " + num1a + " and " + num1b + " ?"));
|
||||
if (response == sum1)
|
||||
{
|
||||
count1 = count1 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count1 == 3)
|
||||
{
|
||||
levelTwo();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("You need more practice at this level.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
function levelTwo()
|
||||
{
|
||||
var count2 = 0;
|
||||
alert("You're at Level Two");
|
||||
|
||||
//problem 1
|
||||
var num2a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num2b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum2 = num2a + num2b;
|
||||
var response = parseInt(prompt("What is the sum of " + num2a + " and " + num2b + " ?"));
|
||||
if (response == sum2)
|
||||
{
|
||||
count2 = count2 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count2 == 3)
|
||||
{
|
||||
levelThree();
|
||||
return;
|
||||
}
|
||||
//problem 2
|
||||
var num2a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num2b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum2 = num2a + num2b;
|
||||
var response = parseInt(prompt("What is the sum of " + num2a + " and " + num2b + " ?"));
|
||||
if (response == sum2)
|
||||
{
|
||||
count2 = count2 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count2 == 3)
|
||||
{
|
||||
levelThree();
|
||||
return;
|
||||
}
|
||||
//problem 3
|
||||
var num2a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num2b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum2 = num2a + num2b;
|
||||
var response = parseInt(prompt("What is the sum of " + num2a + " and " + num2b + " ?"));
|
||||
if (response == sum2)
|
||||
{
|
||||
count2 = count2 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count2 == 3)
|
||||
{
|
||||
levelThree();
|
||||
return;
|
||||
}
|
||||
//problem 4
|
||||
var num2a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num2b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum2 = num2a + num2b;
|
||||
var response = parseInt(prompt("What is the sum of " + num2a + " and " + num2b + " ?"));
|
||||
if (response == sum2)
|
||||
{
|
||||
count2 = count2 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count2 == 3)
|
||||
{
|
||||
levelThree();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("You need more practice at this level.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
function levelThree()
|
||||
{
|
||||
var count3 = 0;
|
||||
alert("You're at Level Three");
|
||||
|
||||
//problem 1
|
||||
var num3a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3c = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum3 = num3a + num3b + num3c;
|
||||
var response = parseInt(prompt("What is the sum of " + num3a + ", " + num3b + ", and " + num3c + " ?"));
|
||||
if (response == sum3)
|
||||
{
|
||||
count3 = count3 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count3 == 3)
|
||||
{
|
||||
alert("That's all, folks! Proceed to multiplication now!");
|
||||
return;
|
||||
}
|
||||
//problem 2
|
||||
var num3a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3c = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum3 = num3a + num3b + num3c;
|
||||
var response = parseInt(prompt("What is the sum of " + num3a + ", " + num3b + ", and " + num3c + " ?"));
|
||||
if (response == sum3)
|
||||
{
|
||||
count3 = count3 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count3 == 3)
|
||||
{
|
||||
alert("That's all, folks! Proceed to multiplication now!");
|
||||
return;
|
||||
}
|
||||
//problem 3
|
||||
var num3a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3c = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum3 = num3a + num3b + num3c;
|
||||
var response = parseInt(prompt("What is the sum of " + num3a + ", " + num3b + ", and " + num3c + " ?"));
|
||||
if (response == sum3)
|
||||
{
|
||||
count3 = count3 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count3 == 3)
|
||||
{
|
||||
alert("That's all, folks! Proceed to multiplication now!");
|
||||
return;
|
||||
}
|
||||
//problem 4
|
||||
var num3a = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3b = (Math.floor(Math.random() * 100)) + 1;
|
||||
var num3c = (Math.floor(Math.random() * 100)) + 1;
|
||||
var sum3 = num3a + num3b + num3c;
|
||||
var response = parseInt(prompt("What is the sum of " + num3a + ", " + num3b + ", and " + num3c + " ?"));
|
||||
if (response == sum3)
|
||||
{
|
||||
count3 = count3 + 1;
|
||||
result = "correct!";
|
||||
alert(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "incorrect";
|
||||
alert(result);
|
||||
}
|
||||
if (count3 == 3)
|
||||
{
|
||||
alert("That's all, folks! Proceed to multiplication now!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("That's all, folks! But you need more practice at this level.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<img src="images/arith_big.jpg" class="floatleft" />
|
||||
<h1 id="logo">It All Adds Up!</h1>
|
||||
<div style="clear:both;"></div>
|
||||
<div align="left">
|
||||
<blockquote>
|
||||
<p><a href="index.html"><img src="images/owl_button.jpg" width="50" height="50" />Home</a>
|
||||
<a href="carla.html"><img src="images/carla_button.jpg" width="50" height="65" />Meet Carla </a>
|
||||
<a href="reading.html"><img src="images/read_button.jpg" />Reading</a>
|
||||
<a href="writing.html"><img src="images/write_button.jpg" width="50" height="50" />Writing</a>
|
||||
<a href="math.html"><img src="images/arith_button.jpg" />Arithmetic</a>
|
||||
<br /></p></blockquote> </div>
|
||||
<div id="content">
|
||||
<p>This arithmetic test will increase in difficulty as you prove you are ready for harder problems.
|
||||
As soon as you get 3 problems correct in Level One, you will progress to Level Two and then to Level Three.</p>
|
||||
<p><input type="button" onclick="addIt()" value="begin the test" /> </p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer"> <h3>*Carla's Motto: Never miss a chance to teach -- and to learn!</h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Carla's Classroom | Math Lessons</title>
|
||||
<link href="carla.css" rel="stylesheet" type="text/css" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.style1 {font-size: 24px}
|
||||
.style2 {font-size: 18px}
|
||||
.style3 {
|
||||
color: #0000FF;
|
||||
font-size: 18px;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
<img src="images/owl_logo.JPG" class="floatleft" />
|
||||
<h1 id="logo"><em>Carla's Classroom</em></h1>
|
||||
<p> </p>
|
||||
<div style="clear:both;"></div>
|
||||
<div align="left">
|
||||
<blockquote>
|
||||
<a href="index.html"><img src="images/owl_button.jpg" />Home</a>
|
||||
<a href="carla.html"><img src="images/carla_button.jpg" width="50" height="65" />Meet Carla </a>
|
||||
<a href="reading.html"><img src="images/read_button.jpg" width="50" height="50" />Reading</a>
|
||||
<a href="writing.html"><img src="images/write_button.jpg" width="50" height="50" />Writing</a>
|
||||
<a href="math.html"><img src="images/arith_button.jpg" width="50" height="50" />Arithmetic</a>
|
||||
<br />
|
||||
</blockquote>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p><img src="images/carla_pic.jpg" width="83" height="108" class="floatleft" /> Arithmetic Lessons: </p>
|
||||
<p><a href="carla_adding.html">Addition Exercise</a>
|
||||
</div>
|
||||
<div id="footer"> <h3><span class="style1">*</span><span class="style3">Carla's Motto: </span><span class="style2">Never miss a chance to
|
||||
teach -- and to learn!</span></h3>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
31
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_10.html
Executable file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.10</title>
|
||||
<script>
|
||||
function rateIt()
|
||||
{
|
||||
var rate = parseInt(prompt("Rate the site from 1 to 10, with 10 as the best"," "));
|
||||
var grade = " "
|
||||
if (rate == 10)
|
||||
grade = "A";
|
||||
else if (rate >= 7 && rate <= 9)
|
||||
grade = "B";
|
||||
else if (rate >= 4 && rate < 7)
|
||||
grade = "C";
|
||||
else
|
||||
grade = "D";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Rate the Site</h1>
|
||||
<h3>Rate the site from 1 to 10, with 10 as the best ever and 1 as one of the worst</h3>
|
||||
<p><input type="button" id="rating" value="Enter your rating now" onclick="rateIt();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
44
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_11.html
Executable file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.11</title>
|
||||
<script>
|
||||
function rateIt()
|
||||
{
|
||||
var rate = parseInt(prompt("Rate the site from 1 to 10, with 10 as the best"," "));
|
||||
var grade = " "
|
||||
if (rate == 10)
|
||||
{
|
||||
grade = "A";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
}
|
||||
else if (rate >= 7 && rate <= 9)
|
||||
{
|
||||
grade = "B";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
}
|
||||
else if (rate >= 4 && rate < 7)
|
||||
{
|
||||
grade = "C";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
}
|
||||
else if (rate >= 1 && rate <4)
|
||||
{
|
||||
grade = "D";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
}
|
||||
else
|
||||
document.write("<p>Invalid entry</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Rate the Site</h1>
|
||||
<h3>Rate the site from 1 to 10, with 10 as the best ever and 1 as one of the worst</h3>
|
||||
<p><input type="button" id="rating" value="Enter your rating now" onclick="rateIt();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
BIN
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_12.gif
Executable file
After Width: | Height: | Size: 26 KiB |
62
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_12.html
Executable file
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.12</title>
|
||||
<script>
|
||||
function fightTroll()
|
||||
{
|
||||
var trollPoints = 50;
|
||||
var points = parseInt(prompt("How many points do you have?"," "));
|
||||
if (points < trollPoints)
|
||||
{
|
||||
var gun = prompt("Do you have a gun? (y/n)" , " ");
|
||||
if (gun == "n")
|
||||
var sword = prompt("Do you have a sword? (y/n)" , " ");
|
||||
if (gun == "n" && sword == "n")
|
||||
var wings = prompt("Do you have wings? (y/n)" , " ");
|
||||
if (wings == "n" && sword == "n" && gun == "n")
|
||||
var dust = prompt("Do you have flying dust? (y/n)" , " ");
|
||||
if (wings == "n" && sword == "n" && gun == "n" && dust == "n")
|
||||
{
|
||||
document.write("<h3>You lose... so sad</h3>");
|
||||
document.write("<img src = 'troll.jpg' />");
|
||||
}
|
||||
else if (gun == 'y' || sword == 'y')
|
||||
{
|
||||
document.write("<h3>You are the winner!</h3>");
|
||||
document.write("<img src = 'victor.jpg' />");
|
||||
}
|
||||
else if (dust == 'y' || wings == 'y')
|
||||
{
|
||||
document.write("<h3>You can fly away. The battle is a tie.</h3>");
|
||||
document.write("<img src = 'flyaway.jpg' />");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (points == trollPoints)
|
||||
{
|
||||
document.write("<h3>It's a tie.</h3>");
|
||||
document.write("<img src = 'victor.jpg' />");
|
||||
document.write("<img src = 'troll.jpg' />");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.write("<h3>You are the winner!</h3>");
|
||||
document.write("<img src = 'victor.jpg' />");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Battle With the Troll!</h1>
|
||||
<p><input type="button" id="battle" value="Push here to begin the battle" onclick="fightTroll();" /></p>
|
||||
</td></tr></table></body>
|
||||
|
||||
</html>
|
||||
|
41
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_13.html
Executable file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.13</title>
|
||||
<script>
|
||||
function pageColor()
|
||||
{
|
||||
var color = prompt("enter color ", " ");
|
||||
switch (color)
|
||||
{
|
||||
case "red":
|
||||
document.body.bgColor="red";
|
||||
break;
|
||||
case "green":
|
||||
document.body.bgColor="green";
|
||||
break;
|
||||
case "blue":
|
||||
document.body.bgColor="blue";
|
||||
break;
|
||||
case "yellow":
|
||||
document.body.bgColor="yellow";
|
||||
break;
|
||||
case "lavender":
|
||||
document.body.bgColor="lavender";
|
||||
break;
|
||||
default:
|
||||
document.write("Invalid entry");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Change the page color</h1>
|
||||
<p>Select from red, blue, green, yellow, or lavender.</p>
|
||||
<p><input type="button" id="color" value="Enter a color" onclick="pageColor();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
48
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_14.html
Executable file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.14</title>
|
||||
<script>
|
||||
function shapeShift()
|
||||
{
|
||||
var area = 0;
|
||||
var PI = 3.14159;
|
||||
var shape = prompt("What shape would you like to find the area of?", " ");
|
||||
switch (shape)
|
||||
{
|
||||
case "c":
|
||||
var radius = parseInt(prompt("What is the radius of the circle?", " "));
|
||||
area = PI * radius * radius;
|
||||
document.write("<p>The area of a circle with radius " + radius + " is " + area +"</p>");
|
||||
break;
|
||||
case "s":
|
||||
var side = parseInt(prompt("What is the length of one side of the square?", " "));
|
||||
area = side * side;
|
||||
document.write("<p>The area of a square with a side of " + side + " is " + area +"</p>");
|
||||
break;
|
||||
case "t":
|
||||
var base = parseInt(prompt("What is the length of the base of this triangle?", " "));
|
||||
var height = parseInt(prompt("What is the height of this triangle?", " "));
|
||||
area = 0.5 * base * height;
|
||||
document.write("<p>The area of a triangle with a base of " + base + " and a height of " + height + " is " + area +"</p>");
|
||||
break;
|
||||
default:
|
||||
document.write("Invalid entry");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Find the area of a shape</h1>
|
||||
<ul>
|
||||
<li> For a cirlce, enter c</li>
|
||||
<li> For a square, enter s</li>
|
||||
<li> For a triangle, enter t</li>
|
||||
</ul>
|
||||
<p><input type="button" id="shape" value="Begin calculation" onclick="shapeShift();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
49
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_15.html
Executable file
@@ -0,0 +1,49 @@
|
||||
500<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.15</title>
|
||||
<script>
|
||||
function rateIt()
|
||||
{
|
||||
var rate = parseInt(prompt("Rate the site from 1 to 10, with 10 as the best"," "));
|
||||
var grade = " "
|
||||
switch (rate)
|
||||
{
|
||||
case 10:
|
||||
grade = "A";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
break;
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
grade = "B";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
break;
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
grade = "C";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
break;
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
grade = "D";
|
||||
document.write("<p>You gave the site a rating of " + grade + ".</p>");
|
||||
break;
|
||||
default:
|
||||
document.write("<p>Invalid entry</p>");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Rate the Site</h1>
|
||||
<h3>Rate the site from 1 to 10, with 10 as the best ever and 1 as one of the worst</h3>
|
||||
<p><input type="button" id="rating" value="Enter your rating now" onclick="rateIt();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
31
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex3_9.html
Executable file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.9</title>
|
||||
<script>
|
||||
function paycheck()
|
||||
{
|
||||
var rate = parseInt(prompt("What is the employee's pay rate?"," "));
|
||||
var hours = parseInt(prompt("How many hours did the employee work this week?"," "));
|
||||
if (hours <= 40 || rate >= 20)
|
||||
var pay = rate * hours;
|
||||
else
|
||||
{
|
||||
var overtime = rate * 1.5 * (hours- 40);
|
||||
var regular = rate * 40;
|
||||
var pay = overtime + regular;
|
||||
}
|
||||
document.write("<p>Your paycheck this week will be $ " + pay + ".</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Calculating the Paycheck</h1>
|
||||
<h3>Click the button to calculate a paycheck with a compound condition</h3>
|
||||
<p><input type="button" id="paycheck" value="calculate the paycheck" onclick="paycheck();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
20
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_1.html
Executable file
@@ -0,0 +1,20 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.1</title>
|
||||
<script>
|
||||
function getTemp()
|
||||
{
|
||||
var temp = prompt("What's the temperature today?", "degrees Fahrenheit");
|
||||
if (temp < 32)
|
||||
{
|
||||
document.write("<p>It may snow today!</p>");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<h1>What's the Weather?</h1>
|
||||
<h3>Click the button! </h3>
|
||||
<p><input type="button" id="temperature" value="What is today's temperature?" onclick="getTemp();" /></p>
|
||||
</body>
|
||||
</html>
|
28
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_2.html
Executable file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.2</title>
|
||||
<script>
|
||||
function getTemp()
|
||||
{
|
||||
var temp = prompt("What's the temperature today?","degrees Fahrenheit");
|
||||
if (temp < 32)
|
||||
{
|
||||
document.write("<p>It may snow today!</p>");
|
||||
document.write("<p>Be sure to wear your boots and mittens.</p>");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.write("<p>It's too warm to snow today.</p>");
|
||||
document.write("<p>Boots are optional.</p>");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<h1>What's the Weather?</h1>
|
||||
<h3>Click the button! </h3>
|
||||
<p><input type="button" id="temperature" value="What is today's temperature?" onclick="getTemp();" /></p>
|
||||
</body>
|
||||
</html>
|
26
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_3.html
Executable file
@@ -0,0 +1,26 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.3</title>
|
||||
<script>
|
||||
function getTemp()
|
||||
{
|
||||
var temp = prompt("What's the temperature today?" , "degrees Fahrenheit");
|
||||
if (temp < 32)
|
||||
{
|
||||
document.write("<p>It may snow today!</p>");
|
||||
document.write("<p>Be sure to wear your boots and mittens.</p>");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.write("<p>It's too warm to snow today.</p>");
|
||||
document.write("<p>Boots are optional.</p>");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<h1>What's the Weather?</h1>
|
||||
<h3>Click the button! </h3>
|
||||
<p><input type="button" id="temperature" value="What is today's temperature?" onclick="getTemp();" /></p>
|
||||
</body>
|
||||
</html>
|
30
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_4.html
Executable file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.4</title>
|
||||
<script>
|
||||
function getScore()
|
||||
{
|
||||
var basicScore = parseInt(prompt("What was the student's initial score?"," "));
|
||||
var extraQuestion = prompt("Did the student do Q. 21 (yes or no)?"," ");
|
||||
if (extraQuestion == "yes")
|
||||
var points = parseInt(prompt("How many points did the student earn on Q. 21?"," "));
|
||||
else
|
||||
var points = parseInt(prompt("How many points did the student earn for a study guide?"," "));
|
||||
var score = basicScore + points;
|
||||
document.write("<h1> </h1>");
|
||||
document.write("<p> </p>");
|
||||
document.write("<p> The student's score, with any extra credit, is " + score + "%.</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Student Score</h1>
|
||||
<h3>Click the button! </h3>
|
||||
<p><input type="button" id="score" value="Enter the exam score?" onclick="getScore();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
45
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_5.html
Executable file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.5</title>
|
||||
<script>
|
||||
function getResult()
|
||||
{
|
||||
var x = parseInt(prompt("Enter x"," "));
|
||||
var y = parseInt(prompt("Enter y"," "));
|
||||
var add = prompt("Do you want to add the numbers (yes or no)?"," ");
|
||||
if (add == "yes")
|
||||
{
|
||||
var result = x + y;
|
||||
document.write("<p>I added the numbers " + x + " and " + y + ".</p>");
|
||||
document.write("<p>The result is " + result + ".</p>");
|
||||
}
|
||||
else
|
||||
{
|
||||
var subtracty = prompt("Do you want to subtract x from y (yes or no)?"," ");
|
||||
if (subtracty == "yes")
|
||||
{
|
||||
var result = y - x;
|
||||
document.write("<p>I subtracted " + x + " from " + y + ".</p>");
|
||||
document.write("<p>The result is " + result + ".</p>");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = x - y;
|
||||
document.write("<p>I subtracted " + y + " from " + x + ".</p>");
|
||||
document.write("<p>The result is " + result + ".</p>");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Add x and y or Subtract </h1>
|
||||
<h3>Click the button! </h3>
|
||||
<p><input type="button" id="numbers" value="Enter your numbers" onclick="getResult();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
31
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_6.html
Executable file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.6</title>
|
||||
<script>
|
||||
function paycheck()
|
||||
{
|
||||
var rate = parseInt(prompt("What is the employee's pay rate?"," "));
|
||||
var hours = parseInt(prompt("How many hours did the employee work this week?"," "));
|
||||
if (hours > 40 && rate < 20)
|
||||
{
|
||||
var overtime = rate * 1.5 * (hours- 40);
|
||||
var regular = rate * 40;
|
||||
var pay = overtime + regular;
|
||||
}
|
||||
else
|
||||
var pay = rate * hours;
|
||||
document.write("<p>Your paycheck this week will be $ " + pay + ".</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Calculating the Paycheck</h1>
|
||||
<h3>Click the button to calculate a paycheck with a compound condition</h3>
|
||||
<p><input type="button" id="paycheck" value="calculate the paycheck" onclick="paycheck();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
32
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_7.html
Executable file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.7</title>
|
||||
<script>
|
||||
function shipCost()
|
||||
{
|
||||
var price = parseInt(prompt("What is your merchandise total?"," "));
|
||||
if (price > 1.00 && price < 25.00)
|
||||
var ship = 5.00;
|
||||
if (price >= 25.00 && price < 50.00)
|
||||
var ship = 7.00;
|
||||
if (price >= 50.00 && price < 75.00)
|
||||
var ship = 9.00;
|
||||
if (price >= 75.00 && price < 100.00)
|
||||
var ship = 10.00;
|
||||
if (price >= 100.00)
|
||||
var ship = 0.00;
|
||||
document.write("<p>Your shipping cost will be $ " + ship + ".</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Calculating Shipping Costs</h1>
|
||||
<h3>Click the button to calculate your shipping cost</h3>
|
||||
<p><input type="button" id="ship" value="calculate your shipping charge" onclick="shipCost();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
33
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/ex_3_8.html
Executable file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.8</title>
|
||||
<script>
|
||||
function shipCost()
|
||||
{
|
||||
var coupon = prompt("Enter a coupon code if you have one: ", " ");
|
||||
var price = parseInt(prompt("What is your merchandise total?"," "));
|
||||
if (price > 1.00 && price < 25.00)
|
||||
var ship = 5.00;
|
||||
if (price >= 25.00 && price < 50.00)
|
||||
var ship = 7.00;
|
||||
if (price >= 50.00 && price < 75.00)
|
||||
var ship = 9.00;
|
||||
if (price >= 75.00 && price < 100.00)
|
||||
var ship = 10.00;
|
||||
if (price >= 100.00 || coupon == "FREESHIP")
|
||||
var ship = 0.00;
|
||||
document.write("<p>Your shipping cost will be $ " + ship + ".</p>");
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td>
|
||||
<h1> </h2>
|
||||
<h1>Calculating Shipping Costs</h1>
|
||||
<h3>Click the button to calculate your shipping cost</h3>
|
||||
<p><input type="button" id="ship" value="calculate your shipping charge" onclick="shipCost();" /></p>
|
||||
</td></tr></table></body>
|
||||
</html>
|
||||
|
BIN
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/flyaway.jpg
Executable file
After Width: | Height: | Size: 8.3 KiB |
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Greg's Gambits | About You</title>
|
||||
<link href="greg.css" rel="stylesheet" type="text/css" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<script>
|
||||
function get_name()
|
||||
{
|
||||
var name=prompt("Please enter your name"," ");
|
||||
document.getElementById('myname').innerHTML = name;
|
||||
}
|
||||
function get_username()
|
||||
{
|
||||
var username=prompt("What do you want for your username?"," ");
|
||||
document.getElementById('myusername').innerHTML = username;
|
||||
}
|
||||
function get_avatar()
|
||||
{
|
||||
window.open('avatars.html');
|
||||
}
|
||||
function pick_avatar()
|
||||
{
|
||||
var avatar = prompt("Enter the avatar you want","Bunny");
|
||||
document.getElementById('myavatar').innerHTML = avatar;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
<img src="images/superhero.jpg" width="120" height="120" class="floatleft" />
|
||||
<h1 id="logo"><em>Greg's Gambits </em></h1>
|
||||
|
||||
<h2 align="center"><em> TELL GREG ABOUT YOU</em></h2>
|
||||
|
||||
<p> </p>
|
||||
<div id="nav">
|
||||
<p><a href="index.html">Home</a>
|
||||
<a href="greg.html">About Greg</a>
|
||||
<a href="play_games.html">Play a Game</a>
|
||||
<a href="sign.html">Sign In</a>
|
||||
<a href="contact.html">Contact Us</a>
|
||||
<a href="aboutyou.html">Tell Greg About You</a></p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p><button type="button" onclick="get_name()">Enter your name </button>
|
||||
Hi there, <span id = "myname" >Greg</span> </p>
|
||||
<p><button type="button" onclick="get_username()">Enter a username </button>
|
||||
Username: <span id = "myusername">KingGreg</span> </p>
|
||||
<p><button type="button" onclick="get_avatar()">See the avatar choices</button>
|
||||
<p><button type="button" onclick="pick_avatar()">Select your avatar</button><br />
|
||||
The avatar you selected is: <span id = "myavatar">kitty</span> </p>
|
||||
<p> </p>
|
||||
</div>
|
||||
<p> </p>
|
||||
<div id="footer">
|
||||
<div align="center">Copyright © 2013 Greg's Gambits<br />
|
||||
<a href="mailto:gregory@gambits.net">gregory@gambits.net</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Greg's Gambits | Avatars</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table width = "90%" align="center" border= "0">
|
||||
<tr><td>
|
||||
<h1> </h1>
|
||||
<hr /><h2> Here are your avatar options: </h2>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<h3><hr /><img src="images/bunny.jpg" />Bunny
|
||||
<img src="images/elf.jpg" /> Elf
|
||||
<img src="images/ghost.jpg" />Ghost
|
||||
<img src="images/princess.jpg" /> Princess
|
||||
<img src="images/wizard.jpg" />Wizard <hr /></h3>
|
||||
</td></tr>
|
||||
<tr><td><h3>You will enter your selection on the previous page.</h3>
|
||||
</td></tr> </table>
|
||||
</body>
|
||||
</html>
|
119
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/greg/greg.css
Executable file
@@ -0,0 +1,119 @@
|
||||
body { background-color: #000040;
|
||||
background-image: url(background.gif);
|
||||
color: #88ffff;
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
}
|
||||
#container { margin-left: auto;
|
||||
margin-right: auto;
|
||||
width:80%;
|
||||
min-width:700px;
|
||||
}
|
||||
|
||||
|
||||
#logo {
|
||||
text-align:center;
|
||||
margin: 0;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
}
|
||||
#nav {
|
||||
float: left;
|
||||
width: 200px;
|
||||
padding-top: 10px;
|
||||
text-align:left;
|
||||
color: #88FFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
#nav a {text-decoration:none;
|
||||
margin: 15px;
|
||||
display: block;
|
||||
color: #88FFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
#content {
|
||||
margin-left: 150px;
|
||||
padding: 30px;
|
||||
overflow:auto;
|
||||
border: medium groove #88FFFF;
|
||||
line-height: 135%;
|
||||
|
||||
}
|
||||
|
||||
.floatright {padding-left:20px;
|
||||
float:right;
|
||||
}
|
||||
.floatleft {
|
||||
float:left;
|
||||
padding: 30px 0px 20px;
|
||||
}
|
||||
#footer { font-size: .60em;
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
border-top: 2px double #000040;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
h2 { text-transform: uppercase;
|
||||
color: #88ffff;
|
||||
font-size: 1.2em;
|
||||
border-bottom: 1px none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
h3 {
|
||||
color: #88ffff;
|
||||
font-size: 1em;
|
||||
border-bottom: 1px solid #000000;
|
||||
margin-right: auto;
|
||||
text-align: left;
|
||||
padding-top: 20px;
|
||||
padding-right: 150px;
|
||||
padding-bottom: 20px;
|
||||
padding-left: 150px;
|
||||
line-height: 130%;
|
||||
}
|
||||
.details { padding-left:20%;
|
||||
padding-right:20%;
|
||||
}
|
||||
|
||||
|
||||
img {border:0; }
|
||||
|
||||
|
||||
.content {
|
||||
margin: 20px;
|
||||
padding: 20px;
|
||||
height: 3700px;
|
||||
width: 500px;
|
||||
}
|
||||
a {text-decoration:none;
|
||||
margin: 15px;
|
||||
display: block;
|
||||
color: #88FFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
a:hover {
|
||||
color: #000040;
|
||||
background-color: #88ffff;
|
||||
}
|
||||
span {
|
||||
font-size: 36px;
|
||||
font-weight: bold;
|
||||
font-family: "Courier New", Courier, mono;
|
||||
color: #88ffff;
|
||||
background-position: center center;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse
|
||||
}
|
||||
td {
|
||||
border: 2px solid #88ffff;
|
||||
width: 5em;
|
||||
font-family: "Courier New", Courier, mono;
|
||||
font-size: 14px;
|
||||
color: #88ffff;
|
||||
}
|
@@ -0,0 +1,88 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<head>
|
||||
<title>Greg's Gambits | Madame Vadoma Sees All</title>
|
||||
<link href="greg.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
function startFortune()
|
||||
{
|
||||
var num = 0;
|
||||
var question = " ";
|
||||
var fortune1 = "Absolutely ";
|
||||
var fortune2 = "No way ";
|
||||
var fortune3 = "Probably";
|
||||
var fortune4 = "Doubtful";
|
||||
var fortune5 = "Could be";
|
||||
var fortune6 = "Madame Vadoma cannot answer such a question. ";
|
||||
var fortune7 = "You must find the answer within yourself. ";
|
||||
var fortune8 = "Yes, of course! ";
|
||||
var fortune9 = "You don't really believe this works, do you? ";
|
||||
var fortune10 = "Madame Vadoma wonders about that too. ";
|
||||
|
||||
num = (Math.floor(Math.random() * 10)) + 1;
|
||||
question = prompt("What is your question? ", " ");
|
||||
switch(num)
|
||||
{
|
||||
case 1:
|
||||
document.getElementById("content").innerHTML = fortune1;
|
||||
break;
|
||||
case 2:
|
||||
document.getElementById("content").innerHTML = fortune2;
|
||||
break;
|
||||
case 3:
|
||||
document.getElementById("content").innerHTML = fortune3;
|
||||
break;
|
||||
case 4:
|
||||
document.getElementById("content").innerHTML = fortune4;
|
||||
break;
|
||||
case 5:
|
||||
document.getElementById("content").innerHTML = fortune5;
|
||||
break;
|
||||
case 6:
|
||||
document.getElementById("content").innerHTML = fortune6;
|
||||
break;
|
||||
case 7:
|
||||
document.getElementById("content").innerHTML = fortune7;
|
||||
break;
|
||||
case 8:
|
||||
document.getElementById("content").innerHTML = fortune8;
|
||||
break;
|
||||
case 9:
|
||||
document.getElementById("content").innerHTML = fortune9;
|
||||
break;
|
||||
case 10:
|
||||
document.getElementById("content").innerHTML = fortune10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
<img src="images/superhero.jpg" width="120" height="120" class="floatleft" />
|
||||
<h1 id="logo"><em>Madame Vadoma Sees All!</em></h1>
|
||||
|
||||
<h2 align="center">Ask Madame Vadoma anything that you are worried about </h2>
|
||||
|
||||
<p> </p>
|
||||
<div id="nav">
|
||||
<p><a href="index.html">Home</a>
|
||||
<a href="greg.html">About Greg</a>
|
||||
<a href="play_games.html">Play a Game</a>
|
||||
<a href="sign.html">Sign In</a>
|
||||
<a href="contact.html">Contact Us</a></p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p class="floatright">Madame Vadoma<br /><br />
|
||||
<img src ="images/madame.jpg" /></p>
|
||||
<p> </p>
|
||||
<p><input type="button" value = "Ask your question" onclick="startFortune();" /></p>
|
||||
<p> </p>
|
||||
</div>
|
||||
<div id="footer">Copyright © 2013 Greg's Gambits<br />
|
||||
<a href="mailto:yourfirstname@yourlastname.com">yourfirstname@yourlastname.com</a></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/greg/images/.DS_Store
vendored
Normal file
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 3.9 KiB |
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Greg's Gambits</title>
|
||||
<link href="greg.css" rel="stylesheet" type="text/css" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
<img src="images/superhero.jpg" width="120" height="120" class="floatleft" />
|
||||
<h1 id="logo"><em>Greg's Gambits </em></h1>
|
||||
|
||||
<h2 align="center"><em> Games for Everyone!</em></h2>
|
||||
|
||||
<p> </p>
|
||||
<div id="nav">
|
||||
<p><a href="index.html">Home</a>
|
||||
<a href="greg.html">About Greg</a>
|
||||
<a href="play_games.html">Play a Game</a>
|
||||
<a href="sign.html">Sign In</a>
|
||||
<a href="contact.html">Contact Us</a>
|
||||
<a href="aboutyou.html">Tell Greg About You</a></p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p>Greg's Gambits offers a variety of games for all ages and more are added all the time. You can play our games any time you want for free.</p>
|
||||
<p>Meet the real-life Greg in the About Greg page. Sign up to keep your account active or sign in every time you return through our Sign Up link. Choose your game from the Play a Game menu and contact us with questions, comments, and ideas. We're always looking for new games and new ideas!</p>
|
||||
<p> </p>
|
||||
</div>
|
||||
<div id="footer">Copyright © 2013 Greg's Gambits<br />
|
||||
<a href="mailto:gregory@gambits.net">gregory@gambits.net</a></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Greg's Gambits | Games Menu</title>
|
||||
<link href="greg.css" rel="stylesheet" type="text/css" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
<img src="../images/superhero.jpg" width="120" height="120" class="floatleft" />
|
||||
<h1 id="logo"><em>Play A Game</em></h1>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<div id="nav">
|
||||
<p><a href="index.html">Home</a>
|
||||
<a href="greg.html">About Greg</a>
|
||||
<a href="play_games.html">Play a Game</a>
|
||||
<a href="sign.html">Sign In</a>
|
||||
<a href="contact.html">Contact Us</a></p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p>Menu of Available Games </p>
|
||||
<table width="90%" border="0" cellpadding="5">
|
||||
<tr>
|
||||
<td width="50%"><a href="greg_tales.html">Greg's Tales</a> </td>
|
||||
<td width="50%"><a href ="gregs_fortune.html">Madame Vadoma Sees All</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="50%"> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<p> </p>
|
||||
</div>
|
||||
<div id="footer">Copyright © 2013 Greg's Gambits<br />
|
||||
<a href="mailto:yourfirstname@yourlastname.com">yourfirstname@yourlastname.com</a></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/troll.jpg
Executable file
After Width: | Height: | Size: 8.4 KiB |
BIN
Semester 1/Assignments/JavaScript/Chapter3Examples/public_html/victor.jpg
Executable file
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. --><project name="JavaFXApplication1" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
|
||||
<description>Builds, tests, and runs the project JavaFXApplication1.</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. Those of them relevant for JavaFX project are:
|
||||
|
||||
-pre-init: called before initialization of project properties
|
||||
-post-init: called after initialization of project properties
|
||||
-pre-compile: called before javac compilation
|
||||
-post-compile: called after javac compilation
|
||||
-pre-compile-test: called before javac compilation of JUnit tests
|
||||
-post-compile-test: called after javac compilation of JUnit tests
|
||||
-pre-jfx-jar: called before FX SDK specific <fx:jar> task
|
||||
-post-jfx-jar: called after FX SDK specific <fx:jar> task
|
||||
-pre-jfx-deploy: called before FX SDK specific <fx:deploy> task
|
||||
-post-jfx-deploy: called after FX SDK specific <fx:deploy> task
|
||||
-pre-jfx-native: called just after -pre-jfx-deploy if <fx:deploy> runs in native packaging mode
|
||||
-post-jfx-native: called just after -post-jfx-deploy if <fx:deploy> runs in native packaging mode
|
||||
-post-clean: called after cleaning build products
|
||||
|
||||
(Targets beginning with '-' are not intended to be called on their own.)
|
||||
|
||||
Example of inserting a HTML postprocessor after javaFX SDK deployment:
|
||||
|
||||
<target name="-post-jfx-deploy">
|
||||
<basename property="jfx.deployment.base" file="${jfx.deployment.jar}" suffix=".jar"/>
|
||||
<property name="jfx.deployment.html" location="${jfx.deployment.dir}${file.separator}${jfx.deployment.base}.html"/>
|
||||
<custompostprocess>
|
||||
<fileset dir="${jfx.deployment.html}"/>
|
||||
</custompostprocess>
|
||||
</target>
|
||||
|
||||
Example of calling an Ant task from JavaFX SDK. Note that access to JavaFX SDK Ant tasks must be
|
||||
initialized; to ensure this is done add the dependence on -check-jfx-sdk-version target:
|
||||
|
||||
<target name="-post-jfx-jar" depends="-check-jfx-sdk-version">
|
||||
<echo message="Calling jar task from JavaFX SDK"/>
|
||||
<fx:jar ...>
|
||||
...
|
||||
</fx:jar>
|
||||
</target>
|
||||
|
||||
For more details about JavaFX SDK Ant tasks go to
|
||||
http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm
|
||||
|
||||
For list of available properties check the files
|
||||
nbproject/build-impl.xml and nbproject/jfx-impl.xml.
|
||||
|
||||
-->
|
||||
</project>
|
@@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
|
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Run as WebStart
|
@@ -0,0 +1,2 @@
|
||||
# Do not modify this property in this configuration. It can be re-generated.
|
||||
$label=Run in Browser
|
@@ -0,0 +1,8 @@
|
||||
build.xml.data.CRC32=19a3a13e
|
||||
build.xml.script.CRC32=e354da3e
|
||||
build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=19a3a13e
|
||||
nbproject/build-impl.xml.script.CRC32=6c0e2539
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48
|
@@ -0,0 +1,120 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
application.title=JavaFXApplication1
|
||||
application.vendor=caleb
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
compile.on.save=true
|
||||
compile.on.save.unsupported.javafx=true
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/JavaFXApplication1.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
endorsed.classpath=
|
||||
excludes=
|
||||
includes=**
|
||||
# Non-JavaFX jar file creation is deactivated in JavaFX 2.0+ projects
|
||||
jar.archive.disabled=true
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=1.8
|
||||
javac.target=1.8
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
javafx.application.implementation.version=1.0
|
||||
javafx.binarycss=false
|
||||
javafx.deploy.allowoffline=true
|
||||
# If true, application update mode is set to 'background', if false, update mode is set to 'eager'
|
||||
javafx.deploy.backgroundupdate=false
|
||||
javafx.deploy.embedJNLP=true
|
||||
javafx.deploy.includeDT=true
|
||||
# Set true to prevent creation of temporary copy of deployment artifacts before each run (disables concurrent runs)
|
||||
javafx.disable.concurrent.runs=false
|
||||
# Set true to enable multiple concurrent runs of the same WebStart or Run-in-Browser project
|
||||
javafx.enable.concurrent.external.runs=false
|
||||
# This is a JavaFX project
|
||||
javafx.enabled=true
|
||||
javafx.fallback.class=com.javafx.main.NoJavaFXFallback
|
||||
# Main class for JavaFX
|
||||
javafx.main.class=javafxapplication1.JavaFXApplication1
|
||||
javafx.preloader.class=
|
||||
# This project does not use Preloader
|
||||
javafx.preloader.enabled=false
|
||||
javafx.preloader.jar.filename=
|
||||
javafx.preloader.jar.path=
|
||||
javafx.preloader.project.path=
|
||||
javafx.preloader.type=none
|
||||
# Set true for GlassFish only. Rebases manifest classpaths of JARs in lib dir. Not usable with signed JARs.
|
||||
javafx.rebase.libs=false
|
||||
javafx.run.height=600
|
||||
javafx.run.width=800
|
||||
# Pre-JavaFX 2.0 WebStart is deactivated in JavaFX 2.0+ projects
|
||||
jnlp.enabled=false
|
||||
# Main class for Java launcher
|
||||
main.class=com.javafx.main.Main
|
||||
# For improved security specify narrower Codebase manifest attribute to prevent RIAs from being repurposed
|
||||
manifest.custom.codebase=*
|
||||
# Specify Permissions manifest attribute to override default (choices: sandbox, all-permissions)
|
||||
manifest.custom.permissions=
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
platform.active=JDK_1.8
|
||||
run.classpath=\
|
||||
${dist.jar}:\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.java.j2seproject</type>
|
||||
<configuration>
|
||||
<buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">
|
||||
<extension file="jfx-impl.xml" id="jfx3">
|
||||
<dependency dependsOn="-jfx-copylibs" target="-post-jar"/>
|
||||
<dependency dependsOn="-rebase-libs" target="-post-jar"/>
|
||||
<dependency dependsOn="jfx-deployment" target="-post-jar"/>
|
||||
<dependency dependsOn="jar" target="debug"/>
|
||||
<dependency dependsOn="jar" target="profile"/>
|
||||
<dependency dependsOn="jar" target="run"/>
|
||||
</extension>
|
||||
</buildExtensions>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
|
||||
<name>JavaFXApplication1</name>
|
||||
<explicit-platform explicit-source-supported="true"/>
|
||||
<source-roots>
|
||||
<root id="src.dir"/>
|
||||
</source-roots>
|
||||
<test-roots>
|
||||
<root id="test.src.dir"/>
|
||||
</test-roots>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/javafx/FXMain.java to edit this template
|
||||
*/
|
||||
package javafxapplication1;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class JavaFXApplication1 extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage)
|
||||
{
|
||||
Button btn = new Button();
|
||||
btn.setText("Say 'Hello World'");
|
||||
Button btn2 = new Button();
|
||||
btn2.setText("I'm a new button");
|
||||
btn2.al
|
||||
btn2.setLayoutY(250);
|
||||
btn.setOnAction(new EventHandler<ActionEvent>() {
|
||||
@Override
|
||||
public void handle(ActionEvent event)
|
||||
{
|
||||
System.out.println("Hello World!");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
StackPane root = new StackPane();
|
||||
root.getChildren().add(btn);
|
||||
root.getChildren().add(btn2);
|
||||
|
||||
Scene scene = new Scene(root, 500, 250);
|
||||
|
||||
primaryStage.setTitle("Hello World!");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
launch(args);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
package javafxapplication1;
|
||||
|
||||
import javafx.application.Application;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author caleb
|
||||
*/
|
||||
public class Test1 extends Application{
|
||||
|
||||
}
|
3
Semester 1/Assignments/JavaScript/JavaScript_1/.bowerrc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"directory": "public_html/bower_components"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/Gruntfile.js to edit this template
|
||||
*/
|
||||
module.exports = function (grunt) {
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
});
|
||||
};
|
13
Semester 1/Assignments/JavaScript/JavaScript_1/bower.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "JavaScript_1",
|
||||
"version": "1.0.0",
|
||||
"main": "path/to/main.css",
|
||||
"ignore": [
|
||||
".jshintrc",
|
||||
"**/*.txt"
|
||||
],
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
}
|
10
Semester 1/Assignments/JavaScript/JavaScript_1/gulpfile.js
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/gulpfile.js to edit this template
|
||||
*/
|
||||
|
||||
var gulp = require('gulp');
|
||||
|
||||
gulp.task('default', function () {
|
||||
// place code for your default task here
|
||||
});
|
@@ -0,0 +1 @@
|
||||
browser=SL[/Browsers/FirefoxBrowser
|
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||
<group/>
|
||||
</open-files>
|
||||
</project-private>
|
@@ -0,0 +1,5 @@
|
||||
file.reference.JavaScript_1-public_html=public_html
|
||||
file.reference.JavaScript_1-test=test
|
||||
files.encoding=UTF-8
|
||||
site.root.folder=${file.reference.JavaScript_1-public_html}
|
||||
test.folder=${file.reference.JavaScript_1-test}
|
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.web.clientproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
|
||||
<name>JavaScript_1</name>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "JavaScript_1",
|
||||
"version": "1.0.0",
|
||||
"keywords": ["util", "functional", "server", "client", "browser"],
|
||||
"author": "caleb",
|
||||
"contributors": [],
|
||||
"dependencies": {}
|
||||
}
|
BIN
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/carla/.DS_Store
vendored
Executable file
142
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/carla/carla.css
Executable file
@@ -0,0 +1,142 @@
|
||||
body {
|
||||
background-color: #FFFFFF;
|
||||
background-image: url(background.gif);
|
||||
color: #0000FF;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
#container { margin-left: auto;
|
||||
margin-right: auto;
|
||||
width:90%;
|
||||
min-width:700px;
|
||||
}
|
||||
|
||||
|
||||
#logo {
|
||||
text-align:center;
|
||||
margin: 0;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
}
|
||||
#nav {
|
||||
float: left;
|
||||
width: 200px;
|
||||
padding-top: 10px;
|
||||
text-align:left;
|
||||
color: #FF0000;
|
||||
font-size: 14px;
|
||||
}
|
||||
#nav a {
|
||||
text-decoration:none;
|
||||
margin: 15px;
|
||||
display: block;
|
||||
color: #FF0000;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
#content {
|
||||
margin-left: 150px;
|
||||
padding: 30px;
|
||||
overflow:auto;
|
||||
border: medium groove #0000FF;
|
||||
line-height: 135%;
|
||||
|
||||
}
|
||||
|
||||
.floatright {padding-left:20px;
|
||||
float:right;
|
||||
}
|
||||
.floatleft {
|
||||
float:left;
|
||||
padding: 2px 30px 20px;
|
||||
}
|
||||
#footer {
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
text-align: justify;
|
||||
border-top: thin none;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
color: #FF0000;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2 { text-transform: uppercase;
|
||||
color: #0000FF;
|
||||
font-size: 36px;
|
||||
border-bottom: 1px none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
h3 {
|
||||
color: #0000FF;
|
||||
font-size: 1em;
|
||||
border-bottom: thin none;
|
||||
margin-right: auto;
|
||||
text-align: left;
|
||||
padding-right: 150px;
|
||||
padding-bottom: 20px;
|
||||
padding-left: 150px;
|
||||
line-height: 130%;
|
||||
border-top-style: none;
|
||||
border-right-style: none;
|
||||
border-left-style: none;
|
||||
}
|
||||
.details { padding-left:20%;
|
||||
padding-right:20%;
|
||||
}
|
||||
img {border:0 none; }
|
||||
|
||||
.content {
|
||||
margin: 20px;
|
||||
padding: 20px;
|
||||
height: 3700px;
|
||||
width: 500px;
|
||||
}
|
||||
a {
|
||||
color: #FF0000;
|
||||
text-decoration: none;
|
||||
margin: 15px;
|
||||
color: #FF0000;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
a:hover {
|
||||
color: #FFFF00;
|
||||
background-color: #0000FF;
|
||||
}
|
||||
h4 {
|
||||
line-height: 150%;
|
||||
margin-right: 20%;
|
||||
margin-left: 15%;
|
||||
text-align: center;
|
||||
}
|
||||
h1 {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 36pt;
|
||||
text-align: center;
|
||||
margin-right: 15%;
|
||||
margin-left: 20%;
|
||||
}
|
||||
p {
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-size: 16px;
|
||||
line-height: 130%;
|
||||
font-weight: bold;
|
||||
color: #0000FF;
|
||||
}
|
||||
.flt_img {
|
||||
float: none;
|
||||
padding-top: 3px;
|
||||
padding-right: 20px;
|
||||
padding-bottom: 3px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
specialh4 {
|
||||
line-height: 150%;
|
||||
margin-right: 20%;
|
||||
margin-left: 15%;
|
||||
text-align: center;
|
||||
}
|
@@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Carla's Classroom | An Appetite for Spelling</title>
|
||||
<link href="carla.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
//declare and initialize variables
|
||||
var word1 = "avocado";
|
||||
var word2 = "bananas";
|
||||
var word3 = "celery";
|
||||
var word4 = "lemonade";
|
||||
var word5 = "onions";
|
||||
var result = " ";
|
||||
// Question 1
|
||||
function show_prompt1()
|
||||
{
|
||||
word1 = prompt("Enter your answer");
|
||||
result = (word1 == "avocado")? "You're right!" : "Sorry, that's incorrect";
|
||||
}
|
||||
function show_result1()
|
||||
{ alert(result); }
|
||||
//Question 2
|
||||
function show_prompt2()
|
||||
{
|
||||
word2 = prompt("Enter your answer");
|
||||
result = (word2 == "bananas")? "You're right!" : "Sorry, that's incorrect";
|
||||
}
|
||||
function show_result2()
|
||||
{ alert(result); }
|
||||
//Question 3
|
||||
function show_prompt3()
|
||||
{
|
||||
word3 = prompt("Enter your answer");
|
||||
result = (word3 == "celery")? "You're right!" : "Sorry, that's incorrect";
|
||||
}
|
||||
function show_result3()
|
||||
{ alert(result); }
|
||||
//Question 4
|
||||
function show_prompt4()
|
||||
{
|
||||
word4 = prompt("Enter your answer");
|
||||
result = (word4 == "lemonade")? "You're right!" : "Sorry,that's incorrect";
|
||||
}
|
||||
function show_result4()
|
||||
{ alert(result); }
|
||||
//Question 5
|
||||
function show_prompt5()
|
||||
{
|
||||
word5 = prompt("Enter your answer");
|
||||
result = (word5 == "onions")? "You're right!" : "Sorry, that's incorrect";
|
||||
}
|
||||
function show_result5()
|
||||
{ alert(result); }
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<img src="images/writing_big.jpg" class="floatleft" />
|
||||
<h1 id="logo"><em>An Appetite for Spelling </em></h1>
|
||||
<div align="left">
|
||||
<blockquote>
|
||||
<p><a href="index.html"><img src="images/owl_button.jpg" width="50" height="50" />Home</a>
|
||||
<a href="carla.html"><img src="images/carla_button.jpg" width="50" height="65" />Meet Carla </a>
|
||||
<a href="reading.html"><img src="images/read_button.jpg" />Reading</a>
|
||||
<a href="writing.html"><img src="images/write_button.jpg" width="50" height="50" />Writing</a>
|
||||
<a href="math.html"><img src="images/arith_button.jpg" />Arithmetic</a>
|
||||
<br /></p></blockquote> </div>
|
||||
<div id="content">
|
||||
<p>For this exercise you will be shown some pictures and, for each picture you will be asked to spell the word that describes the picture. Type your answers in all lowercase letters. </p>
|
||||
<p>Question 1: What is this? <img src="images/avocado.jpg" width="100" height="67" /></p>
|
||||
<input type="button" onclick="show_prompt1()" value="answer Q. 1" />
|
||||
<input type="button" onclick="show_result1()" value="check answer" />
|
||||
<p>Question 2: What's this? <img src="images/bananas.jpg" width="100" height="110" border="0"></p>
|
||||
<input type="button" onclick="show_prompt2()" value="answer Q. 2" />
|
||||
<input type="button" onclick="show_result2()" value="check answer" />
|
||||
<p>Question 3: What's this? <img src="images/celery.jpg" border="0"> </p>
|
||||
<input type="button" onclick="show_prompt3()" value="answer Q. 3" />
|
||||
<input type="button" onclick="show_result3()" value="check answer" />
|
||||
<p>Question 4: What's this? <img src="images/lemonade.jpg" width="100" height="93" border="0"> </p>
|
||||
<input type="button" onclick="show_prompt4()" value="answer Q. 4" />
|
||||
<input type="button" onclick="show_result4()" value="check answer" />
|
||||
<p>Question 5: What's this? <img src="images/onions.jpg" width="100" height="72" border="0"></p>
|
||||
<input type="button" onclick="show_prompt5()" value="answer Q. 5" />
|
||||
<input type="button" onclick="show_result5()" value="check answer" />
|
||||
</div>
|
||||
<div id="footer"> <h3>*Carla's Motto: Never miss a chance to teach -- and to learn!</h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 8.0 KiB |
15
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/ex_2_11.html
Executable file
@@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 2.11</title>
|
||||
<script type="text/javascript">
|
||||
var first = prompt("Enter your first name:", " ");
|
||||
var middle = prompt("Enter your middle initial:", " ");
|
||||
var last = prompt("Enter your last name:", " ");
|
||||
document.write(first + "." + middle + "." + last + "<br />");
|
||||
document.write(first + " " + middle + ". " + last);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p> </p>
|
||||
</body>
|
||||
</html>
|
14
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/ex_2_12.html
Executable file
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 2.12</title>
|
||||
<script type="text/javascript">
|
||||
var num = prompt("Enter a number:", 0);
|
||||
document.write(num + 2 + "<br />");
|
||||
document.write((parseInt(num) + 2) + "<br />");
|
||||
document.write((num * 3) + "<br />");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p> </p>
|
||||
</body>
|
||||
</html>
|
14
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/ex_2_13.html
Executable file
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 2.13</title>
|
||||
<script type="text/javascript">
|
||||
var num = prompt("Enter a number:", 0);
|
||||
document.write("parseInt(): "+ parseInt(num)+"<br />");
|
||||
document.write("parseFloat(): " + (parseFloat(num)) + "<br />");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p> </p>
|
||||
</body>
|
||||
</html>
|
15
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/ex_2_16.html
Executable file
@@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 2.16</title>
|
||||
<script type="text/javascript">
|
||||
var yourNumber = 8;
|
||||
var myNumber = 7;
|
||||
var answer = myNumber + yourNumber;
|
||||
document.write("the value of 'answer' is: " + answer + "<br />");
|
||||
document.write("the value of 'answer > mynumber' is: " + (answer > myNumber) + "<br />");
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
|
17
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/ex_2_22.html
Executable file
@@ -0,0 +1,17 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 2.22</title>
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
var shipCode = prompt("Enter your access code:", " ");
|
||||
var message = " ";
|
||||
message = (shipCode == "FREESHIP")?"You are eligible for free shipping!":"invalid code";
|
||||
document.write(message);
|
||||
*/
|
||||
alert("This is an alert message");
|
||||
console.log("Bruh moment")
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
BIN
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/greg/.DS_Store
vendored
Executable file
119
Semester 1/Assignments/JavaScript/JavaScript_1/public_html/greg/greg.css
Executable file
@@ -0,0 +1,119 @@
|
||||
body { background-color: #000040;
|
||||
background-image: url(background.gif);
|
||||
color: #88ffff;
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
}
|
||||
#container { margin-left: auto;
|
||||
margin-right: auto;
|
||||
width:80%;
|
||||
min-width:700px;
|
||||
}
|
||||
|
||||
|
||||
#logo {
|
||||
text-align:center;
|
||||
margin: 0;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
padding-top: 30px;
|
||||
padding-bottom: 20px;
|
||||
|
||||
}
|
||||
#nav {
|
||||
float: left;
|
||||
width: 200px;
|
||||
padding-top: 10px;
|
||||
text-align:left;
|
||||
color: #88FFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
#nav a {text-decoration:none;
|
||||
margin: 15px;
|
||||
display: block;
|
||||
color: #88FFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
#content {
|
||||
margin-left: 150px;
|
||||
padding: 30px;
|
||||
overflow:auto;
|
||||
border: medium groove #88FFFF;
|
||||
line-height: 135%;
|
||||
|
||||
}
|
||||
|
||||
.floatright {padding-left:20px;
|
||||
float:right;
|
||||
}
|
||||
.floatleft {
|
||||
float:left;
|
||||
padding: 30px 0px 20px;
|
||||
}
|
||||
#footer { font-size: .60em;
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
border-top: 2px double #000040;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
h2 { text-transform: uppercase;
|
||||
color: #88ffff;
|
||||
font-size: 1.2em;
|
||||
border-bottom: 1px none;
|
||||
margin-right: 20px;
|
||||
}
|
||||
h3 {
|
||||
color: #88ffff;
|
||||
font-size: 1em;
|
||||
border-bottom: 1px solid #000000;
|
||||
margin-right: auto;
|
||||
text-align: left;
|
||||
padding-top: 20px;
|
||||
padding-right: 150px;
|
||||
padding-bottom: 20px;
|
||||
padding-left: 150px;
|
||||
line-height: 130%;
|
||||
}
|
||||
.details { padding-left:20%;
|
||||
padding-right:20%;
|
||||
}
|
||||
|
||||
|
||||
img {border:0; }
|
||||
|
||||
|
||||
.content {
|
||||
margin: 20px;
|
||||
padding: 20px;
|
||||
height: 3700px;
|
||||
width: 500px;
|
||||
}
|
||||
a {text-decoration:none;
|
||||
margin: 15px;
|
||||
display: block;
|
||||
color: #88FFFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
a:hover {
|
||||
color: #000040;
|
||||
background-color: #88ffff;
|
||||
}
|
||||
span {
|
||||
font-size: 36px;
|
||||
font-weight: bold;
|
||||
font-family: "Courier New", Courier, mono;
|
||||
color: #88ffff;
|
||||
background-position: center center;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse
|
||||
}
|
||||
td {
|
||||
border: 2px solid #88ffff;
|
||||
width: 5em;
|
||||
font-family: "Courier New", Courier, mono;
|
||||
font-size: 14px;
|
||||
color: #88ffff;
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Greg's Gambits | Greg's Tales</title>
|
||||
<link href="greg.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript">
|
||||
function startGame()
|
||||
{
|
||||
var gender = "boy";
|
||||
var city = " ";
|
||||
var monster = " ";
|
||||
var food = " ";
|
||||
var drink = " ";
|
||||
numYears = prompt("Enter a number greater than 0: ");
|
||||
gender = prompt("Is the story about a boy or a girl? ");
|
||||
letter = gender.charAt(0);
|
||||
gender = (letter == "b" || letter == "B")?"boy":"girl";
|
||||
pronoun = (gender == "boy")?"he":"she";
|
||||
name = prompt("Enter the hero's name: ");
|
||||
city = prompt("Enter the name of a city: ");
|
||||
monster = prompt("Enter a type of monster: ");
|
||||
food = prompt("Enter a food you like: ");
|
||||
drink = prompt("Enter a drink you like: ");
|
||||
document.getElementById("content").innerHTML =("Once upon a time, about " + numYears + " years ago, there was a "+ gender + " named " + name + ". " + name + " lived in a small cabin in the woods just outside " + city + " limits.</p> <p>" + name + " enjoyed walking in the woods every day until... One day " + pronoun + " came upon a " + monster + " sitting on a log eating a " + food + ".</p> <p>The " + monster + " jumped up, spilling his " + drink + ". " + name + " ran home as fast as " + pronoun + " could but the " + monster + " followed and ...</p><h3>What happened? You decide! </h3> <p>Ending 1: The " + monster + " and " + name + " became best friends and lived in " + name + "'s house happily ever after.</p> <p>Ending 2: The " + monster + " overpowered " + name + " and gobbled down all the " + food + " and " + drink + " in " + name + "'s refrigerator.</p> <p>Ending 3: " + name + " screamed mean things at the " + monster + ", causing the " + monster + " to turn and run back to the woods, never to be seen again.</p>");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
<img src="images/superhero.jpg" class="floatleft" />
|
||||
<h1><em>Greg's Tales</em></h1>
|
||||
<h3>For this game, you will create a story by entering words as prompted. The story will change each time you run this game, as you enter different words.</h3>
|
||||
<div id="nav">
|
||||
<p><a href="index.html">Home</a>
|
||||
<a href="greg.html">About Greg</a>
|
||||
<a href="play_games.html">Play a Game</a>
|
||||
<a href="sign.html">Sign In</a>
|
||||
<a href="contact.html">Contact Us</a></p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p> </p>
|
||||
<input type="button" value = "click to begin" onclick="startGame()" />
|
||||
</div>
|
||||
<div id="footer">Copyright © 2013 Greg's Gambits<br />
|
||||
<a href="mailto:yourfirstname@yourlastname.com"> yourfirstname@yourlastname.com</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 4.1 KiB |
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
Click nbfs://nbhost/SystemFileSystem/Templates/ClientSide/html.html to edit this template
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>test1</title>
|
||||
<script type="text/javascript">
|
||||
var num1 = 8;
|
||||
//alert("1");
|
||||
var num2 = 7;
|
||||
//alert("2");
|
||||
var answer = num1 + num2;
|
||||
//alert("3");
|
||||
console.log("The value of 'answer' is: " + answer + "<br/>");
|
||||
console.log("The value of 'answer' > num1 is: " + (answer > num1) + "<br/>");
|
||||
|
||||
console.log(("John" > "abc") + "<br/>");
|
||||
console.log(("John" > "John") + "<br/>");
|
||||
console.log(("John" < "abc") + "<br/>");
|
||||
</script>
|
||||
|
||||
</html>
|