J
John Stephens
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!" );
}
}
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!" );
}
}