LMU ☀️ CMSI 185
COMPUTER PROGRAMMING
HOMEWORK #2 Due: 2020-09-29

Objectives

In this assignment you will demonstrate knowledge of computing as a discipline, practice your writing skills, and show that you can write simple front-end-only web applications using HTML, CSS, and Vanilla JavaScript.

Instructions

Do the readings, watch the videos, write the essays, and program the applications below.

Submit, via Brightspace, the following:

Readings and Videos

Just read and/or watch the following. You do not have to take notes or write reports on them; however, don’t cheat yourself by skipping them. These independent learning units must be done individually, but please feel free to discuss these items with your friends and classmates. You are encouraged to share your thoughts on these materials on course community channels (Brightspace Forums, Slack, Discord), and to post related items your classmates might be interested in. We learn together. Some of these resources have links to other resources, which you may wish to follow as time allows.

Writing

Many of these questions refer to the readings, videos, and activities above. Some questions may require additional research to answer well enough for full credit.

  1. Make a list of 10 titles from ACM Tech News from the last two years, that demonstrate the breadth of computing as a field. Find some cool things, especially titles that indicate uses of computer science beyond the false stereotypes held by many people. Read the article summaries, but submit only the titles and the dates.
  2. Why exactly is Alan Turing so revered as the founder of what we call Computer Science? Give two reasons that set him apart. Don’t just remark that he helped to design the ACE computer or helped to break codes in World War II. Those are not significant enough to be the founder of a new discipline.
  3. What was the main argument made in the New York Times article assigned above for our universe being a simulation? (Hint: the argument is that one of three conditions in our universe hold. What exactly are those three conditions?) What other arguments can you think of that were not mentioned in the article? Are there any serious arguments against this position? If so, find one and summarize it. (Do not write an essay here; please be brief.)
  4. Invent, or find (via web searching or asking friends), 10 sentences or newspaper headlines that exhibit a kind of structural ambiguity, such as “SEVEN FOOT DOCTORS SUE HOSPITAL.” Don’t use phrases like “RED TAPE HOLDS UP BRIDGE” because the ambiguity in the latter sentence is one of meaning only (both interpretations have the same sentence structure).
  5. In Bret Victor’s Inventing on Principle video (assigned in the readings and videos section above), what exactly are the problems with modes?
  6. In the Turkle and Papert paper, what are the characteristics of planners and of bricoleurs? Try to make your lists fairly comprehensive, based on your reading of the paper. Which kind of learning do you most identify with, and why? Or do you see yourself as equally at home in either style? You don’t have to give a deeply personal narrative, but give an example that shows you understand the distinctions made in the article.

Programming

Implement the web applications below using Vanilla JavaScript (no React or p5.js for now, you can use these technologies in future assignments). You must a good deal of effort into your styling. Make sure that you cover, in at least one of the programs, each of the following: borders, margin, padding, alignment, color, background images, text font, text size, text shadow, at least one CSS transformation, and at least one CSS transition.

  1. Write a nice web application in which a string of text you enter into a textbox is rendered, as you type, appended to itself twice. For example, if the user inputs "ho", your script should show "hohoho". If the user inputs "888", your script should show "888888888". (Hint: use string.repeat.)
  2. Write a nice web application in which you type a number into a number box (in base-10) and you see the base-16 equivalent appearing as the value in the box changes. Use an HTML input element with type="number" for the input. (Hint: After getting the value from the text box, apply Number(____) to the value to get a numeric value. To covert a number n to base-16, use n.toString(16).)
  3. Write a nice application with two text fields for entering dates and that writes out the number of days between the two dates. As always, make sure the program constantly updates your output as the input boxes change. (Hint: The HTML input element with attribute type="date" will provide you with fancy input widgets and guarantee their value properties will be strings that can be converted to legal dates with new Date(____). Subtracting two dates in JavaScript will give you the number of milliseconds between the two dates. From the number of milliseconds you should be able to compute the number of days.)

Grading

Here’s the rubric I’ll use to score your submission.

RequirementOut OfYou got
Ten articles chosen show depth of computing field5
Reasons given for Alan Turing being consider the founder of CS are worthy of one being called the found er a field5
Three conditions in the simulation argument are well articulated5
You elaborated on arguments against this argument5
10 structurally ambiguous sentences / headlines5
Problems with modes are well articulated5
Nice, complete, and understandable list of characteristics of planners and bricoleurs5
Text Repeater App works as specified10
Hexadecimal App works as specified10
Days-between-dates App works as specified10
Your code was tidied (perfection demanded) Use a formatter, but remember these tools generally cover only indentation and spacing; vertical space and capitalization are up to you5
Code uses good names5
Code is broken down into well-named functions (and no overly-long ones)5
Code uses variables where necessary (few or no magic numbers)5
Your apps look good, clean, and balanced, with nice aesthetics (no garish colors, no misalignment)4
CSS border used1
CSS margin used1
CSS padding used1
CSS alignment used1
CSS color used1
CSS background image used1
CSS font used1
CSS font size used1
CSS text-shadow used1
CSS transform used1
CSS transition used1
Misc. Bonus points or penalties at discretion of Prof.0
Total100