Question: 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:

  1. Create a standard IST 256 directory called carsdss with the standard three sub-directories: images, styles, and scripts.
  2. At the root level of carsdss create an html file called carsdss.html
  3. In carsdss.html create a link to a file in the scripts directory called scripts.js
  4. Create the file scripts.js in the scripts subdirectory
  5. In the body of carsdss.html create level 1 heading with the text: Car Selector
  6. 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.
  7. Test your html file
  8. 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
  9. If your link is working comment out the line you just added above
  10. In scripts.js create three object variables called car1, car2, and car3.
  11. Each of these objects should have four attributes: model (string), price, performance, and reliability (all numbers).
  12. Set the model values to your three favorite cars and set the price, performance, and reliability values to a number between 1 and 10.
  13. To each of the objects above add a getScore function that returns the sum of price, performance, and reliability.
  14. 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.
    1. For example, the heading 3 with the ID car1 gets the model and score from the JS object variable car1
    2. So a heading 3 value should look like this: Porche 911 - Score: 22 (include the hyphen, and the "Score:" string your text.
  15. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!