# javascript

ana aguilar
javascript
1 Answer(s)      6 years and 10 months ago
Posted in : Java Beginners

write a java script program that would input the ff:Student Name,Average,Tuition Fee and output Total Tuition Fee. Formula: Total Tuition Fee=Tuition Fee-Discount If average is: 95-100 100% discount 90-94 25% 85-89 10% 84 and below no discount Sample Output: Student Name:_ Average:_ Tuition Fee:_ Discount:_ Total Fee:__

November 25, 2010 at 4:51 PM

Hi Friend,

Try the following code:

<html>
<script>

function findDiscount(){
var total;
var discount;
var sname=document.form.name.value;
var average=document.form.average.value;
var fee=document.form.tfee.value;
if(average>=95)
{
discount="100%";
total=0;
}
else if(average>=90&&average<=94){
discount=0.25*fee;
total=fee-discount;
}
else if(average>=85&&average<=89){
discount=.10*fee;
total=fee-discount;
}
else if(average<=84){
discount="No Discount";
total=fee;
}
document.writeln("Student Name: "+sname+"<br>");
document.writeln("Average: "+average+"<br>");
document.writeln("Tution Fee: "+fee+"<br>");
document.writeln("Discount: "+discount+"<br>");
document.writeln("Total Fee: "+total);
}
</script>
<form name="form">
<table>
<tr><td>Student Name:</td><td><input type="text" name="name"></td></tr>
<tr><td>Average of Marks:</td><td><input type="text" name="average"></td></tr>
<tr><td>Tution Fee:</td><td><input type="text" name="tfee"></td></tr>
<tr><td></td><td><input type="button" value="Submit" onclick="findDiscount();"></td></tr>
</table>
</form>

Thanks

JavaScript
JavaScript  clone JavaScript
javascript
Javascript
Javascript  How validations are done using javascript ,with example? and interview questions on javASCRIPT
JavaScript
should use JavaScript? Thanks   Hi, JavaScript is scripting language that runs on browser. You have to embed JavaScript in HTML page. Please see JavaScript tutorial. Thanks
JavaScript
JavaScript  how to get full path of a file type in javascript
javascript
javascript  Hi deepak, how to write form validation on javascript
javascript
javascript  write a program to display implement about browsers using javascript
javaScript
javaScript  How to open a browser window that cannot be resized? (HTML + Javascript
javascript
javascript  i have just learned javascript... can you tell me what kind of applications can be made by javascript?? thank you
javascript
javascript  how to set the request or session attribute in javascript head part of jsp page
javascript
javascript  Hi sir, This is sinduri, i want to learn javascript, so plz can u help me.how to learn
javascript
javascript  hi sir, if i want to learn javascript. what concepts i want to know
JAVASCRIPT
JAVASCRIPT  I have one textbox and I want to validate that it must start with number(1-0). can anyone tell me a javascript for that ? thanks in advance
Javascript
Javascript   Javascript to check Numeric entry in checkbox.....   Hi Please find the following code for numeric entry validation in javascript function validateBox(){ var data=document.myForm.someText.value
javascript
javascript  hi, I was actually working on to calculate the number of days between two dates of yyyy-mm-dd format using javascript, and when i click on button then number of days should be display in textbox
javaScript
javaScript  . Print a table like below in JAVASCRIPT 5 x 1 = 5 5 x 2 = 10 ΓΆβ?¬Β¦ΓΆβ?¬Β¦ΓΆβ?¬Β¦. 5 x 20 = 100
javascript
javascript  passing javascript values to jsp   Hi Friend, Try the following code: form.jsp: <html> <script> function getMsg...;/script> <input type="button" onclick="getMsg();" value="Get Javascript value
Javascript
this format xxx-xxx-xxxx, i want the code in javascript. as a function.   Javascript Phone Number Validation <html> <script> function..." method="post" onsubmit="javascript:return validate();"> Phone Number:<
Javascript
Javascript  Dear Sir, Thank You a lot for your continuos support.Again i am in need of your help. What is the javascript code to disable a link,once... javascript or css Please help me.Urgent Regards Debasis   Hello Friend
Javascript
Javascript  <html> <head> <script type="text/javascript"> function validateForm() { var sname=document.getElementById('spocname'); var scontact=document.getElementById('spoccontact'); if(sname.value.length
javascript
javascript  how to create random question using javascript?   <html> <script> function displayQuestions() { document.getElementById("text").value=" "; var Questions = new Array(20
javascript
javascript  Hi deepak, sample example on javascript form validation   <html> <script> function checkName(text) { if(isNaN(text)){ return 1; } else{ alert("Please enter a valid name. The only charachters
JavaScript types
JavaScript types  What are JavaScript types
javascript doubt
javascript doubt  How to retrieving the values from Database by using javascript
JavaScript and ECMAScript
JavaScript and ECMAScript  What?s relationship between JavaScript and ECMAScript
javascript validation
javascript validation  validation of comparing dropdownlist and textbox in javascript
JavaScript - JavaScript Tutorial
JavaScript Tutorials is one of the best Quick reference to the JavaScript. In this JavaScript reference you will find most of the things about java script. JavaScript tutorial is classified into sections with examples. This tutorial
JavaScript - JavaScript Tutorial
JavaScript Tutorials is one of the best Quick reference to the JavaScript. In this JavaScript reference you will find most of the things about java script. JavaScript tutorial is classified into sections with examples. This tutorial
Prototypes for JavaScript
Prototypes for JavaScript  What's Prototypes for JavaScript