|
Hofstra University University College for Continuing Education M3161-01 Introduction to Java Programming instructor: Engin Yalt |
home
|
|
Text Books: Java: An Introduction to Problem Solving and Programming, Walter Savitch Prentice Hall , Amazon 4th Thinking in Java, 3rd Edition, Bruce Eckel Free e-book 3rd Ed, Amazon 4th Ed Head First Java, 2nd Edition, Kathy Sierra O'Reilly, Amazon The Java Tutorial, by Sun Download Java 2 Platform Standard Edition 5.0 JDK 5.0 Update 8 Installation Instructions API Specification: 1.4 1.5 (Java 5) J2SE 5.0 New Features and Enhancements |
Download the free code samples from these books: Java Programmer's Reference by Grant Palmer source code Java in a Nutshell, Third Edition by David Flanagan Java Examples in a Nutshell by David Flanagan Beginning Java 2, SDK 1.4 Edition by Ivor Horton TextPad (an excellent text editor) Eclipse (industry standard IDE) Java Ranch (check out the Big Moose Saloon) UML Tutorial |
Input - firstname lastname
Output - lastname, fistname
Input - 1 integer(n)
Output - print all numbers from 0 to n
Output - print all even numbers from 0 to n
Output - print all odd numbers from 0 to n
Output - determine whether the integer is even, odd or zero.
Input - 1 integer(n), 1 string("odd" or "even")
Output - if the string entered is "even", print all even numbers from 0 to n
Output - if the string entered is "odd", print all odd numbers from 0 to n
Input - 1 integer (ex:12345)
Output - digits seperated by a space (ex:1 2 3 4 5)
Input - n integers
Output - Min, Max, Sum and Product of those n integers
Output - Print the largest 2 numbers (input: 1,2,3,4,5 output: 4,5)
Input - n integers
Output - Number of integers entered
Output - Number of even integers
Output - Number of odd integers
Output - Number of integers that are zero
Input - none
Output
number square cube
0 0 0
1 1 1
2 4 8
3 9 27
4 16 64
5 25 125
6 36 206
7 49 343
8 64 512
9 81 729
10 100 1000
Input - none
Output - use for loops and only System.out.print("* "), System.out.print(" ") and System.out.println("")
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
Input - none
Output - 2,4,8,16,32,64.... etc (create infinite loop, you will have to hit CTRL+c, to stop program)
Input - integer (ex: n=5)
Output - 2,4,8,16,32 (loop upto the nth power of 2)
Input - 3 positive integers (a,b,c)
Output - Determine if those values can be the sides of a right triangle (a2=b2+c2)
(You should not assume that the first integer is the hypotenuse. If b2=a2+c2 or c2=a2+b2 holds true, the program should evaluate this as a possible triangle)
Input - integer (n=500)
Output - Print out all the Pythagorean Triples, hypotenuse being no larger than the input n
ex: (3,4,5) (4,3,5) (5,3,4) (5,4,3) (5,12,13) (6,8,10)....... (300,400,500)
Output - modify the program to not print out duplicate entries such as (3,4,5), (4,3,5), (5,3,4), (5,4,3)
Output - modify the program to not print out "similar" triangles. (3,4,5) is similar to (6,8,10). (all sides multiplied by a coeficcient)
Input - 1 integer: n>0
Output - compute the factorial: n! = n(n-1)(n-2)...(2)(1)
Input - none
Output - compute the value of PI: PI=4-4/3+4/5-4/7+4/9-4/11+... (3.14159...)
Output - compute the constant e: e=1+1/1!+1/2!+1/3!+1/4!+... (2.71828...)
Input - 1 integer (x)
Output - compute the value of e^x using the formula e=1+x/1!+x^2/2!+x^3/3!+x^4/4!+...
Most of the homework assignment are taken from Java How to Program by Deitel & Deitel
| Time | Ecommerce |
clock wristWatch wallWatch computerWatch tableWatch grandfatherClock hourglass type [digital or analog] watchStand cradle hanger pendulum wristband hourHand minuteHand secondHand digital display hour minute second resetTime() addTime() deductTime() motion powered battery powered solar powered changeBattery() shake() |
Customer Shipping Address Billing Address Shopping Cart Product Order Payment Order History regularCustomer wineCustomer (21+ required) creditCard expirationDate checkAge() addItem() removeItem() changeQuantity() checkOut() submitOrder() cancelOrder() |