Remember, easier things are at the bottom, look from bottom up to find the first thing you think you need to practice.
- Chapter 2 Programming Projects from the Book: 2, 4, 9. Note: These are "PSA" style questions, that you can feel free to work with others on, and to discuss in great detail with tutors. If you did the first PSA and worry that you don't really understand how you got it to work, PLEASE do these problems and understand THEM. )
- Write code that has the user enter their name as all one string. Store it in a single variable. Use String methods (like indexOf and substring) to put the user's first name ONLY in another variable and their last name only in a third variable. Be sure not to modify the original variable as you do this. Print out your results to make sure that you have done it right.
- Write a program that reads in a char variable and casts it to an int variable and prints it. Why does it print what it does? (Answer: Unicode)
- Write a program that practices casting both from smaller to larger values (eg int to long, int to double) and from larger to smaller values (double to int) - and test interesting cases - like 6.9.
- Write a program that explores the differences between x++ and ++x. If you can think of nothing more creative, enter and test on various values the code presented in class.
- Write a program to prompt a user, read in, and print out variables of type: boolean, char, byte, int, double and String.
- Write a program that asks a user to input 2 integer values and then prints out their: sum, difference, the remainder when dividing one into the other.
- Write a program that reads in an integer number and then incrments its value by ten using the += operator.