Create a program in JAVASCRIPT that stores information about vehicles in an obje
ID: 3561240 • Letter: C
Question
Create a program in JAVASCRIPT that stores information about vehicles in an object. The properties to be stored should include Make, Model, Year, and Color. Write code that will display these properties using a single alert statement. I am having a really hard time with this and really need to see it with explinations. This class requires a .css .html and .js file to be created for all assignments and I'm just not getting how to do it from my text book as it only gives snippets of examples rather than showing something completed and our lectures are just poswer point slides taken from the book. Any help it greatly appreciated!!!!
Explanation / Answer
class Car
{
var Make : String;
var Model : String;
var Year : Integer;
var Color : String;
var FullName : String;
function Car (make, model, year, color) {
this.Make = make;
this.Model = model;
this.Year = year;
this.Color = color;
this.FullName = this.Year + " " + "<b>" + this.Make + "</b> " + this.Model;
}
}
var mySUV = new Car("Toyota", "4Runner SR5",2001, "Thundercloud");
document.write ("I drive a " + mySUV.FullName);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.