Practice Problem 2: Favorite Food
Objective: To learn how to write, compile, execute, and turn in a Java program
I showed you the following program in class:
/* Craig Persiko
Main.java
Simple Hello World program
*/
class Main
{
public static void main(String[] args)
{
System.out.println("Hello World!"); //Display the string.
}
}
Here is your assignment:
- Your program should be similar to the above program, except yours should have your name, the file's
name (as above), and "CS 111A Homework 2" in the comment at the beginning, instead of my name.
- Turn in your source code and the test run showing how your program worked.
- Instead of saying "Hello World" change your program to output your name and your favorite food that your family would cook at home when you were growing up. Tell us more about it if you like.
- Turn in your source code and the test run showing how your program worked.
- You may use repl.it or whichever compiler you wish.
Follow the instructions given in class and in the
Computer Access and Homework Instructions handout.
- Make sure to submit your homework on Canvas, on the
Assignment page for Homework 2.
- Remember you're required to present a program in class one time this semester. To present this one, e-mail me your solution at cpersiko@ccsf.edu and I'll let you know if you're selected to present.
Return to main CS 111A page