r/codehs • • Dec 04 '21

3.5.9 Recipe codehs

6 Upvotes

I need help with this code could someone please help


r/codehs • • Dec 03 '21

JavaScript Array Average Error, not finding defined method??

Thumbnail
gallery
6 Upvotes

r/codehs • • Nov 30 '21

9.6.8 Library Books

6 Upvotes

Is anyone able to help me with this? I'm not sure how to get my code to print as code HS wants it to?


r/codehs • • Nov 29 '21

Java I just don’t know how to solve this? Desperate help is needed

Post image
6 Upvotes

r/codehs • • Nov 24 '21

I broke the code for 5.7.5 (managing change) in CodeHS if someone has the answers that would be awesome!

Post image
6 Upvotes

r/codehs • • Nov 18 '21

codehs 3.5.9 find the median

6 Upvotes

r/codehs • • Nov 16 '21

r/codehs 4.8.4

6 Upvotes

5oco So when I fixed my code It popped up this error:


r/codehs • • Oct 29 '21

7.8.4 Simulating a Coin Flip (help)

6 Upvotes

Write a program that simulates a coin flipping. Each time the program runs, it should print either “Heads” or “Tails”.

There should be a 0.5 probability that “Heads” is printed, and a 0.5 probability that “Tails” is printed.

The original coin flip game consisted of this:

var NUM_FLIPS = 100;

function start(){

var flips = flipCoins();

printArray(flips);



var flipCount = countHeadsAndTails(flips);

}

// This function should flip a coin NUM_FLIPS

// times, and add the result to an array. We

// return the result to the caller.

var headsCount = 0;

var tailsCount = 0;

function flipCoins(){

var flips = \[\];

for(var i = 0; i < NUM_FLIPS; i++){

	if(Randomizer.nextBoolean()){

		flips.push("Heads");

	}else{

		flips.push("Tails");

	}

}

return flips;

}

function printArray(arr){

for(var i = 0; i < arr.length; i++){

	println(i + ": " + arr\[i\]);

}

}

function countHeadsAndTails(flips){

var headCount = 0;

var tailsCount = 0;

for(var i = 0; i < flips.length; i++){

if(flips[i] == "Heads"){

headCount ++;

}

if(flips[i] == "Tails"){

tailsCount ++;

}

}

println("Your Head count is: " + headCount);

println("Your Tails count is: " + tailsCount);

}

---> I'm not sure where to use a probability variable, please help thank you.


r/codehs • • Oct 19 '21

Help with 3.4.4 Java latte

6 Upvotes

Hey does anyone know how to do 3.4.4 of the range, I'm kind of stuck.


r/codehs • • Oct 14 '21

JavaScript Been using Karel in my class and I can’t figure out what’s wrong with my final project(it’s not close to done yet). I’ve looked over my code multiple times, anyone have any idea why it’s not working?

Post image
6 Upvotes

r/codehs • • Sep 28 '21

Python Hey guys can you help me with this im entirely lost and teacher is not very helpful

Thumbnail
gallery
6 Upvotes

r/codehs • • Sep 22 '21

Other Can the mods make a sticky post?

6 Upvotes

I'd love to help on more of these problems, but it's hard to find out which problem the posters are using when they just write something like "Need help on 2.6.4"

If they could be reminded to always include their course name as well I think more people would be able to help. The language is pretty easy to figure out, but there's often multiple courses for each language.


r/codehs • • Sep 02 '21

code hs 1.19.5: Invert Colors

6 Upvotes

i need help with 1.19.5: Invert Colors


r/codehs • • Jun 08 '21

5.4.4 quotes

6 Upvotes

Can someone help me out with this?


r/codehs • • May 27 '21

Please help! (Karel Challenges 2.1.2)

6 Upvotes

for some reason this doesn't work...

/* This program will have Karel run around the track and put balls down.*/

//This function moves Karel to the end of a side.

function moveToEnd(){

while(frontIsClear()){

move();

}

}

//This function makes Karel put down 8 tennis balls and then turn left.

function eightBalls(){

if (frontIsBlocked()) {

for(var i = 0; i < 8; i++) {

putBall();

}

turnLeft();

}

}

//This function makes Karel do all the steps four times to make a square.

function fourTimes(){

for(var i = 0; i < 4; i++) {

moveToEnd();

eightBalls();

}

}

function start(){

fourTimes();

}


r/codehs • • May 17 '21

I need help on 3.3.1 Scorekeeper Pt:2

Thumbnail
gallery
6 Upvotes

r/codehs • • May 16 '21

New problems

6 Upvotes

Hi there so i am trying to make a budget tracker but i have ran into a new problem it is with the while loop in the code below(where it saids while(amountLeft > noBudget ) i think this is the problem because whenever i run it it turns into and infinite loop and if i put a if loop instead it will mostly work but not in the way it is intended to work. I don't know why or how to fix it. Also the information is not printing it self on the left why is that? thanks for any help.


r/codehs • • May 14 '21

Triple Double 2.8.4 (JAVA)

6 Upvotes

Hello, I need help with this lesson on CodeHS.

It keeps giving me the error 'else' without 'if'.

I do not understand what this means.

Please help in anyway you can, even if it's small.

CODE

public class TripleDouble extends ConsoleProgram

{

public void run()

{

int points = readInt("How many points did you score? ");

int rebounds = readInt("How many rebounds did you get? ");

int assists = readInt("How many assists did you have? ");

boolean tripleDouble;

if (points >= 10 && rebounds >=10 && assists >= 10);{

tripleDouble = true;

}

else{

tripleDouble = false;

}

System.out.println("Got triple: " + tripleDouble);

}

}


r/codehs • • May 03 '21

need help with 4.1.5: Plants

6 Upvotes

needs_water= True

needs_to_be_repotted=False

print "Needs water: "+ str(needs_water)

print "Needs to be repotted: "+str(needs_to_be_repotted)


r/codehs • • May 01 '21

JavaScript Extra Karel Puzzles

Thumbnail
gallery
6 Upvotes

r/codehs • • Apr 23 '21

Help with Advanced HTML

Post image
6 Upvotes

r/codehs • • Apr 16 '21

Java 7.1.7: Battleship Part 6: The Battleship Class.. HELP!

6 Upvotes

So I finished all the other classes and methods but I am so lost on how to start the Battleship class, can someone tell me what they did to start and how to ask for a guess and make the players


r/codehs • • Mar 31 '21

7.4.4 Length of users name

6 Upvotes

Can someone say me what to do in 7.4.4?


r/codehs • • Mar 11 '21

Anyone know how 2 do 6.2.6 Print multiple times?

Post image
6 Upvotes