Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this activity you will create a web page with a Javascript-enabled decision-support system (DSS) to select a car. The is a problem-based learning activity
In this activity you will create a web page with a Javascript-enabled decision-support system (DSS) to select a car.
The is a problem-based learning activity designed to expose you early to some central Javascript programming concepts.
Here are the steps:
- Create a standard IST 256 directory called carsdss with the standard three sub-directories: images, styles, and scripts.
- At the root level of carsdss create an html file called carsdss.html
- In carsdss.html create a link to a file in the scripts directory called scripts.js
- Create the file scripts.js in the scripts subdirectory
- In the body of carsdss.html create level 1 heading with the text: Car Selector
- In the body of carsdss.html create three level 3 headings with the IDs: car1, car2, and car3, and the text: Car 1, Car 2, and Car 3 respectively.
- Test your html file
- Add the code: alert("JS loaded"); to the top of your scripts file, then test your html again to ensure the JS link is working
- If your link is working comment out the line you just added above
- In scripts.js create three object variables called car1, car2, and car3.
- Each of these objects should have four attributes: model (string), price, performance, and reliability (all numbers).
- Set the model values to your three favorite cars and set the price, performance, and reliability values to a number between 1 and 10.
- To each of the objects above add a getScore function that returns the sum of price, performance, and reliability.
- Now, set the text of the three level 3 headings to a string consisting of the model and score of each of the cars from your objects.
- For example, the heading 3 with the ID car1 gets the model and score from the JS object variable car1
- So a heading 3 value should look like this: Porche 911 - Score: 22 (include the hyphen, and the "Score:" string your text.
- Once your DSS is working zip the entire cardss project directory and submit to Canvas.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started