CODESISTANCE

CodeHS Assistance

Html/CSS/JavaScript & Karel Answers With Explanations

DISCLAIMER: SOME OF THESE ANSWERS ARE NOT REALLY MINE BUT COPIED OFF OF THE INTERENET

JavaScript

Programming Applications:

Daily Activities:

Code:

function start(){
	var partOfDay = "morning,";
	
	var time = 8;
	
	time=8;
	println("in the " + partOfDay + " I woke up at " + time );

partOfDay = "afternoon,";
time=12;
    println("in the " + partOfDay + "I woke up at " + time );
    
    partOfDay = "evening,";
time=11;
    println("in the " + partOfDay + "go to bed at " + time );
}

Explanation:

  1. You make a variable called "partofday" with the valur being "morning"
  2. You make a variable called "time" with the value being 8
  3. You set the value of "time" to 8
  4. you print "in the" then you add partofday which has a value of "morning" then you add "I woke up at" then you add time which has a value of 8
  5. You then change the values of partofday and time and repeat

Dinner Plans:

Code:

function start(){
	var name= readLine("Hi, What is your name?" );
	println("hello" + name + "nice to meet you" );
	
	var age = readInt("What is your age? ");
	println("You are " + age + " years old.");
}

Explanation:


T-Shirt Shop:

Code:


         

Explanation:


Running Speed:

Code:


         

Explanation:



Flag of The Netherlands:

Code:


         

Explanation:


Snowman:

Code:


         

Explanation:



Writing In the Console:

Code:


         

Explanation:


Alert Introduction:

Code:


         

Explanation:


Debugging The Console

Code:


         

Explanation:




Control Structures:

Snake Eyes:

Code:

function main(){
let die1 = Randomizer.nextInt(1,6);
let die2 = Randomizer.nextInt(1,6);
let rolls = die1 + die2;
let isroll = die1 == die2;
let attempts = 0;
let run=true;

while (isroll == true) {
    console.log("you rolled" + rolls);
    attempts = attempts++;
   if (die1 == die2){
        break;
    }
}
console.log("It took you " + attempts + " rolls to get snake eyes.");
}
main();

Explanation:


Better Password Prompt:

Code:

function main(){
    let correct="abc123";
    let password = readLine("Enter password: ");
    let run = password != correct;
    while (run == true){
        console.log("Sorry, that did not match. Please try again.");
        password = readLine("Enter password: ");
        if (password == correct){
            break;
        }
    }
    console.log("You got it!");
}
main();

Explanation:

Karel

Concepts Of Programming

Your First Karel Program:

Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:

Programming Application

HTML/CSS

Web Design:

The <title> Tag:

Code:


                

Explanation:


Your First HTML Page:

Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation:


Code:


                

Explanation: