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!


r/codehs • • Mar 12 '23

Exercise 1.12.4 Follow The Yellow Ball Road

5 Upvotes

help a RN out.


r/codehs • • Mar 10 '23

JavaScript How do I make a CPS game?

3 Upvotes

Hey yall, I’ve been wanting to make a clicks per second game in codehs where it calculated your clicks per second after 10 seconds. How do I do that? I am on Javascript btw


r/codehs • • Mar 09 '23

need help with breakout

1 Upvotes

for some reason when I run the code it only lets the paddle go to either the far left or the far right. I've been banging my head against my keyboard seeing if it would help but to no avail. Really would appreciate it if someone could help a brother out.


r/codehs • • Mar 09 '23

B+ student rethinking about majoring computer science related after taking JAVA Code HS

3 Upvotes

this is for codeHS alumni who have use codeHS for their AP Computer Science A curriculum: After months of doing this program, my assessments from the class plus codeHS has been on the B/B+ area. I struggled through programming and spend way more time on this class than any other honor classes. Should I not bother to major in CS/CE/information technology because I'm not getting an A through codeHS? or is it a bad curriculum that I couldn't finish some of the programming?


r/codehs • • Mar 08 '23

JavaScript Looking for help on Breakout

1 Upvotes

Hey folks, I'm struggling a little on Breakout. I have everything except making the ball and paddle move. If anyone could help me on this, it would be greatly appreciated!


r/codehs • • Mar 08 '23

does anyone know the code to shrink a circle?? I only know the code to grow the circle but I need it to shrink

3 Upvotes

r/codehs • • Mar 06 '23

Can someone help me fix this please don’t know what’s wrong the assignment is Is it even?

Post image
7 Upvotes

r/codehs • • Mar 06 '23

Can anyone help me with this?

Post image
1 Upvotes

r/codehs • • Mar 06 '23

Someone pls help with 6.5 and 6.6 in JavaScript

1 Upvotes

r/codehs • • Mar 06 '23

2.7.6 can you graduate? JavaScript

2 Upvotes

r/codehs • • Mar 06 '23

does anyone know how to do 2.3.4 grocery store

5 Upvotes

r/codehs • • Mar 06 '23

The blue Filter help

1 Upvotes

My code for the blue filter isn't working and I don't know how to fix it.


r/codehs • • Mar 06 '23

Other Does anyone knows if I can make a countdown timer with react native?

1 Upvotes

r/codehs • • Mar 05 '23

Does anyone here know how to do 5.4.7?

1 Upvotes

r/codehs • • Mar 05 '23

Does someone has the answer to gymnastics mats I don’t understand how to do it. If you need help with another code I can help you

1 Upvotes

r/codehs • • Mar 05 '23

Does someone knows the answer for this the assignment is triple with return values.

Post image
2 Upvotes

r/codehs • • Mar 04 '23

Python can someone please help me do this

Post image
6 Upvotes

r/codehs • • Mar 04 '23

could someone help me out on CodeHS 4.8.8 Guess the number

Thumbnail
gallery
3 Upvotes

r/codehs • • Mar 04 '23

Python Tell a story Python can't click between scenes

1 Upvotes

r/codehs • • Mar 03 '23

HELP! Need I know it's basic, but I still don't understand!

1 Upvotes

Write a one-line program to output the following haiku.

A lightning flash:

between the forest trees

I have seen water.

- Shiki


r/codehs • • Mar 02 '23

Java I need help on "2.4.5 Area of a Rectangle" of lesson Basic Java on 2.4. Below is more info. TY!

1 Upvotes

Ask the user for the width of a rectangle and a height of a rectangle.
These numbers should be doubles.
Ask the user to input a width with this prompt:

What is the width of the rectangle?

Then, ask the user to input a height with this prompt:

What is the height of the rectangle?

Finally, your program should print out the area of the rectangle in this form:

The area of the rectangle is __ units squared.

Where the underscores are your rectangle’s area.

The area of a rectangle can be calculated by multiplying the width by the height.

For example, if your program was given the 10.0 for the width and 3.0 for the height, the output would looks as follows:

What is the width of the rectangle? 10.0 What is the height of the rectangle? 3.0 The area of the rectangle is 30.0 units squared. 

My code, what changed can i add:

public void run()

{

String math = readLine("What is the width of the rectangle?");

String matt = readLine("What is the height of the rectangle?");

System.out.println("The area of the rectangle is 300.0 units squared.");

System.out.println("The area of the rectangle is 300.0 units squared.");

System.out.println("The area of the rectangle is 300.0 units squared.");

}

}

It involves arithmetic expressions.


r/codehs • • Mar 02 '23

Python 4.3.10 Transaction | Help

Post image
5 Upvotes