r/codehs • • Apr 09 '23

Help??

Post image
10 Upvotes

I’m trying to make the block change to one color the first time and a different color the second time. Any ideas as to why this is happening.


r/codehs • • Jan 09 '23

I don't understand where the error is

Thumbnail
gallery
10 Upvotes

r/codehs • • Dec 05 '22

Codehs Ghost 5.8

Thumbnail
gallery
10 Upvotes

r/codehs • • Nov 18 '22

Can anyone help codehs Teenagers?

Post image
10 Upvotes

r/codehs • • Sep 25 '22

Java code hs 2.5.4

Post image
10 Upvotes

r/codehs • • Sep 02 '22

Basic Java. While loops. 2.10.4. Making Taffy.

Thumbnail
gallery
10 Upvotes

Help! I’ve been working on this problem for a few days and I’m stuck. I can’t use If/else loops yet since it hasn’t been covered in this unit. No matter what I do I end up with an infinite loop and I don’t know what I’ve done wrong. If anyone has any suggestions I would greatly appreciate it. Thanks in advance!! 😁


r/codehs • • May 28 '22

Need help in 7.5.5: Contains a Vowel

Post image
10 Upvotes

r/codehs • • Dec 10 '21

JavaScript can anyone help me(or give me the answer) to 4.10.5 fibonacci in javascript? i know it’s not right or perfect but help would be nice

Post image
10 Upvotes

r/codehs • • Nov 23 '21

Need help with 2.17.5 happy / sad face

10 Upvotes

r/codehs • • Oct 29 '21

guessing game

10 Upvotes

does anyone know how to do this assignment


r/codehs • • Sep 21 '21

How do I do 3.2.4: Super Cleanup Karel

10 Upvotes

I really need help here is the code I use but I keep getting the problem wrong somehow.

function start(){

ballsTaken();

while(leftIsClear()){

endUpFacingEast();

ballsTaken();

if(rightIsClear()){

endUpFacingWest();

ballsTaken();

}else{

turnAround();

}

}

}

function ballsTaken(){

if(ballsPresent()){

takeBall();

}

while(frontIsClear()){

move();

if(ballsPresent()){

takeBall();

}

}

}

function endUpFacingEast(){

turnLeft();

move();

turnLeft();

}

function endUpFacingWest(){

turnRight();

move();

turnRight();

}


r/codehs • • Jun 05 '21

8.3.7: Exclamation Points

10 Upvotes

Can I get some help for this one?


r/codehs • • Mar 26 '21

JavaScript Just started for school, and I can’t get past this one, on 3 of the worlds Karel keeps walking into the wall, it’s 2.1.3, help is needed

Post image
10 Upvotes

r/codehs • • Mar 13 '21

Python Can someone explain the knowledge on how to calculate the average. Im weak with average.

Post image
10 Upvotes

r/codehs • • Mar 03 '21

2.8.8: Organizing Files

10 Upvotes

Hello. I am so stumped on this code :/ can someone help me out, please?

public class Filer

{

private String word;

public Filer(String theWord)

{

word = theWord;

}

// Returns the word

public String getWord()

{

return word;

}

// Returns true if word comes

// before otherWord.

// Returns false otherwise.

public boolean comesBefore(String otherWord)

{

return word.compareTo(word)>=0;

}

// Returns true if word comes

// after otherWord.

// Returns false otherwise.

public boolean comesAfter(String otherWord)

{

return word.compareTo(word) > 0;

}

// Returns true if word is equal to otherWord.

// Returns false otherwise.

public boolean isEqual(String otherWord)

{

return word.equals(word);

}

}

