Advertisement
Guest User

Gottabemoist's code

a guest
Jan 22nd, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. //This is the question
  2. //– Write a function that determine the total daily income from Miller’s Car Rental; the
  3. //function will accept three parameters/arguments and return a value; make sure that the
  4. //function can be used by other programs if needed. (Note: for this use local and global
  5. //variables, if needed)
  6. //Using the same information, build a rectangle filled with “$” that has a base and height
  7. //equal with 2 of your information like below (your choice):
  8. // $$$$$$$$$$$$$$$$$$$$$
  9. // $$$$$$$$$$$$$$$$$$$$$ height
  10. // $$$$$$$$$$$$$$$$$$$$$
  11. // $$$$$$$$$$$$$$$$$$$$$
  12. base
  13. //This is what ive got so far
  14.  
  15. function daily() { //this is the function
  16.  
  17. let n = prompt("How many necessity vehicles?"); //This is the prompt for the necessity vehicles
  18. let Member = prompt("Whats the total of the members purchase vehicles"); //this is the prompt for how many members purchsed vechicles
  19. let NonMember = prompt ("Whats the total of the non-Member purchase vehicles"); //this is the prompt for how many non memebers purchased vehicles
  20.  
  21. let tN
  22. tN = n*55 //Necessity vechile multiplied by 55
  23.  
  24. let totalMember
  25. totalMember = Member*75 //How many members multiplied by 75
  26.  
  27. let totalnonMember
  28. totalnonMember = NonMember*85 //How many non Members multiplied by 85
  29.  
  30. let total
  31. total = totalMember + totalnonMember + tN //Total number of members plus total number of non members plus number of necessity vehicles
  32. return total.toFixed(2)
  33.  
  34.  
  35. console.log("The everyday income total =" + total) //To display the total
  36.  
  37. }
  38. daily()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement