Question 1.1)
<html>
<body>
<script type="text/javascript">
var count=prompt("Input your character");
for ( i=0 ; i<=10 ; i++)
document.write (count);
</script>
</body>
</html>
KPOP World in Me
Welcome! =D
Welcome to this page, KPOP World In Me.
Basically, this page is for my college purpose.
Last year (2013), I was required to create a blog and to talk about the things I like. Therefore, I promoted South Korea, and that was my topic for the assignment. To view them, checkout the sidebar, under the "My Previous Project" section.
As of this year (2014), for IT-subject, I was asked to create a blog again. So, I thought that I might as well use this existing blog and fortunately, my lecturer allowed me to do so.
In summary, all I want to say is that this is NOT a personal blog. Although the website is called "KPOP World", but it will contain non-KPOP related topics...
That is all from me. Happy reading~~ ^^
P/S - I found out that you need to refresh the page whenever you first open the page. This is to get the correct fonts that I've set for this page.
Basically, this page is for my college purpose.
Last year (2013), I was required to create a blog and to talk about the things I like. Therefore, I promoted South Korea, and that was my topic for the assignment. To view them, checkout the sidebar, under the "My Previous Project" section.
As of this year (2014), for IT-subject, I was asked to create a blog again. So, I thought that I might as well use this existing blog and fortunately, my lecturer allowed me to do so.
In summary, all I want to say is that this is NOT a personal blog. Although the website is called "KPOP World", but it will contain non-KPOP related topics...
That is all from me. Happy reading~~ ^^
P/S - I found out that you need to refresh the page whenever you first open the page. This is to get the correct fonts that I've set for this page.
Thursday, March 20
Friday, March 14
Tutorial 10
Question 1. 1) & 2)
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<script type="text/javascript">
var nescafe = prompt("Nescafe?","Enter Value");
var apple = prompt("Apple?","Enter Value");
var cocomilk = prompt("Coco Milk?","Enter Value");
var maggiemee = prompt("Maggie Mee?","Enter Value");
var nescafe_price = parseInt(nescafe)*10.50;
var apple_price = parseInt(apple)*1.20;
var cocomilk_price = parseInt(cocomilk)*1.50;
var maggiemee_price = parseInt(maggiemee)*3.50;
var subtotal = nescafe_price + apple_price + cocomilk_price + maggiemee_price;
/* Display the receipt */
document.write("<h2> ABC Shop Enterprise </h2>");
document.write("<br>")
document.write("<table>");
document.write("<tr><th width=130px> Item</th>");
document.write("<th width=120px> Price </th>");
document.write("<th width=110px> Total </th></tr>");
document.write("<tr><td>Nescafe @ " + nescafe + "</td>");
document.write("<td>RM10.50</td>");
document.write("<td>RM " + nescafe_price.toFixed(2) + "</td></tr>");
document.write("<tr><td>Apple @ " + apple + "</td>");
document.write("<td>RM1.20</td>");
document.write("<td>RM " + apple_price.toFixed(2) + "</td></tr>");
document.write("<tr><td>Coco Milk @ " + cocomilk + "</td>");
document.write("<td>RM1.50</td>");
document.write("<td>RM " + cocomilk_price.toFixed(2) + "</td></tr>");
document.write("<tr><td>Maggie Mee @ " + apple + "</td>");
document.write("<td>RM3.50</td>");
document.write("<td>RM " + maggiemee_price.toFixed(2) + "</td></tr>");
document.write("<tr><td class=white>" + "</td>");
document.write("<td class=yellow>SubTotal" + "</td>");
document.write("<td class=yellow>RM" + subtotal.toFixed(2) + "</td></tr>");
document.write("<tr><td class=white>" + "</td>");
document.write("<td class=yellow>GST" + "</td>");
document.write("<td class=yellow>RM" + 0.06*subtotal.toFixed(2) + "</td></tr>");
document.write("<tr><td class=white>" + "</td>");
document.write("<td class=black >Grand Total" + "</td>");
document.write("<td class=black >RM" + (subtotal+0.06*subtotal).toFixed(2) + "</td></tr>");
document.write("</table>");
</script>
</body>
</html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<script type="text/javascript">
var nescafe = prompt("Nescafe?","Enter Value");
var apple = prompt("Apple?","Enter Value");
var cocomilk = prompt("Coco Milk?","Enter Value");
var maggiemee = prompt("Maggie Mee?","Enter Value");
var nescafe_price = parseInt(nescafe)*10.50;
var apple_price = parseInt(apple)*1.20;
var cocomilk_price = parseInt(cocomilk)*1.50;
var maggiemee_price = parseInt(maggiemee)*3.50;
var subtotal = nescafe_price + apple_price + cocomilk_price + maggiemee_price;
/* Display the receipt */
document.write("<h2> ABC Shop Enterprise </h2>");
document.write("<br>")
document.write("<table>");
document.write("<tr><th width=130px> Item</th>");
document.write("<th width=120px> Price </th>");
document.write("<th width=110px> Total </th></tr>");
document.write("<tr><td>Nescafe @ " + nescafe + "</td>");
document.write("<td>RM10.50</td>");
document.write("<td>RM " + nescafe_price.toFixed(2) + "</td></tr>");
document.write("<tr><td>Apple @ " + apple + "</td>");
document.write("<td>RM1.20</td>");
document.write("<td>RM " + apple_price.toFixed(2) + "</td></tr>");
document.write("<tr><td>Coco Milk @ " + cocomilk + "</td>");
document.write("<td>RM1.50</td>");
document.write("<td>RM " + cocomilk_price.toFixed(2) + "</td></tr>");
document.write("<tr><td>Maggie Mee @ " + apple + "</td>");
document.write("<td>RM3.50</td>");
document.write("<td>RM " + maggiemee_price.toFixed(2) + "</td></tr>");
document.write("<tr><td class=white>" + "</td>");
document.write("<td class=yellow>SubTotal" + "</td>");
document.write("<td class=yellow>RM" + subtotal.toFixed(2) + "</td></tr>");
document.write("<tr><td class=white>" + "</td>");
document.write("<td class=yellow>GST" + "</td>");
document.write("<td class=yellow>RM" + 0.06*subtotal.toFixed(2) + "</td></tr>");
document.write("<tr><td class=white>" + "</td>");
document.write("<td class=black >Grand Total" + "</td>");
document.write("<td class=black >RM" + (subtotal+0.06*subtotal).toFixed(2) + "</td></tr>");
document.write("</table>");
</script>
</body>
</html>
Friday, March 7
Tutorial 9
Question 1. a)
<html>
<body>
<h1>My First JavaScript</h1>
<p> Click the button to display the date.</p>
<button type="button" onclick="myFunction()"> Display Date</button>
<p id="demo"></p>
<script type="text/javascript">
function myFunction() {
document.getElementById("demo").innerHTML = "Thu Feb 27 2014 18:25:36 GMT +0800 Malay Peninsular Standard Time";
}
</script>
</body>
</html>
<html>
<body>
<h1>My First JavaScript</h1>
<p> Click the button to display the date.</p>
<button type="button" onclick="myFunction()"> Display Date</button>
<p id="demo"></p>
<script type="text/javascript">
function myFunction() {
document.getElementById("demo").innerHTML = "Thu Feb 27 2014 18:25:36 GMT +0800 Malay Peninsular Standard Time";
}
</script>
</body>
</html>
Saturday, March 1
Tutorial 8
Question 1
1)
CSS file
body {
font-family:calibri;
}
table {
border-collapse:collapse;
border-style: solid;
border-color: red;
background-color: #FDD017;
}
td.yellow2 {
/*background-color: yellow;*/
border-width: 2px;
border-style: solid;
border-color: red;
font-size: 0.8em;
text-align:left;
}
td.yellow {
background-color: #FFFFCC;
border-width: 2px;
border-style: solid;
border-color: red;
}
th.border {
background-color: #FFFFCC;
border-width: 2px;
border-style: solid;
border-color: red;
}
1)
CSS file
body {
font-family:calibri;
}
table {
border-collapse:collapse;
border-style: solid;
border-color: red;
background-color: #FDD017;
}
td.yellow2 {
/*background-color: yellow;*/
border-width: 2px;
border-style: solid;
border-color: red;
font-size: 0.8em;
text-align:left;
}
td.yellow {
background-color: #FFFFCC;
border-width: 2px;
border-style: solid;
border-color: red;
}
th.border {
background-color: #FFFFCC;
border-width: 2px;
border-style: solid;
border-color: red;
}
Subscribe to:
Posts (Atom)