SOURCE CODE Program Tarif Travel Bus JavaScript

Pada dasarnya dalam JavaScript terdapat dua macam pernyataan percabangan yaitu if..else dan switch. berikut SOURCE CODE Program Tarif Travel Bus JavaScript

Percabangan

Untuk membuat suatu halaman yang dinamis dan interaktif, perancang halaman Web membutuhkan perintah-perintah yang dapat mengatur aliran dari informasi. Berdasarkan hasil komputasi yang telah dilakukan, JavaScript akan membuat keputusan jalur mana yang akan dieksekusi.
Pada dasarnya dalam JavaScript terdapat dua macam pernyataan percabangan yaitu if..else dan switch

Contoh Kasus

Perusahaan Travel ”Bintang Abadi” mempunyai armada dengan tujuan:

Tujuan Harga Tiket

Jakarta ---> 100000
Cirebon ---> 150000
Tasikmalaya ---> 200000

Apabila seorang pemesan sudah menjadi anggota/member Travel Bintang Abadi maka akan mendapatkan diskon 10 %.
Subtotal : Harga tiket X Jumlah tiket
Diskon : 0.10 X Subtotal
Total : Subtotal - Diskon
Buat Program dengan menggunakan Javascript untuk menyelesaikan masalah tersebut. Dengan ketentuan sebagai berikut :

Input:

Nama pemesan
Tujuan
Jumlah Tiket
Member

Output:

Harga Tiket
Sub Total
Diskon
Total Bayar

Contoh Program Tarif Travel Bus JavaScript

Interface


SOURCE CODE Program Tarif Travel Bus JavaScript


Source Code

<HTML>
<HEAD><TITLE>Percabangan IF-ELSE 2</TITLE></HEAD>
<BODY>
<SCRIPT language="JavaScript">
<!--
function hitungtotal()
{
var nama = (document.fform.inama.value);
var tujuan = (document.fform.itujuan.value);
var jumlahtiket = parseFloat(document.fform.ijumlah.value);
var ht = 0.0;
var sub = 0.0;
var diskon =0.0;
var total =0.0;

if (tujuan=="Jakarta")
{
ht =100000;
}
else if (tujuan=="Cirebon")
{
ht =150000;
}
else
{
ht =200000;
}
sub = jumlahtiket*ht;

if (document.fform.imember.checked==true)
{
diskon =0.10*sub;
}
else
{
diskon=0.0;
}

total = sub-diskon;
document.fform.otiket.value=eval(ht);
document.fform.osub.value=eval(sub);
document.fform.odiskon.value=eval(diskon);
document.fform.ototal.value=eval(total);
// gunakan untuk mengecek !!! alert (total);
}
//--></SCRIPT>
<FORM NAME ="fform">
<table border="1" align="center"width="70%">
<tr>
<td width="100%" colspan="2"><H2 ALIGN="center">Travel Bintang Abadi</H2></td>
</tr>
<tr>
<td width="50%"><PRE>
Nama :<input type="text" size="20" name="inama">
Tujuan :<select name="itujuan" size=1>
<option value="Jakarta">Jakarta</option>
<option value="Cirebon">Cirebon</option>
<option value="Tasikmalaya">Tasikmalaya</option>
</select>
Jumlah Tiket :<input type="text" size="11" name="ijumlah">
Member :<input type="checkbox" name="imember">Ya</td></pre>
<td width="50%"><pre>
Harga Tiket :<input type="text" size="10" name="otiket">
Sub Total :<input type="text" size="10" name="osub">
Diskon :<input type="text" size="10" name="odiskon">
Total Bayar :<input type="text" size="10" name="ototal"></td><pre>
</tr>
<tr>
<td width="100%" colspan="2">
<center>
<INPUT TYPE="button" value="Hitung" onclick="hitungtotal()">
<INPUT TYPE="reset" value="Ulang">
</center></td>
</tr>
</table>
</FORM>
</BODY>
</HTML>
Mungkin itu saja yang bisa admin bagikan kepada Anda. admin berharap artikel ini sangat bermanfaat bagi Anda. Admin akan sangat bertrimakasih bila anda mau meluangkan waktu untuk memberikan KOMENTAR dan SHARE artikel ini, karena kontribusi anda sangat berharga bagi Admin.

SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript SOURCE CODE Program Tarif Travel Bus JavaScript Ad group Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Else Javascript Javascript Then Javascript Then Javascript Then Javascript Then Javascript Then Javascript Then Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Conditional Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Operator Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Javascript Statement Else Statement Else Statement Else Statement Else Statement Else Statement Else Statement Else Statement Else Statement Else Statement Else Statement Else Statement Html If Html If Html If Html If Html If Html If Html If Html If Html If Html If Javascript Not Javascript Not Javascript Not Javascript Not Javascript Not Javascript Not Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Else Java Js If Js If Js If Js If Js If Js If Js If Statement Html Statement Html Statement Html Statement Html Statement Html Statement Html Statement Html Statement Html Statement Html Javascript Examples Javascript Examples Javascript Examples Javascript Examples Javascript Examples Javascript Examples If Conditions If Conditions If Conditions If Conditions If Conditions If Conditions If Conditions If Conditions If Conditions If Conditions If Conditions Javascript Equality Javascript Equality Javascript Equality Javascript Equality Javascript Equality Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Else Html Then Statement Then Statement Then Statement Then Statement Then Statement Then Statement Then Statement If Then If Then If Then If Then If Then If Then If Then Switch Switch Switch Switch Switch Switch Elseif Elseif Elseif Elseif Elseif Elseif Elseif Elseif Elseif Else Jquery Else Jquery Else Jquery Else Jquery Else Jquery Else Jquery Else Jquery Else Jquery If Jquery If Jquery If Jquery If Jquery If Jquery If Jquery Else Example Else Example Else Example Else Example Else Example Else Example Else Example Else Example Else Example Else Example Javascript Function Javascript Function Javascript Function Javascript Function Javascript Function Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Statement In Java Condition Examples Condition Examples Condition Examples Condition Examples Condition Examples Else Then Else Then Else Then Else Then Else Then Javascript Case Javascript Case Javascript Case Javascript Case Javascript Case Javascript Case Javascript Case Javascript Case If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax If Syntax Elseif Javascript Elseif Javascript Elseif Javascript Elseif Javascript Elseif Javascript Js Else Js Else Js Else Js Else Js Else Js Else If Clause If Clause If Clause If Clause If Clause If Clause If Clause If Clause Javascript Nested Javascript Nested Javascript Nested Javascript Nested Javascript Nested Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Html Conditional Statement Examples Statement Examples Statement Examples Statement Examples Statement Examples Statement Examples Statement Examples Else Syntax Else Syntax Else Syntax Else Syntax Else Syntax Else Syntax Else Syntax Else Syntax Else Syntax Script If Script If Script If Script If Script If Script If Script If Script If Then Example Then Example Then Example Then Example Then Example Then Example Jquery Condition Jquery Condition Jquery Condition Jquery Condition Jquery Condition Jquery Condition Conditional Statement Conditional Statement Conditional Statement Conditional Statement Conditional Statement Conditional Statement Conditional Statement Conditional Statement Condition Java Condition Java Condition Java Condition Java Condition Java Condition Java If Loop If Loop If Loop If Loop If Loop If Loop Clause Example Clause Example Clause Example Clause Example Clause Example Statement Using Statement Using Statement Using Statement Using Statement Using Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Else If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If Javascript If If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement If Statement Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making Keywords like: Javascript Decision Making if else javascript javascript if then else javascript else javascript if else statement if then else javascript if else statement javascript else javascript javascript if else shorthand javascript if else statement example javascript if else statement examples javascript if else examples if else javascript example javascript if else if example if else if javascript javascript if else multiple conditions else if javascript example if else javascript multiple conditions javascript if and else if else in javascript javascript if else condition else if javascript javascript shorthand if else javascript if else javascript else if javascript if else if if else javascript examples else if in javascript javascript if else example if else shorthand javascript javascript else statement function if else javascript javascript short if else javascript else if statement javascript else if elseif javascript if then else example javascript else if example if else statement in javascript if else if in javascript javascript else if syntax javascript if else syntax if else condition in javascript if else statement in javascript examples javascript if else elseif javascript else if not working javascript if else if statement javascript switch else if else if else javascript if and else in javascript if then else in javascript javascript function if else javascript if else function else if en javascript if else en javascript if else syntax javascript if else javascript syntax javascript if else or else in javascript javascript if elseif else example of if else statement in javascript javascript if or else javascript if then if then javascript then javascript javascript then function if then in javascript javascript when then javascript conditional assignment javascript conditions conditional javascript if condition javascript conditions javascript javascript conditional statement if condition in javascript javascript conditional javascript if condition javascript condition conditional statement javascript or condition in javascript and condition in javascript condition javascript javascript conditionals javascript and condition conditional statement in javascript javascript if statement with multiple conditions javascript or condition javascript conditional expression how to write if condition in javascript javascript if statement multiple conditions javascript if conditions condition in javascript how to use if condition in javascript javascript or condition in if statement javascript conditional if conditions in javascript how to use and condition in javascript conditionals javascript javascript and operator javascript comparison operators javascript ternary operator example javascript conditional operators javascript not operator javascript comparison operator javascript conditional operator examples conditional operators javascript javascript operator example not operator javascript comparison operator javascript conditional operator in javascript ternary operators javascript javascript if or operator this javascript operator javascript if operators conditional operators in javascript if statement javascript javascript switch statement examples javascript if and statement javascript if statement examples javascript with statement javascript if then statement javascript print statement javascript switch statement example switch statement javascript if then statement javascript javascript if statement javascript and statement if statement in javascript javascript or statement print statement javascript javascript for statement javascript statement print statement in javascript and statement javascript statement javascript javascript if statement string how to write an if statement in javascript javascript if statement example if statement in javascript example javascript switch statement string for statement in javascript javascript if statement syntax if statement in javascript with example alert statement in javascript if else statement else if statement if else if statement if and else statement if else if else statement simple if else statement else statement what is if else statement if statement else if else statement definition the if else statement html javascript if html if then if then html html if if html html if and if javascript html html script if if in html html if or javascript not javascript not in not javascript javascript if not if not javascript if not in javascript if else statement in java if else in java java if else if else java else if java java else if if else statement java else if in java if else if java java if then else java if else if if then else java java if else statement java if else syntax example of if else statement in java java script if else java if else if statement example if else if in java if else en java java else if syntax if else statement java example code if else java example java if else examples if else if statement in java else if statement java java script else if how to use if else in java if else example in java if and else java if else condition in java if else syntax in java if else statement in java example java if else example if else in java example if else statement in java examples java else if statement if else java script java code for if else statement else if statement in java if else java syntax syntax of if else in java java else if example if and else in java how to use else if in java if else statement example java java if else statement example if else in java script if else syntax java if and else if in java if else loop in java else if syntax in java using if else in java java if and else java programming if else statement if if else java java if else if else what is if else statement in java java programming if else java if else if syntax syntax for if else in java java if else statement syntax if and else if java how to write an if else statement in java if else examples in java how to write if else in java else if java script js if then js if if js js if or js if statement if condition in js js if condition if statement html html if statement if statement in html if statement in html code html if statement example how to use if statement in html if statement in html example if statement in html form html if then statement javascript switch example javascript if examples javascript ternary example ternary javascript example javascript if example iif javascript example if else condition if conditions if condition in if condition if and condition and in if condition and condition in if else if condition if condition in how to use if condition if condition true false javascript equality javascript equality operator javascript equal operator javascript if not equal javascript if equals html if else statement html if else if else in html if else html if else statement html if else statement in html else html if else in html code if else statement in html form html else if html else html if then else how to use if else in html else if html html if then else statement if then statement an if then statement if then else statement if and then statement the if then statement how to write an if then statement what is if then else statement coffeescript if then java if then if then code if then java code if then if then in java if then els js switch case switch javascript switch case js java script switch javascript switch syntax js switch statement elseif if elseif java elseif elseif java jquery elseif js elseif if else elseif elseif js elseif in java jquery if else if else jquery jquery else if if else in jquery jquery else else if in jquery jquery if else if if else statement jquery if jquery jquery if statement jquery if or if statement jquery jquery if then if statement in jquery if else example if else statement examples if else examples example of if else statement example of if else if else statement example else if example if else if example examples of if else statement example if else statement javascript check if function javascript function if javascript if function if function javascript if function in javascript java if statement example of if statement in java java script if statement java if then statement if then statement java if statement in java with example if statement example in java simple if statement in java how to write an if statement in java if statement in java script if statement example java if then statement in java conditional statement examples conditional statement example if condition example examples of conditional statement syntax if condition examples if then else if then else if if else then then else coffeescript if then else javascript case statement javascript switch multiple case case statement javascript case statement in javascript switch case in javascript example javascript switch case else how to write switch case in javascript javascript switch case syntax if syntax java if syntax javascript if syntax if statement syntax syntax of if statement java if statement syntax syntax for if statement syntax of if statement in java if then syntax syntax of if if statement syntax java if statement syntax in java javascript elseif elseif javascript javascript if elseif elseif in javascript if elseif javascript js else if js if else if else js js if else if if else in js else if in js if clause what is if clause javascript if clause the if clause if clause condition how to use if clause usage of if clause use of if clause javascript nested if nested if statement javascript nested if javascript nested if in javascript nested if else in javascript if condition in html html if condition how to write if condition in html how to use if condition in html if else condition in html if condition in html code condition in html html conditional statement how to use if else condition in html conditional statement in html if condition in html tags example of if statement if statement example if statement examples examples of if statement the if statement is an example of a example if statement example of an if statement if else syntax syntax of if else else if syntax syntax for if else statement syntax of if else statement if else statement syntax syntax for if else html if else syntax if else if syntax java script if if java script if then script if statement in script script if else script if statement if else script java script if and if-then statement examples example of if then statement if then statement example example of if and then statement if then example example if then statement if condition in jquery jquery if condition jquery condition if else condition in jquery jquery if condition example jquery if else condition condition statement conditional if statement how to write a conditional statement write a conditional statement how do you write a conditional statement conditional statement syntax if condition statement or condition in if statement if condition in java java if condition if condition java java if statement multiple conditions java if condition example if condition in java script if else loop if loops java if loop javascript if loop if loop in javascript else if loop if clause examples example of if clause if clause example examples of if clause example if clause how to use if statement how to use an if statement using or in an if statement using and in if statement if statement using if else if else if if else if else if and else jscript if else else if if and else if coffeescript if else if if else if the else for if else if e else if and if else if else coding if else else if if else else if else function if else or if else statment if else structure else if else if or else if else code how to use else if how to use if else if if else else javascript shorthand if javascript if or javascript if and if javascript if in javascript javascript if var javascript if test if en javascript javascript if shorthand if or javascript if and javascript javascript if true javascript multiple if javascript if in javascript if and or javascript if text javascript if for javascript if 0 javascript if command javascript and if if && javascript if em javascript javascript if statment javascript if or and javascript if abfrage and in javascript if if javascript and javascript for if if variable javascript how to use if in javascript javascript if expression if statement if and statement if or statement what is an if statement what is if statement simple if statement if statement or if statement with or if statement and how to do an if statement coffeescript if statement the if statement if statement with and if statement code if statement with how to write an if statement what is a if statement or in if statement and if statement what is the if statement if not statement if and or statement if statement within if statement statement if or if statement if statement and or or in an if statement if statement tutorial if statement in javascript comparison javascript less than jscript if the else if -f or in javascript if operator if code ifelse javascript number comparison javascript iif javascript comparisons greater than javascript if -ne if statment iif javascript if and if a if using if if or if if elsif if els conditional script if example else it is else javascript iff ifelse java else fi java ifelse elsif java example of if javascriptif javascript decision making els if if eles

