Marketplace

Related Articles

More

Related Categories

Recently Added

More

Join StudyUp.com Today

It's always free and anyone can join!

Watch StudyUp Demo Video Now

You Recently Visited

Writing Prompts Math

Kristina Said:

do UC schools place a lot of importance in the SAT writing section?

We Answered:

UCs generally look at the overall score without focusing on specific sections.

Maria Said:

How has US history repeated itself since WWII?

We Answered:

You've covered media and politics already, I would say think of things along the lines of racism, the economy, culture...

Jennifer Said:

How are the areas of parallelogram, rectangles, and triangles are related?

We Answered:

The formula for the areas of a paralellogram and a rectangle are the same ...Area = Base times height or Area= length times width.
If you draw a diagonal in a parallelogram and rectangle you will get TWO triangles.
Therefore the area of a triangle is
Area = 1/2 base times height or Area = 1/2 length times width.

Violet Said:

What is happening to me?

We Answered:

It sounds like you are just nervous

Gertrude Said:

How to write a math formula in Java?

We Answered:

Luckily there is a built in Math function in Java, and it does do square roots. It is simply Math.sqrt(the#);

I'm not sure why you would use the scanner class when you are wanting to open it up in a new window. Since I don't know what you're going to do I'll mention 2 ways:

1. You can ask for an input in the console and use the scanner class to get that input, and let's name that input num. Then use the Math.sqrt(num); to get the square root, and print it out with System.out.print. Pretty simple.

2. If you're wanting a window to pop-up, then you're probably going to use a JTextField and a submit button, which is going to take time compared to number 1. You have to create the window, create the JTextField, do ActionListener for the submit button and the whole deal. In that ActionListener is where you'll have to get whatever was in that JTextField, parse to an double, THEN do the square root and output the square root.

I would definitely recommend doing #1 if you're looking for simplicity, but if you want to be fancy you can do #2, but it's going to take a little more time, especially if you're new to swing.

Discuss It!