problemset1

problemset1 - Introduction to Computers and Engineering...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Engineering Problem Solving 1.00 / 1.001 Fall 2005 Problem Set 1 Due: 11AM, Friday September 16, 2005 Java Introduction 1 [100 points] Introduction This problem set will ask you to complete a bunch of short exercises to help you get familiar with java. You might need to use the following: JOptionPane.showInputDialog() This is a way to get input from the user. This is a method. Fill in the parentheses with a message to the user (this is called the argument). This method will return a String . Suppose, for example, your program has the line of code: String name = JOptionPane.showInputDialog("What is your name?"); In this case, the program will display a dialog box with the text, “What is your name?” in it and a place for the user of the program to type some text. When they type the text and click on the button in the dialog box to indicate that they want to submit that text, the Java variable name will contain whatever String of text the user inputs. Integer.parseInt() This method takes a String as an argument and converts the String to an int . For example, if the variable radius
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/29/2011 for the course CIVIL 1.00 taught by Professor Georgekocur during the Spring '05 term at MIT.

Page1 / 3

problemset1 - Introduction to Computers and Engineering...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online