Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.   <body>
  3.       <script type= "text/javascript">
  4.  
  5.       // Program name: max of three
  6.       // Pourpoe: to see if math.max() command will argue 3 numbers
  7.       // Author: Alexander Pannunzio
  8.       // Date last modified: 14/2/2016
  9.  
  10.       // Decalring variables
  11.       var sales1;
  12.       var sales2;
  13.       var sales3;
  14.       var finalAmount;
  15.  
  16.       // Welcome the user
  17.       document.write("Welcome to the math.max program");
  18.  
  19.       // get input from the user
  20.  
  21.       sales1= prompt("Please enter the sale amount 1");
  22.        //gets value for sakes 1
  23.       sales2= prompt("Now enter the sale amount 2");
  24.       // gets value for sales2
  25.       sales3= prompt("Lastly enter the sale amount 3");
  26.       // gets value for sales 3
  27.  
  28.       parseFloat(sales1);
  29.       parseFloat(sales2);
  30.       parseFloat(sales3);
  31.  
  32.  
  33.  
  34.        finalAmount= math.max(sale1, sales2, sales3); // deals with the values mathmaticly
  35.  
  36.       // display the final results
  37.       document.write("The Result is " + finalAmount);
  38.  
  39.      // closing the program
  40.      document.write("Thanks for using my Program!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement