Introduction

The goal of this assignment is to give you practice with:

Frequently Asked Questions

What preparation do I need to complete this assignment? Read Section 1.1 and 1.2 of the textbook. If you don't understand something, post a Piazza question or attend office hours for assistance. Don't be bashful about asking for help.

Where can I find answers to general questions about the programming assignments, such as using TigerFile for submitting assignments and the format of the header files? See the assignment FAQ.

Can I use the booksite instead of the textbook? No, the booksite is a super-condensed version of the textbook; it is suitable for reference while online (for example, while programming). The textbook is intended for use when initially learning new material and when reinforcing your understanding of that material (for example, when reviewing for an exam).

I don't understand all of the jargon in HelloWorld.java. Should I drop the course? Don't worry—you'll discover the meaning of everything in the program over the course of the term. Java needs a lot of boilerplate code to get started. Do the readings and bring any lingering questions to precept.

How do I get Java to print true or false without an if-else statement?If b is a boolean variable, then System.out.println(b) will print true or false, according to its value.

I get the error Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0. What does this mean? Did you forget to type a command-line argument when you executed the program?

In GreatCircle I understand to use Math.toRadians() and Math.toDegrees(). What about the trigonometric functions? See the Java cheatsheet for useful math functions and constants.

My output for GreatCircle matches the sample output in the assignment specification, except in the very last digit or two. Why is there this tiny discrepancy? Is my answer wrong? Did you multiply by 60 (to convert the arc to nautical miles) before or after you converted the angle from radians to degrees? Computers work with limited precision, so algebraically equivalent formulas can produce slightly different answers. We typically ignore such tiny discrepancies when grading.

Where can I find guidelines for formatting, commenting, and organizing my code? See the assignment FAQ.

Will I receive a deduction if I don't adhere to every rule for formatting, commenting, and organizing my code? On this assignment, most style issues will result in a warning; next week, some may lead to a deduction.

Enrichment

Here is Hello World in over 200 different programming languages.