Pages

Ads 468x60px

Rabu, 25 April 2012

KASUS 3
. PENJUALAN BAJU
                Nina memesan baju dengan kota jakarta,dengan daftar baju sbb:
·         Rok                        : 2
·         Baju                       : 1
·         Celana                  : 3
Dengan harga masing-masing barang yaitu
·         Rok                        : 50000
·         Baju                       : 75000
·         Celana                  : 100000
Dan biaya ongkir per Lembar pakaian : 5000, Buatlah HTML kasus diatas  ?

<?php
$nm_pk1= "rok";
$nm_pk2= "baju";
$nm_pk3= "celana";
                        
$hrg_pk1= 50000;
$hrg_pk2= 75000;
$hrg_pk3= 100000;

$jmlh_pk1= 2;
$jmlh_pk2= 1;
$jmlh_pk3= 3;

$ongkir= 5000;
$ongkir1= $jmlh_pk1*$ongkir;
$ongkir2= $jmlh_pk2*$ongkir;
$ongkir3= $jmlh_pk3*$ongkir;

$ttl_pk1= ($jmlh_pk1*$hrg_pk1)+($jmlh_pk1*$ongkir);
$ttl_pk2= ($jmlh_pk2*$hrg_pk2)+($jmlh_pk2*$ongkir);
$ttl_pk3= ($jmlh_pk3*$hrg_pk3)+($jmlh_pk3*$ongkir);

$ttl_pakaian=$ttl_pk1+$ttl_pk2+$ttl_pk3;
?>



KASUS 2
MINIMARKET
Elsa membeli pada sebuah minimarket berupa
·         Gula       : ½ kg
·         Telur      : 5 butir
·         Susu      : 1 bks
Dengan biaya     :
·         Gula 1 kg                              : 12000
·         Telur 1 butir                        :1000
·         Susu 1 bungkus                 : 5000                   
Buatlah HTML dengan kasus diatas ?

<?php
$nm_brg1= "gula";
$nm_brg2= "telur";
$nm_brg3= "susu";

$hrg_brg1= 12000;
$hrg_brg2= 1000;
$hrg_brg3= 5000;

$jmlh_brg1= 0.5;
$jmlh_brg2= 5;
$jmlh_brg3= 1;

$ttl_brg1= $jmlh_brg1*$hrg_brg1;
$ttl_brg2= $jmlh_brg1*$hrg_brg2;
$ttl_brg3= $jmlh_brg3*$hrg_brg3;

$total_biaya= $ttl_brg1+$ttl_brg2+$ttl_brg3;
?>

TUGAS PEMROGRAMAN WEB 1

KASUS 1
PENJUALAN BUKU
   Dina membeli buku pada sebuah toko buku yaitu sbb:
·         MATEMATIKA   : 1
·         FISIKA                   : 8
·         BIOLOGI               :5
Dengan harga setiap buku yaitu
·         Matematika       : 60000
·         Fisika                     : 50000
·         Biologi                   : 47000
Buat kasus diatas dengan HTML ?
 
<?php
$nm_bk1="matematika";
$nm_bk2="fisika";
$nm_bk3="biologi";

$hrg_bk1 = 60000;
$hrg_bk2 = 50000;
$hrg_bk3 = 47000;

Selasa, 03 April 2012

Program REQUIRE pada PHP

Program REQUIRE pada PHP
Contoh require1

<html>
<head>
<title>..::TUGAS REQUIRE::..</title>
</head>
<body>
<?php
$b="Saya Sedang Makan";
function eLha($teks)
{
echo("<i>$teks</i>");
}
?>
</body>
</html>

require 2

<html>
<head>
<title>..::TUGAS REQUIRE::..</title>
</head>
<body>
<?php
require("r1.php");
elha("eLha Sedang Apa ??");
{
echo("<br>");
echo($b);
}
?>
</body>
</html>

Program INCLUDE pada PHP

Program INCLUDE pada PHP
CONTOH INCLUDE 1

<html>
<head>
<title>..::TUGAS Include::..</title>
</head>
<body>
<?php

$color = 'green';
$fruit = 'apple';

?>
</body>
</html>

Program FOR pada PHP

Program FOR pada PHP

<html>
<head>
<title>..::TUGAS FOR::..</title>
</head>
<body>
<?php
$max = 10;
for ($counter1 = 1; $counter1 <= $max; $counter1++)
echo ("eLha <br>");
?>
</body>
</html>

Program SWITCH pada PHP

Program SWITCH pada PHP

<html>
<head>
<title>..::TUGAS SWITCH::..</title>
</head>
<body>
<?php
switch ($pesan)
{
case Sabtu:
echo "Kerja setengah hari";
break;
case Minggu:
echo "Libur";
break;
default:
echo "Ayo kerja!";
}
?>
</body>
</html>
setelah di jalankan

Program WHILE Pada PHP

program WHILE Pada PHP

<html>
<head>
<title>..::TUGAS WHILE::..</title>
</head>
<body>
<?php
  $count=1;
  while($count<=10)
   {
    echo("Nama saya eLha <br>");
    $count++;
   }
?>
</body>
</html>
setelah di jalankan

program IF pada PHP

Program IF pada PHP


<html>
<head>
<title>..::TUGAS IF::..</title>
</head>
<body>

membuat profil dengan HTML

bagaimana membuat profil dengan HTML,okeee untuk membuat pertama-tama
1.buat scriptnya di notepad
   contoh:

<html>
<head>
<title>..::PROFIL::..</title>
</head>
<body background="D:\Nurul Ilmah\STIMED NUSA PALAPA\Kuliah\Semester 4\ramlah\couple2-320x200.bmp">
<fieldset>
<legend><b>My Profil</b></legend>
<table>
<tr>

  <td rowspan="6" width="150px"><img src="image.gif" /></td>
  <td><b><font color="blue">Nama </b></td>
  <td><font color="blue">:</td>
  <td><font color="blue">Ramlah</font></td>

</tr>
<tr>
    <td><b><font color="blue">NIM </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">01010010</td>
</tr>
<tr>
    <td><b><font color="blue">Alamat </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">Jl.Urip Sumoharjo No.13</td>
</tr>
<tr>
    <td><b><font color="blue">Jurusan </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">Sistem Informasi</td>
</tr>
<tr>
    <td><b><font color="blue">No.Tlp </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">085399674209</td>
</tr>
<tr>
    <td><b><font color="blue">E-mail </b></td>
    <td><font color="blue">:</td>
    <td><font color="blue">ramlah_stimed@yahoo.com</td>
</tr>
</table>
</fieldset>
</body>
</html>
2.nah,,setelah save as dengan misalnya profil.html
3.kemudian di jalankan di mozilla dsb
  setelah di jalankan tampilan akan seperti ini