Question: / / declare variables var name = getColumn ( TheRoot: 1 0 0 Influential African Americans, Name ) ; var rank = getColumn (
declare variables
var name getColumnTheRoot: Influential African Americans", "Name";
var rank getColumnTheRoot: Influential African Americans", "Rank";
var profession getColumnTheRoot: Influential African Americans", "Profession";
var followers getColumnTheRoot: Influential African Americans", "Twitter Followers";
var sector getColumnTheRoot: Influential African Americans", "Sector";
Gets the rank of a specified influencer
If the celebName matches a name in the name list,
return the celeb rank
function getRankcelebName
for var i; i name.length; i
if celebName namei
return ranki;
console.logGet Stacey Abrams rank :getRankStacey Abrams";
console.logGet Beyonc rank :getRankBeyonc;
console.logGet Allyson Felix rank :getRankAllyson Felix";
Gets the profession of a specified influencer
If the celebName matches a name in the name list,
return the celeb profession
function getProfessioncelebName
for var i; i name.length; i
if celebName namei
return professioni;
console.log
Get Stacey Abrams profession Politician:getProfessionStacey Abrams";
console.logGet Beyonc profession Entertainer Entrepreneur:getProfessionBeyonc;
console.logGet Allyson Felix profession Track Champion:getProfessionAllyson Felix";
Gets the followers of a specified influencer
If the celebName matches a name in the name list,
return the celeb followers
function getFollowerscelebName
for var i; i name.length; i
if celebName namei
return followersi;
console.log
Get Stacey Abrams followers :getFollowersStacey Abrams";
console.logGet Beyonc followers :getFollowersBeyonc;
console.logGet Allyson Felix followers :getFollowersAllyson Felix";
Gets the sector of a specified influencer
If the celebName matches a name in the name list,
return the celeb followers
function getSectorcelebName
for var i; i name.length; i
if celebName namei
return sectori;
console.log
Get Stacey Abrams sector Politics:getSectorStacey Abrams";
console.logGet Beyonc sector Entertainment:getSectorBeyonc;
console.logGet Allyson Felix sector Sports:getSectorAllyson Felix";
Compare the rank of two celebs
Return the influencer with more rank
function compareRankceleb celeb
ifgetRankceleb getRankceleb
return celeb;
else
return celeb;
console.log
Compare rank of Stacey and Beyonce Stacey:compareRankStacey Abrams", "Beyonc;
console.logCompare rank of Beyonce and Allyson Beyonce:compareRankAllyson Felix", "Beyonc;
console.logCompare rank of Stacey and Allyson Stacey:compareRankStacey Abrams", "Allyson Felix";
Compare the followers of two celebs
Return the influencer with more followers
function compareFollowersceleb celeb
ifgetFollowersceleb getFollowersceleb
return celeb;
else
return celeb;
console.log
Compare followers of Stacey and Beyonce Beyonce:compareFollowersStacey Abrams", "Beyonc;
console.logCompare followers of Beyonce and Allyson Beyonce:compareFollowersAllyson Felix", "Beyonc;
console.logCompare followers of Stacey and Allyson Allyson:compareFollowersStacey Abrams", "Allyson Felix";
Returns list of influencers in a named sector
function getListOfCelebsInSectorcelebSector
var celebList ;
forvar i; i
Can you make a minigame with this code in code.org where you have to guess something with an image and if you get it right it gives you a happy screen and if you get it wrong you can try again but it tells you its wrong using the functions from this library with an if statemnt and parameters?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
