CSCI 101: Intro to Computer Science
Assignment 4. Due: Mon, Jun 30
Solutions will be posted on Wed, Jul 2
Please ZIP all your work related to this assignment in a single archive hw4.zip and upload it on Canvas before midnight of the day above.
- (25 points)
Design an HTML + JavaScript code for solving quadratic equations
a·x2 + b·x + c = 0.
The user enters the coefficients
a, b, and c, and clicks the "Solve it" button.
The computer should display the solutions
x1 and x2. These numbers can be computed
according to the following formulas:
Your Project has to have a layout similar to the one shown below.
Solver of quadratic equations a·x2 + b·x + c = 0 - (25 points)
Modify the clock script designed in
class to display time not in the military form, but in the AM/PM form.
Leave only hours and minutes to be displayed (so, no seconds). For example,
"8:34 PM" should be displayed instead of "20:34".
Name your HTML file hw4_2.html - (25 points)
Modify the stopwatch script designed in
class to count minutes, seconds, and milliseconds. For example,
"1:02:5" should be displayed instead of "62.5".
Name your HTML file hw4_3.html - (25 points)
Design an HTML + JavaScript script that randomly selects and sets up
the background color of the document. The background color should be chosen
out of 10 colors of your choice stored in an array of colors. The background
color has to be changed each time the document is loaded by using the
onload event handler.
Name your HTML file hw4_4.html