add previous assignment

master
Caleb Fontenot 2023-03-14 09:48:18 +07:00
parent 512bd81c21
commit 40aeb32212
105 changed files with 2715 additions and 8 deletions

5
.gitignore vendored

@ -18,4 +18,9 @@
/Assignments/MP07_CalebFontenot/nbproject/private/
/Assignments/JavaScript_1/nbproject/private/
/Assignments/JavaScript/chapter2LatBame/nbproject/private/
<<<<<<< Updated upstream
/Assignments/JavaScript/lab13js_CalebFontenot/nbproject/private/
=======
/Assignments/JavaScript/Chapter3Examples/nbproject/private/
/Assignments/JavaScript/lab12js/nbproject/private/
>>>>>>> Stashed changes

@ -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": {}
}

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

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>&nbsp; </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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>

@ -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>

@ -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>

@ -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>&nbsp;</h1>");
document.write("<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>");
document.write("<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The student's score, with any extra credit, is " + score + "%.</p>");
}
</script>
</<head>
<body>
<table align ="center" width ="70%"><tr><td>
<h1>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

Binary file not shown.

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>&nbsp;</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>&nbsp;</p>
</div>
<p>&nbsp;</p>
<div id="footer">
<div align="center">Copyright &copy; 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>&nbsp;</h1>
<hr /><h2> Here are your avatar options: </h2>
</td></tr>
<tr><td>
<h3><hr /><img src="images/bunny.jpg" />Bunny &nbsp;&nbsp;
<img src="images/elf.jpg" /> Elf &nbsp;&nbsp;
<img src="images/ghost.jpg" />Ghost &nbsp;&nbsp;&nbsp;
<img src="images/princess.jpg" /> Princess &nbsp;&nbsp;
<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>

@ -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>&nbsp;</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>&nbsp;</p>
<p><input type="button" value = "Ask your question" onclick="startFortune();" /></p>
<p>&nbsp;</p>
</div>
<div id="footer">Copyright &copy; 2013 Greg's Gambits<br />
<a href="mailto:yourfirstname@yourlastname.com">yourfirstname@yourlastname.com</a></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

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>&nbsp;</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>&nbsp;</p>
</div>
<div id="footer">Copyright &copy; 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>&nbsp;</p>
<p>&nbsp;</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%">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
</div>
<div id="footer">Copyright &copy; 2013 Greg's Gambits<br />
<a href="mailto:yourfirstname@yourlastname.com">yourfirstname@yourlastname.com</a></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

@ -2,13 +2,6 @@
<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>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript_1/bower.json</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript_1/package.json</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript_1/public_html/index.html</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript_1/Gruntfile.js</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript_1/.bowerrc</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript_1/gulpfile.js</file>
</group>
<group/>
</open-files>
</project-private>

Binary file not shown.

Binary file not shown.

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

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>&nbsp; </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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -0,0 +1,49 @@
<!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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>

@ -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>

@ -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>

@ -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>&nbsp;</h1>");
document.write("<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>");
document.write("<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The student's score, with any extra credit, is " + score + "%.</p>");
}
</script>
</<head>
<body>
<table align ="center" width ="70%"><tr><td>
<h1>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

@ -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>&nbsp;</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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

@ -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": "lab12js",
"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,11 @@
<?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>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript/lab12js/bower.json</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript/lab12js/.bowerrc</file>
<file>file:/home/caleb/ASDV-WebDev/Assignments/JavaScript/lab12js/package.json</file>
</group>
</open-files>
</project-private>

@ -0,0 +1,5 @@
file.reference.lab12js-public_html=public_html
file.reference.lab12js-test=test
files.encoding=UTF-8
site.root.folder=${file.reference.lab12js-public_html}
test.folder=${file.reference.lab12js-test}

Some files were not shown because too many files have changed in this diff Show More