r/codehs • • Mar 28 '23

7.2.5 Height in Meters

2 Upvotes

Can someone please help me with this one? I can’t find it anywhere and I don’t understand.


r/codehs • • Mar 27 '23

Need help with 6.6.5 pls no clue what to do

1 Upvotes

r/codehs • • Mar 25 '23

what's the mistake? it says I should have a gray rectangle and red, green, yellow circles

3 Upvotes

Write a program that draws a stoplight. You should have a gray rectangle, and then three circles in the rectangle. The circles should be red, then yellow, then green.

The rectangle should be centered on the screen. The yellow light should be centered on the screen, and the red and green light should be offset by BUFFER
amount. BUFFER
amount represents the distance from the center of one circle to the center of another circle.

Implement the function draw_circle
that draws a single circle. Use it to draw the red, yellow, and green lights. Since all of the lights are the same size and aligned vertically, the function only needs to take the y position and color as arguments.

my code

LIGHT_RADIUS = 35

STOPLIGHT_WIDTH = 120

STOPLIGHT_HEIGHT = 350

DIST_BETWEEN_LIGHTS = 100

GREY_COLOR = "#737071"

get_width()/2

get_height()/2

# Implement a function that draws a single circle

# with radius LIGHT_RADIUS.

# The circle should be in the center of the screen horizontally.

# Use the parameters for the y position and color

def draw_circle(radius, color, x, y):

circ = Circle(radius)

circ.set_color(color)

circ.set_position(x, y)

add(circ)

# Add your code here

rect = Rectangle(STOPLIGHT_WIDTH, STOPLIGHT_HEIGHT)

rect.set_position(get_width()/3, get_height()/5)

rect.set_color(GREY_COLOR)

add(rect)

draw_circle(LIGHT_RADIUS, Color.red, get_width()/2.05, get_height()/3)

draw_circle(LIGHT_RADIUS, Color.yellow, get_width()/2.05, get_height()/1.85)

draw_circle(LIGHT_RADIUS, Color.green, get_width()/2.05, get_height()/1.85 + DIST_BETWEEN_LIGHTS)


r/codehs • • Mar 24 '23

3.2.6 Debugging Variables

3 Upvotes

I really need help with this im having a hard time!!


r/codehs • • Mar 24 '23

3.3.5 Mad Lib

3 Upvotes

Can anybody help me with this im having a hard time


r/codehs • • Mar 23 '23

I also need help with 1.11.5 Music Library

Thumbnail self.codehs
2 Upvotes

r/codehs • • Mar 21 '23

Python Code Function won't pring

Thumbnail gallery
4 Upvotes

I'm trying to run a function which is supposed to print a sentence within the function, but for some reason all it prints is <function (function name)> instead of running it. Is there any way I can fix this?


r/codehs • • Mar 21 '23

HELP ASAP 9.1.4 Challenge: Secret Image Steganography

1 Upvotes

I am stuck on this one for 2 hours and still don't know how to complete it, please this assignment is due for tomorrow


r/codehs • • Mar 21 '23

Code hs 10.6.9 Target + GUI

2 Upvotes

Can anyone help me with this code? I’ve been trying to do it for like a week and I still can’t get it… please lmk!!


r/codehs • • Mar 20 '23

5.5.6 Caterpillar

3 Upvotes
how do i make it change colors

r/codehs • • Mar 20 '23

5.3.6 Girl Scout Designation

3 Upvotes

Basically, what do?


r/codehs • • Mar 20 '23

phone book

1 Upvotes

needing help with phonebook assignment codehs. how do i get started


r/codehs • • Mar 19 '23

HELP MEEEE PLZZZZ

1 Upvotes

r/codehs • • Mar 18 '23

I know this sub is pretty much dead and I wont get answers, but could i get help or know where i could get help in completing "7.0.7 Battleship Part 6: The Battleship Class"?

5 Upvotes

r/codehs • • Mar 18 '23

does anyone know what's happening here?

Post image
5 Upvotes

r/codehs • • Mar 17 '23

help please?

3 Upvotes

Freshly new to coding and learning javascript first but this question has me stumped. I provided my code below I know it's not correct, but any guidance or help would be appreciated greatly!

  1. Define a function, lettersAfter, that accepts three arguments:
  • haystackA string: The string to be searched
  • needleA string: A character to search for.
  • limitA number: The number of letters after the character to return
  1. lettersAftershould return the letters following the first found occurrence of the search character. The letters returned should be limited to the number of the third argument.

