### Present Remotely

Send the link below via email or IM

• Invited audience members will follow you as you navigate and present
• People invited to a presentation do not need a Prezi account
• This link expires 10 minutes after you close the presentation

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

# Lecture 5 - Oct 20 2014

No description
by

## Arman Suleimenov

on 20 April 2015

Report abuse

#### Transcript of Lecture 5 - Oct 20 2014

A few notes on the assignment 0
Good folder hierarchy
Output should match exactly. Don't forget to print a newline. Examples:
1) Hi Paul, John, Ringo, and George.
2) 11 + 7 + 3 = 21
3) distance from (5, 7) to (0, 0) = 8.602325267042627
For faster response, it's better to ask your questions on Piazza, rather than email (you can post anonymously if you want): http://bit.ly/intro-to-cs
Don’t send your files over email, submit homework using PowerCampus.
In your questions, be more specific than asking, ‘Is this correct?’ I can tell you whether it's correct after Monday deadline :)

Q) Do you want EuclidianDistance.java be specific or general?
A) Specific. The way I will call your program is this:
java EuclidianDistance 5 7
NOT like this:
java EuclidianDistance 5 7 0 0
If you get an error after compiling, read the error message. Make sure your program and the file have the same name. If your program is called SumThree, but the file name is my_program_2.java, it won't compile. The file name should be SumThree.java.

Q) Why do I get an error when I run:
java UseArgument
A) Because you're not providing the argument:
java UseArgument Berti

Given the temperature t (in Fahrenheit) and the wind speed v (in miles per hour), compute the wind chill w using the formula from the National Weather Service:

w = 35.74 + 0.6215*t + (0.4275*t - 35.75) * v ^ 0.16

Compilation: javac WindChill.java
Execution: java WindChill t v

Why use Math.pow(x, 2.0) to find the square of x, when you can just do x * x?
Read 3 integer values from the command line and print them in ascending order.

Compilation: javac ThreeSort.java
Execution: java ThreeSort num1 num2 num3

% java ThreeSort 17 50 33
17
33
50
Type conversion
1.01^40 = 1.49
0.99^40 = 0.67
The power of small steps
jenniferdewalt.com
180 sites in 180 days
Full transcript