Giter VIP home page Giter VIP logo

apcs-codehs's Introduction

AP Computer Science A - CodeHS

This repository contains all the answers for units 1 - 10 in the APCSA CodeHS Java course. Be sure to leave a star ๐ŸŒŸ

NOTICE: The answers from this repository will be taken down ARE BACK!

Common Answers

If an assignment has 2 or more files...

If an assignment has 2 or more files required, the individual file will be denoted as such:

File.name:
----------
// Code...

If an assignment has a prefix of M-...

If an assignment has a prefix of M- it's an actual school project, not a CodeHS assignment and can be ignored.

WARNING

It is recommended that you attempt to solve the problems by yourself before using the work provided here so you can learn from your mistakes. Try to use this only to review/compare your own work, or if you are very stuck on a problem.

Completed Units

  • Add Unit 1 (Primitive Types)
  • Add Unit 2 (Using Objects)
  • Add Unit 3 (Boolean Expressions and IF Statements)
  • Add Unit 4 (Iteration)
  • Add Unit 5 (Writing Classes)
  • Add Unit 6 (Array)
  • Add Unit 7 (ArrayList)
  • Add Unit 8 (2D Array)
  • Add Unit 9 (Inheritance)
  • Add Unit 10 (Recursion)

Socials

Let me know if you found these helpful or need assistance!

apcs-codehs's People

Contributors

31carlton7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apcs-codehs's Issues

9.7.9 twod-array-tester.java Has An Issue

There is an issue in the "TwoDArray.java" that causes the "Testing unequal integer arrays" test case on CodeHS to fail. The problem is that the code does NOT use the row/column length of the smaller 2D array, instead always just using the array from the private variable myArray- which causes an OutOfBounds Error when the other array is smaller. Here is a fixed version of the code for TwoDArray.java:

public class TwoDArray {

    private Object[][] myArray;
    
    public TwoDArray(Object[][] input)
    {
        myArray = input;
    }
    
    public boolean equals(Object[][] other)
    {
//fixed โ†“
        int smallerRow = 0;
        if (myArray.length <= other.length)
            smallerRow = myArray.length;
        else 
            smallerRow = other.length;
        int smallerCol = 0;
        if (myArray[0].length <= other[0].length)
            smallerCol = myArray[0].length;
        else 
            smallerCol = other[0].length;
//fixed โ†‘
        for (int i = 0; i < smallerRow; i++)
        {
            for (int j = 0; j < smallerCol; j++)
            {
                if (!myArray[i][j].equals(other[i][j])) 
                {
                    return false;
                }
            }
        }
        return true;
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.