I need some help.
So I finished my code, and it worked pretty good. I used a site just to test if its actually working
I wanted to run it in my browser and I watched a tutorial. I did everything needed and had done everything correctly. So , I made the fall and named it with the .html and the end
I added this code:
<html>
<head>
<title></title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
As you can see, the script source is another file. (I tried this with the NetBeans IDE AND my computer files)
I run it, and there is nothing. Please help. Here is the code that I imput into the script.js file
let orderCount = 1;
const orderCar = (color, engine, design, interior, exterior) => {
orderCount++;
console.log(
"Color =" + color + " | Engine = " + engine + " | Design = " + design + " | Interior = " + interior + " | Exterior = " + exterior
);
}
orderCar(
'Raceyellow',
'V8',
'FrontStripes',
'Leather',
'Matte'
);
//
let priceByColor = {
Winered: 3500,
Red: 2500,
Yellow: 2000,
Raceyellow: 4000,
Black: 1000,
White: 1500,
Green: 3400,
};
const getColor = () => {
return priceByColor['Raceyellow']
};
//
let priceByEngine = {
V6: 5600,
V8: 7200,
V12: 9100,
};
const getEngine = () => {
return priceByEngine['V8']
};
//
let priceByDesign = {
FrontStripes: 300,
BackStripes: 200,
FullStripes: 500,
};
const getDesign = () => {
return priceByDesign['FrontStripes']
};
//
let priceByInterior = {
Red: 250,
Blue: 300,
Yellow: 150,
Black: 200,
};
const getInterior = () => {
return priceByInterior['Red']
};
//
let priceByExterior = {
CarbonLook: 5800,
Matte: 3000,
Metallic: 4500,
Pearlescent: 5000,
};
const getExterior = () => {
return priceByExterior['Matte']
};
//
let priceByCar = {
Sports: 38000,
Super: 50000,
Muscle: 25000,
Classic: 42000,
Average: 20000,
};
const getCar = () => {
return priceByCar['Muscle']
};
//
const getTotal = () => {
return getColor() + getEngine() + getDesign() + getInterior() + getExterior() + getCar();
};
console.log("");
console.log("The price of the whole car is " + getTotal() * 1.1);
//console.log("The car will be ready by ")
var dateObj = new Date();
var day = dateObj.getUTCDate();
var month = dateObj.getUTCMonth() + 1;
var year = dateObj.getUTCFullYear();
//newdate = year + "/" + month + "/" + day + "/";
var d = new Date();
var n = d.getFullYear();
//
console.log("");
console.log("The current date is " + year + "/" + month + "/" + day);
//
const getEstimate = () => {
return year + "/" + month + "/" + day + "/";
};
var someDate = new Date();
var daysToAdd = 10;
someDate.setDate(someDate.getDate() + daysToAdd);
console.log("");
console.log("Car completion estimated to be at " + someDate);
console.log("")
//
console.log(" #####" + " #" + " #" + " ###" + " ######" + " ####" + " #" + " #");
console.log("#" + " #" + " #" + " #" + " #" + " #" + " #" + " #" + " #" + "#" + " #");
console.log("#" + " #" + " #" + " ###" + " #" + " #" + " #" + " #" + " #" + "#" + " #");
console.log("#" + " #" + " #" + " #" + " #" + " #" + " #" + " #" + " #");
console.log("#" + " #" + " #" + " #" + " #" + " #" + " #" + " #" + " #");
console.log(" #####" + " ####" + " ####" + " #" + " ####" + " #" + " #");
console.log("");
console.log("");
console.log(" #####" + " #" + "#" + " #####");
console.log(" #" + " #" + " #" + " #" + " #");
console.log(" #" + " #" + "####" + "#" + " #" + "###");
console.log(" #" + " #" + " #" + " #" + " #");
console.log(" #" + " #" + " #" + " #" + " #");
console.log(" #####" + " #" + " #" + " #" + " #");
(and please explain it in a simple way i am a beginner and don’t know much about this)