#Coursera its a Princeton computer science: Programming with a purpose class need help

47 messages · Page 1 of 1 (latest)

paper parrotBOT
#

This post has been reserved for your question.

Hey @round rain! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

white meadow
#

You appear to be trying to run a Java 11 class with Java 7

round rain
#

ohhh

#

how do i fix that im so new

#

what should i do

white meadow
#

I'm not sure what Java version you're course is using, but I'd assume it's 11 since that's what the stdlib file is made for

round rain
#

its drjava all ik

white meadow
#

So what'd you need to do is get a java 11 JDK installed on your PC

round rain
#

ok

white meadow
round rain
#

which version should i dl any

#

ok i downloaded it

#

ok its a folder right

#

do i put it somewhere

white meadow
#

Depends on which one you got

#

What is your Operating system

#

Windows?

round rain
#

windows

#

11

white meadow
#

Grab the MSI

#

It's an installer which will help you

#

The zip is for a manual install

round rain
#

ok

#

k i downloaded it

#

now should i try running it again

white meadow
#

Yes and make sure to reopen the terminal

little mountainBOT
#
public class BouncingBall {
    public static void main(String[] args) {

        // set the scale of the coordinate system
        StdDraw.setXscale(-1.0, 1.0);
        StdDraw.setYscale(-1.0, 1.0);
        StdDraw.enableDoubleBuffering();

        // initial values
        double rx = 0.480, ry = 0.860;     // position
        double vx = 0.015, vy = 0.023;     // velocity
        double radius = 0.05;              // radius

        // main animation loop
        while (true)  {

            // bounce off wall according to law of elastic collision
            if (Math.abs(rx + vx) > 1.0 - radius) vx = -vx;
            if (Math.abs(ry + vy) > 1.0 - radius) vy = -vy;

            // update position
            rx = rx + vx;
            ry = ry + vy;

            // clear the background
            StdDraw.clear(StdDraw.LIGHT_GRAY);

            // draw ball on the screen
            StdDraw.setPenColor(StdDraw.BLACK);
            StdDraw.filledCircle(rx, ry, radius);

            // copy offscreen buffer to onscreen
            StdDraw.show();

            // pause for 20 ms
            StdDraw.pause(20);

        }
    }
} ```

This message has been formatted automatically. You can disable this using /preferences.

round rain
#

does this look correct

#

im going to uninstall and read install it becouse its not working and i got errors install drjava even though that shouldn't matter but so i can explain everything in detail im a semi quad so please give me time thanks

paper parrotBOT
round rain
#

and reinstall

#

installing drjava

white meadow
#

I've never used DrJava so I can't really help you with that

#

Were there any instructions in the course for how to get everything installed?

round rain
#

yes

#

one sec im using drjava i guess to compile it and its giving errors

#

10 errors found:
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 5]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 6]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 7]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 26]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 26]
Error: StdDraw cannot be resolved to a variable
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 29]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 29]
Error: StdDraw cannot be resolved to a variable
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 30]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 33]
Error: StdDraw cannot be resolved
File: C:\Users\there\introcs\Hello\BouncingBall.java [line: 36]
Error: StdDraw cannot be resolved

#

ill be back tomorrow

white meadow
#

Well that interesting, I wonder why it's telling you to install Java 7 if the stdlib is made for Java 11 🤷‍♂️

#

This DrJava-based Java programming environment is no longer being supported (because DrJava in no longer being actively developed and DrJava is incompatible with Java 11). It has been replaced by the following IntelliJ-based programming environment for Windows.
also there's this note

#

I will let someone else help you

round rain
#

ok thanks for the help seriously

paper parrotBOT
# round rain ok thanks for the help seriously

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

round rain
#

broooooo