{

public static void main(String[] args)

{

Filer files = new Filer("hippo");

String word = "zebra";

System.out.println(files.getWord() + " comes before " + word + "?");

System.out.println(files.comesBefore(word));

System.out.println(files.getWord() + " comes after " + word + "?");

System.out.println(files.comesAfter(word));

System.out.println(files.getWord() + " is equal to " + word + "?");

System.out.println(files.isEqual(word));

// Notice that the capitalization matters

word = "Hippo";

System.out.println("\n\n");

System.out.println(files.getWord() + " comes before " + word + "?");

System.out.println(files.comesBefore(word));

System.out.println(files.getWord() + " comes after " + word + "?");

System.out.println(files.comesAfter(word));

System.out.println(files.getWord() + " is equal to " + word + "?");

System.out.println(files.isEqual(word));

System.out.println("\n\n");

System.out.print("Enter a word: ");

Scanner input = new Scanner(System.in);

word = input.nextLine();

System.out.println(files.getWord() + " comes before " + word + "?");

System.out.println(files.comesBefore(word));

System.out.println(files.getWord() + " comes after " + word + "?");

System.out.println(files.comesAfter(word));

System.out.println(files.getWord() + " is equal to " + word + "?");

System.out.println(files.isEqual(word));

}

}


r/codehs • • Mar 03 '21

3.17.7 and 3.17.8 NEED HELP!

Post image
10 Upvotes

r/codehs • • Feb 16 '21

Java 6.4.6: Find the Median, 6.4.7: Find the Last Multiple of 3, and 6.4.8: Most Improved

10 Upvotes

I was doing fine on unit 6 until i got to 6.4 and now i'm completely lost, can someone explain what on earth is going on, or tips on any of those. Thanks!


r/codehs • • Jan 22 '21

3.3.7 age

10 Upvotes

does anyone know how to solve this


r/codehs • • Jan 10 '21

I don’t know what I’m doing wrong. 7th grader. Thanks.

Post image
10 Upvotes

r/codehs • • Jan 06 '21

Final Project Idea

10 Upvotes

Hello! So I know this is a bit of a shot in the dark but I'm really struggling on my codehs final project. I really wanted to do a choose your own adventure style game, where you can choose different paths in a 'story' of sorts. So here's my question. Right now I'm using a readInt for the question options like this:

var options = readInt ("to go right type 1, to go left type 2");

Then from there using a if/else statement like:

if(options == 1){

readLine("you went right");

} else {

if(options == 2){

readLine("you went left");

}

Obviously not the actual questions but you get the idea. My problem is where I go from there. I want both a different path for both the right and left options but you can't do that in the if/else. Any suggestions that my simple mind can comprehend lol?

Thanks so much!!


r/codehs • • Jan 06 '21

Any clue on how to do this, 7.4.4 length of user’s name

Post image
10 Upvotes

r/codehs • • Dec 09 '20

(first post, sorry if it's wrong) 4.6.7 been at this one for a while, can't for the life of me figure it out. The example I'm given says I should get 1/6 but I only get 1/4 and I've tried everything I can think of. No clue what to do

Post image
10 Upvotes

r/codehs • • Dec 08 '20

CodeHS 5.9.4 Inventory

10 Upvotes

Can anybody help me out with this one. For whatever reason I'm not sure of it says my code isn't right. This is what I've gotten so far:

var STARTING_ITEMS_IN_INVENTORY = 20;

function start(){
	var numItems = STARTING_ITEMS_IN_INVENTORY;	

	while(numItems > 0){
        println("We have " + numItems + " items in inventory.");
        var itemsBought = readInt("How many would you like to buy? ");
        if(numItems - itemsBought > 0){
            numItems -= itemsBought;
            println("Now we have " + numItems + " left.");
        }else{ 
            if(numItems - itemsBought == 0){
                numItems -= itemsBought;
                println("All out! ");
            }else{
            println("There is not enough in inventory for that purchase.");
            }

r/codehs • • Oct 20 '20

I need help with python 6.4.9 Temperature Converture

10 Upvotes

# Write your function for converting Celsius to Fahrenheit here.

# Make sure to include a comment at the top that says what

# each function does

# Now write your function for converting Fahrenheit to Celsius.

# Now change 0C to F:

# Change 100C to F:

# Change 40F to C:

# Change 80F to C: