This commit is contained in:
2020-01-29 12:56:06 +01:00
commit 04efff0d15
51 changed files with 1673 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
//Oppgave a
const priceSum = 857;
const discountNum = 0.25;
const tipNum = 0.1;
//Oppgave b
/*Jeg antar at tipsen blir regnet ut før rabatten er påført*/
let totalPrice = (priceSum - (discountNum*priceSum) + (tipNum*priceSum));
//Oppgave c
const personNum = 5;
const pricePerPerson = (totalPrice/personNum).toFixed(2);
console.log("Antall personer: " + personNum);
console.log("Pris per person: " + pricePerPerson + "kr");