Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
natalieamalia committed Sep 29, 2020
1 parent 7276052 commit d6fe932
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Lab6/EX6.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="2">
<script>
var first_name = 'Natalie';
var table_str =
`<tr><th>Line</th><th>Name</th></tr>
<tr><td>1.</td><td>${first_name}</td></tr>
<tr><td>2.</td><td>${first_name}</td></tr>
<tr><td>3.</td><td>\n${first_name}</td></tr>
<tr><td>4.</td><td>'\n${first_name}'</td></tr>
<tr><td>5.</td><td>"\n${first_name}"</td></tr>`;
document.write(table_str);
</script>

</table>
</body>
</html>
Empty file removed Lab6/EX6.js
Empty file.
19 changes: 19 additions & 0 deletions Lab7/EX3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
name = "Natalie";
likesBeer = true;
document.write(name + ' does ');
if ( likesBeer == false )
document.write('not ');
document.write('like beer!');

</script>
</body>
</html>
130 changes: 130 additions & 0 deletions WODs/Invoice1/invoice.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<script>
/*
An invoice of the sales of five different products.
/*

//Product data

// Product 1
var item1 = 'Hot Cheetos';
var quantity1 = 2;
var price1 = 4.23;

// Product 1
var item2 = 'Takis';
var quantity1 = 3;
var price1 = 3.25;

// Product 1
var item3 = 'Doritos';
var quantity1 = 5;
var price1 = 4.33;

// Product 1
var item4 = 'Kettle Potato Chips';
var quantity1 = 6;
var price1 = 3.75;

// Product 5
var item1 = 'Pringles';
var quantity1 = 4;
var price1 = 2.67;
//Compute extended prices
var extended_price1 = quantity1*price1;
var extended_price2 = quantity2*price2;
var extended_price3 = quantity3*price3;
var extended_price4 = quantity4*price4;
var extended_price5 = quantity5*price5;

//Compute Subtotal
var subtotal = extended_price1 + extended_price2 + extended_price3 + extended_price4 + extended_price5;

//Compute tax
var tax_rate = 0.0575;
var tax = tax_rate*subtotal;

//Compute grand total
var total = subtotal + tax;

</script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<table border="2">
<tbody>
<tr>
<th style="text-align: center;" width="43%">Item</th>
<th style="text-align: center;" width="11%">quantity</th>
<th style="text-align: center;" width="13%">price</th>
<th style="text-align: center;" width="54%">extended price</th>
</tr>
<script>
// product row 1
document.write(`
<tr>
<td width="43%">${item1}</td>
<td align="center" width="11%">${quantity1}</td>
<td width="13%">\$${price1}</td>
<td width="54%">\$${extended_price1}</td>
</tr>
`);

//product row 2
document.write(`
<tr>
<td width="43%">${item2}</td>
<td align="center" width="11%">${quantity2}</td>
<td width="13%">\$${price2}</td>
<td width="54%">\$${extended_price2}</td>
</tr>
`);
//product row 3
document.write(`
<tr>
<td width="43%">${item3}</td>
<td align="center" width="11%">${quantity3}</td>
<td width="13%">\$${price1}</td>
<td width="54%">\$${extended_price3}</td>
</tr>
`);
//product row 4
document.write(`
<tr>
<td width="43%">${item4}</td>
<td align="center" width="11%">${quantity4}</td>
<td width="13%">\$${price4}</td>
<td width="54%">\$${extended_price4}</td>
</tr>
`);
//product row 5
document.write(`
<tr>
<td width="43%">${item5}</td>
<td align="center" width="11%">${quantity5}</td>
<td width="13%">\$${price5}</td>
<td width="54%">\$${extended_price5}</td>
</tr>
`);
</script>

<tr>
<td style="text-align: center;" colspan="3" width="67%">Sub-total</td>
<td width="54%"><script>document.write(subtotal);</script></td>
</tr>
<tr>
<td style="text-align: center;" colspan="3" width="67%"><span style="font-family: arial;">Tax @ 5.75%</span></td>
<td width="54%"><script>document.write(tax.toFixed(2));</script></td>
</tr>
<tr>
<td style="text-align: center;" colspan="3" width="67%"><strong>Total</strong></td>
<td width="54%"><strong><script>document.write(total.toFixed(2));</script></strong></td>
</tr>
</tbody>
</table>
</body>
</html>

0 comments on commit d6fe932

Please sign in to comment.