Im DROWNING! need help with a simple java assignment! plz someone help me!

i need help with my java assignment, with validating a sin number. easy for must who know java. im drowning... please help!

You will need to store each digit of the social insurance number in a field of its own. To validate the entry you will:
1. Multiply the 2nd, 4th, 6th and 8th digit by 2.
2. If the product of any of the four multiplications result in a value greater than 9, add the two resulting digits together to yield a single-digit response. For example 6 * 2 = 12, so you would add the 1 and the 2 to get a result of 3.
3. Add these four calculated values together, along with the 1st, 3rd, 5th, and 7th digits of the original number.
4. Subtract this sum from the next highest multiple of 10.
5. The difference should be equal to the 9th digit, which is considered the check digit.
Example of validating S.I.N. 765932546
1st digit 7
2nd digit (6*2 =12 1+2=) 3
3rd digit 5
4th digit (9*2 = 18 1+8 =) 9
5th digit 3
6th digit (2*2 = 4) 4
7th digit 5
8th digit (4*2 = 8) 8
Total 44 next multiple of 10 is 50
50-44 = 6 which is the 9th digit
Therefore the S.I.N. 765932546 is Valid
********* SIN Validation *********
Welcome - Please enter the first number: 120406780
Second digit value multiplied by 2 4
Fourth digit value multiplied by 2 8
Sixth digit value multiplied by 2 12
Eighth digit value multiplied by 2 16
Value derived from 6th digit 3
Value derived from 8th digit 7
The total is 30
Calculated digit is 10
Check digit must be zero because calculated value is 10
The SIN 120406780 is Valid
this is my assignemtn this is what i have! i dont know where to start! please help me!
/*     File:     sinnumber.java
     Author:     Ashley
     Date:     October 2006
     Purpose: Lab1
import java.util.Scanner;
public class Lab1
          public static void main(String[] args)
               Scanner input = new Scanner(System.in);
               int sin = 0;
               int number0, number1, number2, number3, number4, number5, number6, number7, number8;
               int count = 0;
               int second, fourth, sixth, eighth;
               System.out.print("\t\n**********************************");
               System.out.print("\t\n**********SIN Validation**********");
               System.out.print("\t\n**********************************");
               System.out.println("\t\nPlease enter the First sin number: ");
               sin = input.nextInt();
               count = int.length(sin);     
               if (count > 8 || count < 8)
               System.out.print("Valid: ");
     }

Similar Messages

  • Help with a SIMPLE java thing

    I've only got ONE handful of hair left.
    I'm trying to build a series of dropdown boxes; a day dropdown (Mon, Tue, Wed...), a month dropdown (Jan, Feb, Mar...), a year dropdown, hour dropdown, minute dropdown, and an am/pm dropdown.
    I think I want to build my dropdowns using "for" loops something like this:
    for (i=0;i<12;i++) {
    myStringBuffer.append("<option>" + [someUnknownFunctionThatReturnsTheFirstThreeLettersOfTheMonth(i)] + "</option>")
    I've been trying to mix up various combinations of Date objects (most date functions seem to be depreciated), Calendar Objects, DateFormat Objects and SimpleDateFormat Objects but nothing seems to want to perform the function that I need.
    I've had iffy success creating a calendar object, setting the Month to "i", using the getTime function to return a Date object which I can then pass to the SimpleDateFormat object using the .format(Date) function, after setting the pattern to "EEE", but it seems like just an incredibly complicated way to do what ought to be a simple function...i.e. convert a number 0-11 (or 1-12, I'm not picky) into the name of a stinking Month! Arrgh.
    If anyone can help, I thank you.

    I've done that before, so i'll share it with you.
    import java.text.SimpleDateFormat;
    import java.text.DateFormatSymbols;
    import java.util.Calendar;
    import java.util.Date;
    public String createListOfMonth(String pName) {
    StringBuffer sbMonth = new StringBuffer();
    DateFormatSymbols fm = new DateFormatSymbols();
    String[] arrMonth = fm.getMonths();
    sbMonth.append("<select name=\"" + pName + "\">");
    sbMonth.append("     <option value=\"\">Month</option>\n");
    for (int i=0; i<arrMonth.length; i++) {
    if (!arrMonth.trim().equals("")) {
    String sValue = "0000" + (i + 1);
    sValue = sValue.substring(sValue.length() - 2);               
    sbMonth.append("     <option value=\"" + sValue + "\">" + arrMonth[i] + "</option>\n");
    sbMonth.append("</select>");
    return (sbMonth.toString());
    You can manipulate the symbol (either for months, days) using different locale. You can see the API for java.text.DateFormatSymbols in Java2 SE.
    Regards,
    Hariyanto

  • Help with a simple Java program

    I'm making a sort of very simple quiz program with Java. I've got everything working on the input/output side of things, and I'm looking to just fancy everything up a little bit. This program is extremely simple, and is just being run through the Windows command prompt. I was wondering how exactly to go about making it to where the quiz taker was forced to hit the enter key after answering the question and getting feedback. Right now, once the question is answered the next question is immediately asked, and it looks kind of tacky. Thanks in advance for your help.

    Hmm.. thats not quite what I was looking for, I don't think. Here's an example of my program.
    class P1 {
    public static void main(String args[]) {
    boolean Correct;
    char Selection;
    int number;
    Correct = false;
    System.out.println("Welcome to Trivia!\n");
    System.out.println("Who was the first UF to win the Heisman Trophy?\n");
    System.out.print("A) Danny Wuerffel\nB) Steve Spurrier\nC) Emmit Smith\n");
    Selection = UserInput.readChar();
    if(Selection == 'B' | Selection == 'b')
    Correct = true;
    if(Correct == true)
    System.out.println("\nYou have entered the correct response.");
    else
    System.out.println("\nYou missed it, better luck next time.");
    System.out.println("(\nHit enter for the next question...");
    System.in.readLine();
    Correct = false;
    System.out.println("\nWhat year did UF win the NCAA Football National Championship?\n");
    number = UserInput.readInt();
    if(number == 1996)
    Correct = true;
    if(Correct == true)
    System.out.println("\nYou have entered the correct response.");
    else
    System.out.println("\nYou missed it, better luck next time.");
    Correct = false;
    System.out.println("\nWho is the President of the University of Florida?\n");
    System.out.println("A) Bernie Machen\nB) John Lombardi\nC) Stephen C. O'Connell\n");
    Selection = UserInput.readChar();
    if(Selection == 'A' | Selection == 'a')
    Correct = true;
    if(Correct == true)
    System.out.println("\nYou have entered the correct response.");
    else
    System.out.println("\nYou missed it, better luck next time.");
    }

  • At a loss with some simple java classwork. Please help.

    Hello. I'm having a problem with some work that I wasn't able to finish in class. I am not very good at java AT ALL, and I'm really at a loss on how to finish up the program and get it to print what I want it to.
    My task is:
    "Write a program that asks for two words and then eliminates the second word from the first word.
    For example:
    forgot - go = fort
    bedevil - bed = evil
    bedevil - evil = bed
    stupid - is = Hey, is is not found in stupid."
    This is my code so far:
    public class wordSubtraction
         public static String big = "bedevil";
         public static String small = "bed";
         public static void main(String[] args)
              elimWord(String big, String small);
         public static void elimWord(String big, String small)
              if(big.indexof(small)==-1)
                   System.out.println(small + " isn't found in " + big);
              else
                   big.substring(0, indexOf(small));
                   small.substring(indexOf(small)+small.length());
                   System.out.println(small + " + " + small.substring + " = " + big);
    I keep getting this error:
    /Users/mewmew/Desktop/wordSubtraction.java:8: ')' expected
              elimWord(String big, String small);
                                    ^
    1 errorI don't understand what this error means or how to fix it, it looks like I have all the parenthesis in there to me. Deleting or adding semi-colins, parethesis, brackets, or curly brackets just seems to give me more errors.
    Any help is appreciated!

    No it's not JJEdit. The errors are a good thing -
    and each one has to be
    dealt with. When you call a String method various
    things have to be
    correct:
    (1) The name of the method - case is important.
    (2) The arguments - the things in the parentheses -
    have to be exactly
    the sort of thing that the method expects. For
    example if the method
    expects an int argument and you give it a String
    there will be problems
    (3) The methods must be called using a String
    variable and a dot. If
    you just say "substring(whatever)" that's an error.
    The compiler is
    saying "substring of what?" You have to write
    "something.substring(whatever)"
    Also - because it will be important later - both
    substring() and indexOf()
    return a value. It is up to you to do something with
    that value. Usually
    you assign it to a variable.
    Just for the record I got the follow from the String
    API doumentation here:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Stri
    ng.html
    public int indexOf(String str) Returns the index
    within this string of the
    first occurrence of the specified substring.
    public String substring(int beginIndex) Returns a new
    string that is a
    substring of this string. The substring begins with
    the character at the
    specified index and extends to the end of this
    string.
    public String substring(int beginIndex, int
    endIndex)Returns a new
    string that is a substring of this string. The
    substring begins at the
    specified beginIndex and extends to the character at
    index endIndex - 1.
    I would suggest you write elimWord() along these
    lines:public static void elimWord(String big,
    String small)
    int pos = // find the index of small in big
    if(pos == -1)
    System.out.println(small + " isn't found in "
    und in " + big);
    else
    String before = // find the bit before small
    re small in big
    String after = // find the bit after small in
    small in big
    System.out.println(big + " - " + small + " =
    ll + " = " + before + after);
    Thank you! That's very helpful and I feel that I'm THAT much more on my way to understanding what the heck I'm doing.
    I'm trying, though...
    Now I just gotta find out how to get the bits before and after small in big and solve these errors:
    /Users/audreyeckel/Desktop/wordSubtraction.java:24: '.class' expected
              int pos = big.substring(0, int indexOf(small));
                                                   ^
    /Users/audreyeckel/Desktop/wordSubtraction.java:24: ')' expected
              int pos = big.substring(0, int indexOf(small));
                                                                  ^
    2 errorsI just hope I can finish it before it gets TOO late...it's about 2:26 AM here and this is due...TODAY!

  • Help with a simple program.

    I need some help writing a simple program. Can anybody help??
    thanks to all.
    2. HTML Java Source Code Reserved Word Highlighter
    Write a program that inputs a Java source code file and outputs a copy of that file with Java keywords surrounded with HTML tags for bold type. For example this input:
    public class JavaSource
    public static void main ( String[] args )
    if ( args.length == 3 )
    new BigObject();
    else
    System.out.println("Too few arguments.");
    will be transformed into:
    <B>public</B> <B>class</B> JavaSource
    <B>public</B> <B>static</B> <B>void</B> main ( String[] args )
    <B>if</B> ( args.length == 3 )
    <B>new</B> BigObject();
    <B>else</B>
    System.out.println("Too few arguments.");
    In a browser the code will look like this:
    public class JavaSource
    public static void main ( String[] args )
    if ( args.length == 3 )
    new BigObject();
    else
    System.out.println("Too few arguments.");

    Here is something that may get you started...
    import java.io.*; 
    import java.util.*; 
    public class HtmlJava{
         public static void main(String arg[]){
              if(arg.length!=1){
                   System.out.println("Usage java HtmlJava sourceFile");       
              else
                   new HtmlJava(arg[0]);
         HtmlJava(String source){
              try{
                   BufferedReader sourceReader=new BufferedReader(new InputStreamReader(new FileInputStream(source)));
                   BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(source+"Html.txt")));  
                   Vector keywords=new Vector();
                   addKeywords(keywords);
                   String line;
                   StringTokenizer tokenizer=null;
                   String word;
                   while((line=sourceReader.readLine () )!=null){
                        tokenizer=new StringTokenizer(line);
                        while(tokenizer.hasMoreTokens()){
                             word=tokenizer.nextToken();
                             if(keywords.contains(word)){
                                  writer.write(""+word+" ");
                             else{
                                  writer.write(word+" ");
                        writer.write("\r\n");
                   writer.close();
                   sourceReader.close(); 
                   System.out.println("Output File written to "+source+"Html.txt"); 
              catch(Exception ex){
                   ex.printStackTrace();      
         private void addKeywords(Vector keywords){
              keywords.addElement ( "abstract");
              keywords.addElement( "boolean");
              keywords.addElement( "break");
              keywords.addElement( "byte");
              keywords.addElement( "byvalue");
              keywords.addElement( "case");
              keywords.addElement( "cast");
              keywords.addElement( "catch");
              keywords.addElement( "char");
              keywords.addElement( "class");
              keywords.addElement( "const");
              keywords.addElement( "continue");
              keywords.addElement( "default");
              keywords.addElement( "do");
              keywords.addElement( "double");
              keywords.addElement( "else");
              keywords.addElement( "extends");
              keywords.addElement( "false");
              keywords.addElement( "final");
              keywords.addElement( "finally");
              keywords.addElement( "float");
              keywords.addElement( "for");
              keywords.addElement( "future");
              keywords.addElement( "generic");
              keywords.addElement( "goto");
              keywords.addElement( "if");
              keywords.addElement( "implements");
              keywords.addElement( "import");
              keywords.addElement( "inner");
              keywords.addElement( "instanceof");
              keywords.addElement( "int");
              keywords.addElement( "interface");
              keywords.addElement( "long");
              keywords.addElement( "native");
              keywords.addElement( "new");
              keywords.addElement( "null");
              keywords.addElement( "operator");
              keywords.addElement( "outer");
              keywords.addElement( "package");
              keywords.addElement( "private");
              keywords.addElement( "protected");
              keywords.addElement( "public");
              keywords.addElement( "rest");
              keywords.addElement( "return");
              keywords.addElement( "short");
              keywords.addElement( "static");
              keywords.addElement( "super");
              keywords.addElement( "switch");
              keywords.addElement( "synchronized");
              keywords.addElement( "this");
              keywords.addElement( "throw");
              keywords.addElement( "throws");
              keywords.addElement( "transient");
              keywords.addElement( "true");
              keywords.addElement( "try");
              keywords.addElement( "var");
              keywords.addElement( "void");
              keywords.addElement( "volatile");
              keywords.addElement( "while");
    }Hope it helped

  • I need to run web based Microsoft CRM. I open it in Safari but the program does not respond. I suppose it has to do with Flash or ActiveX. Can someone help?

    I need to run web based Microsoft CRM. I open it in Safari but the program does not respond. I suppose it has to do with Flash or ActiveX. Can someone help?

    What does the product developer say about system requirements? If it needs to be run from within Internet Explorer then you'll need to find a way to run Internet Explorer. Boot Camp or VM installation of Windows would be two options.
    But first check the product requirements.

  • Somehow my MacBookPro iCloud account has a different name and password from my other devices.  Even my date of birth is listed incorrectly.  I have tried but can't seem to change this info to match up with my other devices.  Can someone help?

    Somehow my MacBookPro iCloud account has a different name and password from my other devices.  Even my date of birth is listed incorrectly.  I have tried but can't seem to change this info to match up with my other devices.  Can someone help?

    Thanks
    I have a PC (Windows 7)
    Not sure when mobile me changed, but it was this weekend that my storage etc. lapsed (I have paid to keep storage with icloud). So i assume this has something to with it stopping.

  • The calender on my iPhone 4 with iOS 6 no longer syncs with iCal 4.0.4 on my mac OS 10.6.8. However it is syncing with my iCloud account. Can someone help me with this?

    The calender on my iPhone 4 with iOS 6 no longer syncs with iCal 4.0.4 on my mac OS 10.6.8. However it is syncing with my iCloud account. Can someone help me with this?

    FYI: It seems it was a network problem with my WinXP PC. After complete deletion and new installation of XP and iTunes my iPhone will be recognized correctly, Wifi synchronization works (mostly) fine.

  • I have Firefox 10.0.2. and OSX 10.6.8. and the latest PDF adobe reader, and still can not open with the browser PDF files.Can someone help,pls?Thanx

    Dear Ones,
    I have Firefox 10.0.2. and OSX 10.6.8. and the latest PDF adobe reader, and still can not open with the browser PDF files.Can someone help,pls?Thanx

    see if this is helpful : [http://support.mozilla.org/en-US/kb/Opening%20PDF%20files%20within%20Firefox Opening PDF files within Firefox]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • HT1414 the white screen on my ipod touch 4th gen is white with some skiny colored lines can someone help

    the white screen on my ipod touch 4th gen is white with some skiny colored lines can someone help please

    - Try:
    iOS: Not responding or does not turn on
    - If not successful and you can't turn the iPod fully off, let the battery fully drain. After charging for at least an hour try again.
    - If still not successful time for an appointment at the Genius Bar of an Apple store.

  • Plz someone help I made custom ringtones and when I try to put them in my iPhone 4 it hey appear gray on iTunes and won't go on my phone and I tried syncing it don't help what do I do???!!!

    Plz someone help I made custom ringtones and when I try to put them in my iPhone 4 it hey appear gray on iTunes and won't go on my phone and I tried syncing it don't help what do I do???!!!

    The ringtone file format is m4r.  You can create ringtone from any of your music file in your iTunes Music library.
    Follow steps as follow:
    1. Right mouse click the song in music library you want to create ringtone and choose “Get Info”
    2. Choose “Option” Tab, Check “Start Time” n Stop Time” of the track you want to make into ringtone and put in your start time and end time (Max 40 secs duration), then click OK
    3. Right mouse click the music file again and choose “Create AAC Version”
    4. You will see a copy of song with same name appeared but with 40sec duration only. Now drag the song onto your desktop and you will see the name is now xxxxxx.m4a.
    5. Change the file extension m4a into m4r from the desktop
    6. Delete the 40sec m4a file from the music library (You must do this step or Itune will not accept your new m4r file).
    7. *Important - Now uncheck the start n stop time of the original song so that you can play back full length.
    8. Now, drag the m4r file from desktop to Library
    9. Click onto the Tones under Library, and you find you ringone file.
    Note: Just in case you cannot "Create AAC version" from Step 3, go to top menu, click "Edit", "Preference". Under "general" Tab, click "Import Settings", make sure under Import Using that "AAC Encoder" is selected.
    Once you have ringtones in Tones library, you can sync ringtones over by connecting your phone to PC, select iPhone under Devices on iTunes left Pane, then go to 'Tones' tab and check SYNC TONES as well as the ringtones.  Click the SYNC button on the lower right window.

  • I want i quran plz someone help me in buying plz :'(

    i want i quran plz someone help me in buying plz :'(
    https://itunes.apple.com/pk/app/iquran/id285946052?mt=8

    What happens when you try to buy it, does the 'buy' button not work, do you get any error messages ... ?
    If you are getting a message to contact iTunes Support then you can do so via this link and ask them for help (we are fellow users on here, we won't know why the message is appearing) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
    If it's a different problem ... ?

  • I had a free apple account before and i use my visa to buy an app. now i can't go back to my free apple id. its asking to put my visa information! plz someone help me

    I had a free apple account before and i use my visa to buy an app. now i can't go back to my free apple id. its asking to put my visa information! plz someone help me. i wanna to knw how to get back to regular setting where i don't have to give my visa.

    Hi gntn0058,
    Thanks for visiting Apple Support Communities.
    It sounds like you are being asked to verify the credit card information on your iTunes Store account.
    If you would like to remove your Visa card from your account, you can do so using the steps found in this article:
    Change or remove your payment information from your iTunes Store account (Apple ID) - Apple Support
    If you want to re-add or keep your Visa card information on file, and you're being repeatedly asked to verify your card information, the troubleshooting steps in this article can be helpful:
    iTunes Store: My credit card's security code or zip code does not match my bank's records - Apple Support
    Best Regards,
    Jeremy

  • Need help with a simple process with FTP Adapter and File Adapter

    I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
    I can provide additional info such as the contents of my bpel and wsdl files if needed.
    Would appreciate if someone can help me with this at the earliest.
    Thanks
    Jay

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

  • Need help with a simple program (should be simple anyway)

    I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
    ====================================================
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Message extends JFrame implements ActionListener {
         public void actionPerformed(ActionEvent evt) {
         text1.setText(" ");
         text2.setText("RE: ");
         text3.setText(" ");
         public Message() {
         super("Write a Message - by Kieran Hannigan");
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         setSize(370,270);
         FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
         setLayout(flo);
         //Make the bar
         JMenuBar bar = new JMenuBar();
         //Make "File" on Menu
         JMenu File = new JMenu("File");
         JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
         JMenuItem f2 = new JMenuItem("Open");
         JMenuItem f3 = new JMenuItem("Save");
         JMenuItem f4 = new JMenuItem("Save As");
         JMenuItem f5 = new JMenuItem("Exit");
         File.add(f1);
         File.add(f2);
         File.add(f3);
         File.add(f4);
         File.add(f5);
         bar.add(File);
         //Make "Edit" on menu
         JMenu Edit = new JMenu("Edit");
         JMenuItem e1 = new JMenuItem("Cut");
         JMenuItem e2 = new JMenuItem("Paste");
         JMenuItem e3 = new JMenuItem("Copy");
         JMenuItem e4 = new JMenuItem("Repeat");
         JMenuItem e5 = new JMenuItem("Undo");
         Edit.add(e5);
         Edit.add(e4);
         Edit.add(e1);
         Edit.add(e3);
         Edit.add(e2);
         bar.add(Edit);
         //Make "View" on menu
         JMenu View = new JMenu("View");
         JMenuItem v1 = new JMenuItem("Bold");
         JMenuItem v2 = new JMenuItem("Italic");
         JMenuItem v3 = new JMenuItem("Normal");
         JMenuItem v4 = new JMenuItem("Bold-Italic");
         View.add(v1);
         View.add(v2);
         View.add(v3);
         View.addSeparator();
         View.add(v4);
         bar.add(View);
         //Make "Help" on menu
         JMenu Help = new JMenu("Help");
         JMenuItem h1 = new JMenuItem("Help Online");
         JMenuItem h2 = new JMenuItem("E-mail Programmer");
         Help.add(h1);
         Help.add(h2);
         bar.add(Help);
         setJMenuBar(bar);
         //Make Contents of window.
         //Make "Subject" text field
         JPanel row2 = new JPanel();
         JLabel sublabel = new JLabel("Subject:");
         row2.add(sublabel);
         JTextField text2 = new JTextField("RE:",24);
         row2.add(text2);
         //Make "To" text field
         JPanel row1 = new JPanel();
         JLabel tolabel = new JLabel("To:");
         row1.add(tolabel);
         JTextField text1 = new JTextField(24);
         row1.add(text1);
         //Make "Message" text area
         JPanel row3 = new JPanel();
         JLabel Meslabel = new JLabel("Message:");
         row3.add(Meslabel);
         JTextArea text3 = new JTextArea(6,22);
         messagearea.setLineWrap(true);
         messagearea.setWrapStyleWord(true);
         JScrollPane scroll = new JScrollPane(text3,
                                  JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                  JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         //SpaceLine
         JPanel spaceline = new JPanel();
         JLabel spacer = new JLabel(" ");
         spaceline.add(spacer);
         row3.add(scroll);
         add(row1);
         add(row2);
         add(spaceline);
         add(spaceline);
         add(row3);
         setVisible(true);
         public static void main(String[] arguments) {
         Message Message = new Message();
    }

    persiandude wrote:
    Topic: Need help with if, else, and which statements and loops.
    How would I display 60 < temp. <= 85 in java
    System.out.println("60 < temp. <= 85 in java");
    another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    [http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
    Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806].

Maybe you are looking for

  • Special coding for Internet Explorer

    We are modifying a website that was constructed in 2007 using Dreamweaver.  In a .css file containing code for external stylesheets, there are numerous instances of double-coding, based upon brower type-one set of code for IE and another for "other b

  • Getting the error that my Ipod is synced with another iTunes library.

    I blew up a hard drive and had to completely rebuild the drive and reinstall windows. After reloading iTunes I nopw get the following message. THe iPod is synced with another iTunes library.

  • Rcapd and zones.

    Hello, For limiting the physical memory usage of a project one can use rcapd. What if I want to limit the total physical memory usage of processes in a zone ? (for FSS for example you can give a number of shares to a whole zone) Is this currently pos

  • Don't you want my money?

    Just had a very poor experience with bestbuy.com. Placed an order online and selected a store that had the item I wanted in stock for pickup. Within 5 minutes, I received an order cancelled notice with no explanation. I called the number on the notic

  • How to export all the workbooks from database to a filesystem on 4.1.37  ?

    We have all the workbooks stored in the database and I wanted to them to be saved in the filesystem (4.1.37). Is there a batch file with which I can export all the workbooks and put them individually (abc.dis,xyz.dis) on the filesystem ? Show me an e