Wednesday, September 24, 2008
Wednesday, September 17, 2008
Test 1 Information
These tutorials from Sun are worth reading in addition to the book.
This developer uses these 15 exercises to master a language.
Try as many questions as you can from the Big Java book. Also read the first five chapters.
Here's a review for the first test next week.
Test 1 will be on September 23th.
Project 1 will be due on the same day. Bring in your program 1 code on a flash drive on Monday.
This developer uses these 15 exercises to master a language.
Try as many questions as you can from the Big Java book. Also read the first five chapters.
Here's a review for the first test next week.
Test 1 will be on September 23th.
Project 1 will be due on the same day. Bring in your program 1 code on a flash drive on Monday.
Coding done in class September 17th, 2008
public class HelloWorld //class designed to print hello world!
{
public static void main(String [] args)
{ //main method needed to run java application
System.out.println("Hello World!");
//syntax to print "Hello World!"
//while loop
//for loop
int counter = 0;
while(counter <= 10)
{
System.out.println(counter);
counter += 2; //the shortcut for counter = counter + 2;
}
for(int i = 100; i > 0; i --)
{
System.out.println(i);
if(i % 25 == 0){
System.out.println(i + " THIS IS A SPECIAL NUMBER!");
}
}
for(int i = 200; i > 0; i --)
{
//System.out.println(i);
if(i % 3 == 0 || i % 7 ==0 ){
System.out.println(i + " THIS IS A SPECIAL NUMBER 3 and 7");
}
}
} //Closing curly brackets /* hello */
} //closing curly brackets
1. Write a program to display "Hello World"
2. Write a program that loops to ten from 0 by 2 and prints out the result!
3. Add a for loop that counts down from 100 to 0 by one! Print out the results!
4. Within the previous loop, if a number is divisible by 25 evenly
output THIS IS A SPECIAL NUMBER!! %
5. Count down from 200 by 1 and find out if a number is divisible evenly by 3 and 7 together.
If it is print out a message "This number is divisible by 3 and 7!"
6. Start Netbeans and make a class for a student. Keep track of the GPA and Name. Provide getters,
setters, and a constructor! Call this class student.
7. Test program with main method by passing in a student
named "Jose" with a GPA of 3.5.
8. Make an array of 4 students and give them whatever info you like.
9. Print out the information in the array!
10. Ask user to enter a student name and GPA and make a student object!
{
public static void main(String [] args)
{ //main method needed to run java application
System.out.println("Hello World!");
//syntax to print "Hello World!"
//while loop
//for loop
int counter = 0;
while(counter <= 10)
{
System.out.println(counter);
counter += 2; //the shortcut for counter = counter + 2;
}
for(int i = 100; i > 0; i --)
{
System.out.println(i);
if(i % 25 == 0){
System.out.println(i + " THIS IS A SPECIAL NUMBER!");
}
}
for(int i = 200; i > 0; i --)
{
//System.out.println(i);
if(i % 3 == 0 || i % 7 ==0 ){
System.out.println(i + " THIS IS A SPECIAL NUMBER 3 and 7");
}
}
} //Closing curly brackets /* hello */
} //closing curly brackets
1. Write a program to display "Hello World"
2. Write a program that loops to ten from 0 by 2 and prints out the result!
3. Add a for loop that counts down from 100 to 0 by one! Print out the results!
4. Within the previous loop, if a number is divisible by 25 evenly
output THIS IS A SPECIAL NUMBER!! %
5. Count down from 200 by 1 and find out if a number is divisible evenly by 3 and 7 together.
If it is print out a message "This number is divisible by 3 and 7!"
6. Start Netbeans and make a class for a student. Keep track of the GPA and Name. Provide getters,
setters, and a constructor! Call this class student.
7. Test program with main method by passing in a student
named "Jose" with a GPA of 3.5.
8. Make an array of 4 students and give them whatever info you like.
9. Print out the information in the array!
10. Ask user to enter a student name and GPA and make a student object!
Monday, September 15, 2008
If you have access...
If you purchased access to the online materials with the book publisher, here is the link to access the course.
The assignment will be due on the day of the first exam, next Monday. :)
The assignment will be due on the day of the first exam, next Monday. :)
Allow the user to update a vending machine
Ask a user if they want to update the stock in a vending machine. Have them continue updating either the price or quantity until they say they are ready to quit.
This will use looping, variables, user input and output, and arrays possibly.
This will use looping, variables, user input and output, and arrays possibly.
Wednesday, September 10, 2008
Saturday...come meet the professors and CIS people
http://kailiang.no-ip.info/Orientation/Registration_Orientation.aspx
September 20, 2008
Room K413
9:00 AM
September 20, 2008
Room K413
9:00 AM
Subscribe to:
Posts (Atom)
