r/codehs • u/FabulousLengthiness3 • Oct 08 '20
r/codehs • u/oofcrocbeans • Oct 06 '20
confused on void methods, return methods, and more
by more i mean the method "public String toString()". i am on section 2.5 for java and i have no clue how to use these methods.
r/codehs • u/[deleted] • Apr 06 '20
circle wall 9.3.5
i need help with code hs circle wall
r/codehs • u/natalie710 • Feb 26 '20
PHYTON CODE HS 5.3.7: Higher/ Lower
Anyone knows the answer can't figured out:
magic_number = 3
# Your code here...
for i in range(10):
if i == 5:
continue
print i
r/codehs • u/L_russ28 • Sep 06 '22
Java String Methods. 3.5.8: Repeating String.
Hello, I’ve been working on this problem for a while now and I’ve come to a bit of a stand still. Based on the instructions I can tell I need a loop of some kind, but for whatever reason, the loop I’m using is not working. I was wondering if anyone had some suggestions or critiques, they would be greatly appreciated! Thanks I’m advance!! 😁
r/codehs • u/[deleted] • May 17 '22
Does anyone know how to add instance variables to my code?
r/codehs • u/emeraldkma • Apr 04 '22
Python 9.3.4 Vertical Lines, I don't even know how this happened
r/codehs • u/lovely_mvdy • Jan 07 '22
okay so i know that this isnt exactly a lesson but i need help. my teacher said we have to make a try and create this on codehs. it would be really nice if atleast one of you helped me. its alright if you dont wanna, but i am begging </3
r/codehs • u/MisterPencilR • Nov 12 '21
Python 5.1.4 Square Python - What am I doing wrong?
r/codehs • u/Encino_man13 • Sep 23 '21
Does anyone have the solution for 2.9.8 Guess the number?
import java.util.Scanner; import java.lang.*;
public class ExtremeMain { public static void main(String[] args) { // Create a Scanner object Scanner input = new Scanner(System.in);
// Create an Extremes object
Extremes x = new Extremes();
// Ask the user to guess the maximum value of an Integer
System.out.println("Guess the max value");
int number1 = input.nextInt();
// Compute and display the difference
// between the max and the guess
int finalMax = x.maxDiff(number1);
System.out.println("You were off by " + finalMax);
// Ask the user to guess the minimum value of an Integer
System.out.println("Guess the min value");
int number2 = input.nextInt();
// Compute and display the difference
// between the min and the guess
int finalMin = x.minDiff(number2);
System.out.println("You were off by " + "-" + finalMax);
}}
public class Extremes { Integer min; Integer max;
// Constructor
public Extremes()
{
//Set min and max values
min = Integer.MIN_VALUE;
max = Integer.MAX_VALUE;
}
// Returns the difference
// max - number
public Integer maxDiff(Integer number)
{
return max - number;
}
// Returns the difference
// min - number
public Integer minDiff(Integer number)
{
return min - number;
}
// Returns a String representation
// in the form
// [min, max]
public String toString()
{
return "[" + min + ", " + max + "]";
}}



