Vassil_Iliev

SoftUni exercise part One and Two

Feb 8th, 2022
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Sqaure area
  2. function squareArea(input){
  3.   let a = Number(input[0]);
  4.   let area = a * a;
  5.   console.log(area);
  6. }
  7.  
  8. //Inches to cm
  9. function inchesToCm(input){
  10.  
  11.   let inch = input[0];
  12.   let cm = inch * 2.54;
  13.   console.log(cm);
  14. }
  15.  
  16. //Concatanate data
  17. function concatenateData(input){
  18.   console.log(`You are ${input[0]} ${input[1]}, a ${input[2]}-years old person from ${input[3]}.`);
  19. }
  20.  
  21. //Projects creation
  22. function projectTime(input) {
  23.     let arcName = input[0];
  24.     let numOfProjects = Number(input[1]);
  25.     let timeNeeded = numOfProjects * 3;
  26.  
  27.     console.log(`The architect ${arcName} will need ${timeNeeded} hours to complete ${numOfProjects} project/s.`);
  28. }
  29.  
  30. //Pet shop
  31. function petShop (input){
  32.  
  33.   let dogFood = Number(input[0]) * 2.5;
  34.   let catFood = Number(input[1]) * 4;
  35.    console.log(`${dogFood + catFood} lv.`);
  36. }
  37.  
  38. //Yard greening
  39. function greening(input){
  40.  
  41.  let price = Number(input[0]) * 7.61;
  42.   let discount = price * 0.18;
  43.   let finalPrice = price - discount;
  44.   console.log(`The final price is: ${finalPrice} lv.`);
  45.   console.log(`The discount is: ${discount} lv.`);
  46. }
  47.  
  48. //PARTO TWO
  49.  
  50. //USD to BGN
  51. function coverter(input){
  52.   leva = input[0] * 1.79549;
  53. console.log(leva);
  54. }
  55.  
  56. //Radians to degrees
  57. function angleToDegrees (angles){
  58.   let anglesToDegrees = parseFloat(angles[0]) * 180 / Math.PI;
  59.   console.log(anglesToDegrees);
  60. }
  61.  
  62.  
  63. //Deposit calculator
  64. function depositCalculator(input) {
  65.     let depoziranaSuma = Number(input[0]);
  66.     let srokNaDepozita = Number(input[1]);
  67.     let lihvenProcent = Number(input[2]);
  68.  
  69.     let deposit = depoziranaSuma + srokNaDepozita * ((depoziranaSuma * (lihvenProcent / 100)) / 12);
  70.     console.log(deposit);
  71. }
  72.  
  73. //Vacation booklist
  74.  
  75. function reading(input) {
  76.  
  77.     let broiStranici = input[0];
  78.     let straniciPerHour = input[1];
  79.     let dni = input[2];
  80.     let hoursPerBook = broiStranici / straniciPerHour;
  81.     let howMuchHourdPerDay = hoursPerBook / dni;
  82.     console.log(howMuchHourdPerDay)
  83.  
  84. }
  85.  
  86. //Supplyes for school
  87. function malkataOtivaDaPazaruva(input) {
  88.     let broiHemikali = input[0];
  89.     let broiMarkeri = input[1];
  90.     let litriPreparat = input[2];
  91.     let procentNamalenie = input[3];
  92.  
  93.     let cenaZaVsichko = (input[0] * 5.80) + (input[1] * 7.20) + (input[2] * 1.20);
  94.     let prispadnatiPari = cenaZaVsichko * (input[3] / 100);
  95.     let finalnaSuma = cenaZaVsichko - prispadnatiPari;
  96.     console.log(finalnaSuma);
  97. }
  98.  
  99. //Repainting
  100. function repainting(input) {
  101.     let nylon = Number(input[0]);
  102.     let paint = Number(input[1]);
  103.     let razreditel = Number(input[2]);
  104.     let chasoveMaistori = Number(input[3]);
  105.     let torbichki = 0.4;
  106.     let nylonPrice = (nylon + 2) * 1.5;
  107.     let paintPrice = paint * 14.5;
  108.     let razreditelPrice = razreditel * 5;
  109.  
  110.     let sumOfMaterials = (nylonPrice + paintPrice + razreditelPrice) + ((paint * 0.1) * 14.5) + (torbichki);
  111.     let rabotniciPayment = (sumOfMaterials * 0.30) * chasoveMaistori;
  112.     let total = sumOfMaterials + rabotniciPayment;
  113.     console.log(total);
  114. }
  115.  
  116. //Food delivery
  117. function restaurant(input) {
  118.  
  119.     let chickOrder = Number(input[0]);
  120.     let fishOrder = Number(input[1]);
  121.     let vegOrder = Number(input[2]);
  122.     let sum = (chickOrder * 10.35) + (fishOrder * 12.40) + (vegOrder * 8.15);
  123.     let desert = sum * 0.2;
  124.     let total = sum + desert + 2.5;
  125.     console.log(total);
  126.  
  127. }
  128.  
  129. //Basketball equipment
  130. function basketBall(input) {
  131.     let yearlyTax = Number(input);
  132.     let sneakers = yearlyTax - (yearlyTax * 0.4);
  133.     let clothes = sneakers - (sneakers * 0.2);
  134.     let ball = clothes / 4;
  135.     let acessories = ball / 5
  136.     let sumOfAll = yearlyTax + sneakers + clothes + ball + acessories;
  137.     console.log(sumOfAll)
  138. }
  139.  
  140. //Fish tank
  141. function fishTank(input) {
  142.     let a = Number(input[0]);
  143.     let b = Number(input[1]);
  144.     let c = Number(input[2]);
  145.     let percentBlocked = Number(input[3]);
  146.  
  147.     let v = a * b * c;
  148.  
  149.     let blockedSpace = v * (percentBlocked / 100);
  150.     let freeSpace = v - blockedSpace;
  151.     let neededWater = freeSpace * 0.001;
  152.     console.log(neededWater);
  153.  
  154. }
Advertisement
Add Comment
Please, Sign In to add comment