diff --git a/labs/lab1/CSYes.java b/labs/lab1/CSYes.java new file mode 100644 index 0000000..30ba5b5 --- /dev/null +++ b/labs/lab1/CSYes.java @@ -0,0 +1,12 @@ +// ******************************************************************* +// File Name: CSYes.java +// +// Purpose: Print Computer Science, Yes (underline =) +// ******************************************************************* +public class CSYes +{ + public static void main(String[] args) { + System.out.println("Computer Science, Yes!!!!"); + System.out.println("========================="); + } +} \ No newline at end of file diff --git a/labs/lab1/Count.java b/labs/lab1/Count.java new file mode 100644 index 0000000..5ba55b4 --- /dev/null +++ b/labs/lab1/Count.java @@ -0,0 +1,21 @@ +// ******************************************************************* +// File Name: Count.java +// +// Purpose: count to 5 3 different languages +// Error type: illegal start of expression +// ******************************************************************* +public class Count +{ + public static void main (String[] args) + { + //prints in english + System.out.println ("one two three four five"); + + //prints in french + System.out.println ("un deux trois quatre cinq"); + + //prints in spanish + System.out.println ("uno dos tres cuatro cinco"); + } + // Comment in a // comment line. +} \ No newline at end of file diff --git a/labs/lab1/Hello.java b/labs/lab1/Hello.java new file mode 100644 index 0000000..da08bc2 --- /dev/null +++ b/labs/lab1/Hello.java @@ -0,0 +1,24 @@ +// ******************************************** +// Hello.java +// +// Print a Hello, World message. +// ******************************************** +public class Hello +{ + // ----------------------------------- + // main method -- prints the greeting + // ----------------------------------- + public static void main (String[] args) + { + System.out.println ("Hello, World!"); + } +} + +/* Errors: +1- Hello.java:6: error: class Helloo is public, should be declared in a file named Helloo.java +2- Print string changed. There's no reason for errors +3-Hello.java:13: error: unclosed string literal +4-Hello.java:13: error: ')' expected +System.out.println (Hello, World!") +5-Hello.java:13: error: ';' expected +*/ \ No newline at end of file diff --git a/labs/lab1/Problems.class b/labs/lab1/Problems.class new file mode 100644 index 0000000..9fdfb15 Binary files /dev/null and b/labs/lab1/Problems.class differ diff --git a/labs/lab1/Problems.java b/labs/lab1/Problems.java new file mode 100644 index 0000000..8cc7669 --- /dev/null +++ b/labs/lab1/Problems.java @@ -0,0 +1,17 @@ +// ******************************************** +// Problems.java +// +// Provide lots of syntax errors for the user to correct. +// +// ******************************************** +public class Problems +{ + public static void main(String[] args) + { + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + System.out.println("This program used to have lots of problems,"); + System.out.println("but if it prints this, you fixed them all."); + System.out.println(" *** Hurray! *** "); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + } +} \ No newline at end of file diff --git a/labs/lab1/Simple.java b/labs/lab1/Simple.java new file mode 100644 index 0000000..43a8df5 --- /dev/null +++ b/labs/lab1/Simple.java @@ -0,0 +1,13 @@ +// ******************************************** +// Simple.java +// +// Print a simple message about Java. +// +// ******************************************** +public class Simple +{ + public static void main (String[] args) + { + System.out.println ("Java rocks!!"); + } +} \ No newline at end of file diff --git a/labs/lab1/poem.java b/labs/lab1/poem.java new file mode 100644 index 0000000..7360005 --- /dev/null +++ b/labs/lab1/poem.java @@ -0,0 +1,5 @@ +public class java { + public static void main (String[] args) { + System.out.println("Roses are red\nViolets are blue\nSugar is sweet\nAnd so are you! "); + } +} \ No newline at end of file