This is a JSFiddle assignment and must be completed at jsfiddle.net and include
ID: 3579155 • Letter: T
Question
This is a JSFiddle assignment and must be completed at jsfiddle.net and include both the HTML and Java sections
Also common in programming is the use of Caffeine ( https://en.wikipedia.org/wiki/Caffeine )
So you will get to have a little fun with this assignment. You will model a caffeine molecule as a graph and present that computer model. Edges that are single bonds should be presented with a weight of 1, with a double bond - they should have a weight of 2.
Build your model as a Graph. The graph should be able to print all of its Nodes with each adjacent node. You can have a print button or simply call it when the Graph is built.
Output:
H (C) <- there will be 9 of these
C (N,H) <- there will be 3 of these
N (C, C, C) <- there are 3 of these
N (C, C) <- only one of these
etc....
etc...
for each element and combination of connected element
Explanation / Answer
javascript:
function scoped() {
var $parent = $("#fullContent");
$("div", $parent);
}
function find() {
var $parent = $("#fullContent");
$parent.find("div");
}
function childrenMethod() {
var $parent = $("#fullContent");
$parent.children("div");
}
function childrenSelector() {
$("#fullContent > div");
}
function childrenFilter() {
$("#fullContent div");
}
JSLitmus.test('$(.., parent)', scoped);
JSLitmus.test('parent.find(..)', find);
JSLitmus.test('parent.children(..)', childrenMethod);
JSLitmus.test('$("parent > children")', childrenSelector);
JSLitmus.test('$("parent children")', childrenFilter);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.