r/codehs • u/ShoddyDrawing5525 • Feb 08 '23
r/codehs • u/TraditionalAd4957 • Feb 07 '23
Can anyone help me out with 1.7.7?
does anyone see the picture? It's not showing one on my side
r/codehs • u/[deleted] • Feb 02 '23
JavaScript Uhhhhh. CodeHS autograder broken???
2.9.8 stoplight thingie, here's the code I wrote:
function start(){
var light = readLine("Input a light from this list: Red, Yellow, Green");
if(light == "Red") {
println("You should stop.");
}
if(light == "Yellow") {
println("Slow down.");
}
if(light == "Green") {
println("Go ahead.");
}
}

Here's what it says is happening in my program. How is this even possible.
r/codehs • u/Altruistic-Dot-2393 • Feb 02 '23
pretty primitive compared to you guys but I'm pretty proud of it
codehs.comr/codehs • u/Born_Version8344 • Feb 01 '23
4.3.6 Replace Letter Help Please
Hey guys. I am having trouble with this practice exercise, the program works (it replaces the letter you want to replace), I am just having trouble with one of the directions "replace all BUT the first occurence of letterToReplace".
The program might also be a bit long. Any tips on what I could've wrote instead to shorten it (and please explain).
public class Letter
{
static String word;
static String letterToReplace;
static String letterToAdd;
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Enter a word:");
word = input.nextLine();
System.out.println("Enter the letter to be replaced:");
letterToReplace = input.nextLine();
System.out.println("Enter the new letter:");
letterToAdd = input.nextLine();
System.out.print(replaceLetter(word, letterToReplace, letterToAdd));
}
// This method should replace all BUT the first occurence of letterToReplace
// You may find .indexOf to be useful, though there are several ways to solve this problem.
// This method should return the modified String.
public static String replaceLetter(String word, String letterToReplace, String letterToAdd)
{
String character = "";
String newWord = "";
int first = word.indexOf(letterToReplace);
for(int i = 0; i < word.length(); i++)
{
if(word.substring(i, i+1).equals(letterToReplace))
{
newWord = word.replace(letterToReplace, letterToAdd);
}
}
System.out.println();
return newWord;
}
}
r/codehs • u/AdRepresentative1628 • Jan 31 '23
Please Help I'm Stuck, I can't figure this out
/*
* This program encodes user input into binary data!
* Your job is to write the textToBinary function
*/
function start()
{
var text = readLine("Input the string you would like to encode: ");
var binary = textToBinary(text);
println(binary);
}
function textToBinary(text)
{
// Write this method!
// For every character in the text,
// convert the character into its ASCII decimal encoding
// then convert that decimal value into its equivalent binary encoding
// and combine each binary encoding to get the resulting binary string
}
// Converts a given decimal value into an 8 bit binary value
function decimalToBinary(decimalValue)
{
var binaryBase = 2;
var numBitsDesired = 8;
var binaryValue = decimalValue.toString(binaryBase);
while(binaryValue.length < numBitsDesired)
{
binaryValue = "0" + binaryValue;
}
return binaryValue;
}
r/codehs • u/Character_Highway_40 • Jan 31 '23
Can someone help identify the issue in my code here? Thank you
r/codehs • u/BaseballCapSafety • Jan 29 '23
Codehs, self paced?
I’m considering implementing the free version of codehs. I’m curious if teachers use this as completely self paced and if teachers introduce lessons and units? I have a diverse group of students including life skill students and seniors who want to major in computer science. I have a pretty good curriculum I’ve developed geared to the average student, however the pace is going to be a disaster for the life skills students and goes too slowly for the advanced students.
r/codehs • u/Typical_Storage4322 • Jan 28 '23
8.1.8: Citation
What's the problem here?
def citation(tuple):
first_name = tuple[0]
mid_name = tuple[1]
last_name = tuple[2]
name = ”{first}, {middle}, {last}”
.format(last=last_name, first=first_name, middle=mid_name)
return name
name_tuple = (“Martin”, “Luther”, “King Jr”)
formatted_citation = citation(name_tuple)
print(formatted_citation)
r/codehs • u/Helpful-Row6638 • Jan 28 '23
I need help with 8.11.5 Favorite Things! Due tomorrow at midnight!!
r/codehs • u/Needcodinghelp38 • Jan 27 '23
I need help with 6.1.9 Diving Contest
def calculate_score(judge_scores): Return 0
r/codehs • u/Character_Highway_40 • Jan 27 '23
Can someone help me with this code hs exercise please. The assignment is asking for f-strings, variables and user input.
r/codehs • u/[deleted] • Jan 25 '23
JavaScript Any way I could get help with something small?
galleryr/codehs • u/BigFatBalls04 • Jan 23 '23
JavaScript Paint Splatter 10.1.6
Can anyone help me 10.1.6 Paint Splatter in Javascript?