//

// YOUR CODEfunction lettersAfter(){let letters = for (let i = 0 ; i < haystack.length; i++){

let char = haystack[i];

if (char === needle ){

for (let j = 0; j < limit; j++){let innerChar = haystack[i + j + 1 ];   letters += innerChar; }      }return letters;  }  }


r/codehs • • Mar 18 '23

I need help with 7.4 Keeping Count

1 Upvotes

My code so far:

def count_occurrences(word, character):

for character in word:

return len(word(character))

print(count_occurrences("banana", "a"))

I cant figure it out pls help


r/codehs • • Mar 16 '23

How do you fix an indentation error ?

1 Upvotes

If I copy and paste code onto the sheet and it doesn’t paste the same how do I fix it


r/codehs • • Mar 16 '23

Java Help me with 5.3.6 Girl Scout Designation

1 Upvotes

SHAWTY TRIPPIN WIT DEEZ COOKIES MY BOY WAS REALLY GRIPPIN HIS FN POINTED AT AN FN. NEED A RN ASAP TO HELP ME SOLVE THIS


r/codehs • • Mar 15 '23

AP in python

2 Upvotes

Does the AP in Python course still exist because I am taking it but when I look it up in the course catalog I don’t see it ( I started a couple months ago)


r/codehs • • Mar 15 '23

8.3.8: Create your own Encoding help

2 Upvotes

Can someone help me with this assignment? It’s in JavaScript and I thought I had did it correctly but it doesn’t fit into what the program wants me to do. Pls help me, it’s due tomorrow for me.


r/codehs • • Mar 13 '23

JavaScript Does anyone know for Debugging with the Console what the messages are? It keeps saying that I didn't write the right messages...

Post image
7 Upvotes

r/codehs • • Mar 13 '23

Tell a Story help

2 Upvotes

Hi whomever see's this I need help on tell a story so that I can catch up with the rest of my class and no be behind is there anyway someone can help?


r/codehs • • Mar 13 '23

9.5.9 Assignments skipping if statements

1 Upvotes

import java.util.*;

public class AssignmentRunner {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

String assignmentName = "";

ArrayList<Assignment> assignmentList = new ArrayList<Assignment>();

while(!assignmentName.equals("exit")){

System.out.println("Enter the assignment's name: ");

assignmentName = input.nextLine();

if(assignmentName.equals("exit")){

break;

}

System.out.println("Enter the due date: ");

String dueDate = input.nextLine();

System.out.println("How many points is the assignment worth?: ");

int pointsWorth = input.nextInt();

System.out.println("How many points were earned?: ");

int pointsEarned = input.nextInt();

System.out.println("Is this a (T)est or a (P)roject?: ");

String tP = input.nextLine();

if(tP.equals("T")){

System.out.println("What type of test is it?: ");

String type = input.nextLine();

Test test = new Test(assignmentName, dueDate, pointsWorth, pointsEarned, type);

assignmentList.add(test);

}else{

System.out.println("Does this project require (true/false) Groups? : ");

boolean groups = input.nextBoolean();

System.out.println("A Presentation? ");

boolean presentation = input.nextBoolean();

Project project = new Project(assignmentName, dueDate, pointsWorth, pointsEarned, groups, presentation);

assignmentList.add(project);

}

}

printSummary(assignmentList);

}

// Print due date and score percentage on the assignment

public static void printSummary(ArrayList<Assignment> assignments) {

for (int i = 0; i < assignments.size(); i++)

{

System.out.println(assignments.get(i) + "\n");

}

}

}

My problem is it skipping an if statement and i dont know why

heres a sample run of the program

Enter the assignment's name:

assignment

Enter the due date:

5/5/5

How many points is the assignment worth?:

100

How many points were earned?:

90

Is this a (T)est or a (P)roject?:

Does this project require (true/false) Groups?:

false

A Presentation?

false

Enter the assignment's name:

Enter the due date:

exit

How many points is the assignment worth?:

/////

this can go on but thats the gist. the first exit command will work but after the first assignment is added it just skips the user input part.

what it should look like

Enter the assignment's name:

assignment

Enter the due date:

5/5/5

How many points is the assignment worth?:

100

How many points were earned?:

90

Is this a (T)est or a (P)roject?:

P

Does this project require (true/false) Groups?:

false

A Presentation?

false

Enter the assignment's name:

exit

i appreciate any help. thanks!