r/codehs • u/OceanMan228 • Jan 19 '22
r/codehs • u/RetroZilla • Dec 18 '21
Anyone have this? I have 1 correct but don’t know how to return the word 3 times without getting it incorrect.
r/codehs • u/Jahall242 • Dec 15 '21
Help with 8.3.5 Max in list? It shows one test failed but all others work
r/codehs • u/Sad-Ad2226 • Dec 04 '21
3.5.9 Recipe codehs
I need help with this code could someone please help
r/codehs • u/Superslash515 • Dec 03 '21
JavaScript Array Average Error, not finding defined method??
r/codehs • u/MaidenChinah • Nov 29 '21
Java I just don’t know how to solve this? Desperate help is needed
r/codehs • u/zephyr0021 • Nov 24 '21
I broke the code for 5.7.5 (managing change) in CodeHS if someone has the answers that would be awesome!
r/codehs • u/Future-Honey7201 • Nov 16 '21
r/codehs 4.8.4
5oco So when I fixed my code It popped up this error:

r/codehs • u/prjkt_fluxx • Oct 29 '21
7.8.4 Simulating a Coin Flip (help)
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 • u/Nerd_co • Oct 19 '21
Help with 3.4.4 Java latte
Hey does anyone know how to do 3.4.4 of the range, I'm kind of stuck.
r/codehs • u/JonsTheWizard • 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?
r/codehs • u/YourmamabigGey • Sep 28 '21
Python Hey guys can you help me with this im entirely lost and teacher is not very helpful
r/codehs • u/5oco • Sep 22 '21
Other Can the mods make a sticky post?
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 • u/Striking-Crazy6082 • Sep 02 '21
code hs 1.19.5: Invert Colors
i need help with 1.19.5: Invert Colors
r/codehs • u/Dangerous-Ad6671 • Jun 08 '21
5.4.4 quotes
Can someone help me out with this?
r/codehs • u/OrethaFolkers • May 27 '21
Please help! (Karel Challenges 2.1.2)
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 • u/RangerSweet1676 • May 16 '21
New problems
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 • u/EngineeringOk6737 • May 14 '21
Triple Double 2.8.4 (JAVA)
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 • u/ReasonablePurpose422 • May 03 '21
need help with 4.1.5: Plants
needs_water= True
needs_to_be_repotted=False
print "Needs water: "+ str(needs_water)
print "Needs to be repotted: "+str(needs_to_be_repotted)