COMMENTS

Nama

AJAX Android APLIKASI APLIKASI PROGRAMMING BASIC Bootstrap C Plus Plus Cisco Packet Tracer Codeigniter CRUD CSS Framework HTML Instaling Jaringan Komputer Java Java Script JavaScript JQUERY Pengetahuan PHP Programming Review Sekolah SOURCODE Teknologi TipsTrick Tutorial Video Yii
false
ltr
item
HI-CODDING: SOURCE CODE Program Tarif Travel Bus JavaScript
SOURCE CODE Program Tarif Travel Bus JavaScript
Pada dasarnya dalam JavaScript terdapat dua macam pernyataan percabangan yaitu if..else dan switch. berikut SOURCE CODE Program Tarif Travel Bus JavaScript
https://1.bp.blogspot.com/-f0RD_2586jM/VuVAOnZuRWI/AAAAAAAAAtg/rxYgbbFM230yddlDdqEewTORT-Sms-rlg/s640/jv%2Bif1.png
https://1.bp.blogspot.com/-f0RD_2586jM/VuVAOnZuRWI/AAAAAAAAAtg/rxYgbbFM230yddlDdqEewTORT-Sms-rlg/s72-c/jv%2Bif1.png
HI-CODDING
http://www.hi-codding.net/2016/03/source-code-program-tarif-travel-bus-javascript.html
http://www.hi-codding.net/
http://www.hi-codding.net/
http://www.hi-codding.net/2016/03/source-code-program-tarif-travel-bus-javascript.html
true
5256670903611799845
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy