Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #25261
| Newsgroups | comp.lang.java.programmer |
|---|---|
| Date | 2013-09-08 09:55 -0700 |
| References | <ec0481dd-6ec3-4ff7-93de-48d577af8fc0@googlegroups.com> |
| Message-ID | <56ea4544-5c85-475a-9597-795d8954b187@googlegroups.com> (permalink) |
| Subject | Re: Nothing prints when I compile my code |
| From | John Stephens <johnnyringo888@gmail.com> |
On Sunday, September 8, 2013 12:06:35 PM UTC-4, John Stephens wrote:
> Another Homework assignment for College Intro to Java course. I am having a disconnect with what the issue is. It compiles fine but does not print. Hints anyone?
>
>
>
> Here is my code:
>
>
>
> //*************************************************************************************************
>
> // Author: John Stephens Date: September 7, 2013
>
> // Class: COP 2551 Filename: Homesick.java
>
> // Lab: Lab 1
>
> // Programming Project PP2.3 on Page 109.
>
> // Purpose: This program prompts and reads a person's name, college, and petname into a paragraph
>
> //*************************************************************************************************
>
>
>
> import java.util.Scanner;
>
>
>
> public class Homesick
>
> {
>
> //----------------------------------------------------------------------------------------------
>
> // Reads a character string from the user and prints it.
>
> //----------------------------------------------------------------------------------------------
>
> public static void main (String[] args)
>
> {
>
> String name, college, petname;
>
> int age;
>
> Scanner scan = new Scanner (System.in);
>
> String Name = scan.nextLine();
>
>
>
> System.out.println ("Johnny");
>
> name = scan.nextLine();
>
>
>
> System.out.println ("41");
>
> age = scan.nextInt();
>
> scan.nextLine();
>
>
>
> System.out.println ("FSCJ");
>
> college = scan.nextLine();
>
>
>
> System.out.println ("Sagwa");
>
> petname = scan.nextLine();
>
>
>
> System.out.println ( "Hello, my name is " + name + " and I am " + age + " years " +
>
> "old. I'm enjoying my time at, " + college + " though " +
>
> "I miss my pet " + petname + " very much!" );
>
> }
>
> }
Thank you!
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Nothing prints when I compile my code John Stephens <johnnyringo888@gmail.com> - 2013-09-08 09:06 -0700 Re: Nothing prints when I compile my code markspace <markspace@nospam.nospam> - 2013-09-08 09:50 -0700 Re: Nothing prints when I compile my code John Stephens <johnnyringo888@gmail.com> - 2013-09-08 09:55 -0700 Re: Nothing prints when I compile my code Roedy Green <see_website@mindprod.com.invalid> - 2013-09-09 01:48 -0700
csiph-web