Due by 11:59pm Wednesday, January 31
Read ALL of the information on the course web page, paying particular attention to my course policies for the semester.
Review the code examples from class this week.
Read (or skim if you prefer) the sections of the textbook listed below, and refer back to them as needed while you are getting up to speed with Java this semester. A print version of the textbook is available in the SLC Library on 3-hour reserve. The full textbook is also available as a PDF in the Handouts portal of our course pages on MySLC. You must be logged into MySLC to access these files.
Finish all of the exercises from Lab 1.
Use the online Java 8 documentation to answer the following ten questions, and create a PDF document with your written answers. You're not allowed to use any other Internet resources (e.g., Google, StackOverflow, ChatGPT, etc.) for this exercise! This documentation is a comprehensive and extremely helpful resource which you should get into the habit of using whenever you write Java code, so the point of the exercise is to learn how to navigate the documentation pages yourself.
There is a String method available for creating an uppercase version of a String object. What is it called? Suppose s is a String, such as "sunflower". What code would you write to create an uppercase version of s?
Suppose you wanted to extract the substring "flower" from s. What code would you write to do this? How would you extract the substring "flow"?
How many different versions are there of the String method startsWith? How do they differ?
How many different versions are there of the static String method valueOf? What, in general, does this method do?
Do the methods String.valueOf(double d) and String.valueOf(int i) differ from the methods Double.toString and Integer.toString, or do they do exactly the same thing?
How many static String methods are there in all?
The static method JOptionPane.showMessageDialog displays a message in a pop-up window, but doesn't return any value, whereas JOptionPane.showInputDialog accepts input typed by the user in a pop-up window and returns it as a String. A similar static method called JOptionPane.showConfirmDialog brings up a pop-up window with the options Yes/No/Cancel. What type of value is returned by the JOptionPane.showConfirmDialog method?
When we create a Scanner object for reading keyboard input, we write new Scanner(System.in). What type of object is System.in?
There are many other ways to create Scanner objects besides using System.in. How many different constructors are there in all for the Scanner class?
Browse through the list of static methods available in the Math class. Are there any that generate random numbers directly (instead of having to first create a Random object)? What about for generating random integers?
Files to submit:
Submit your PDF and Java source code files using the Homework Upload Site. Please include your name and the assignment number in a comment at the top of your Java files. You DO NOT need to submit TestBankAccount.java, TestCalendarDate.java, or any of your compiled .class files. In class on Tuesday, I will show you how to use the upload system to submit your files.
If you have questions about anything, just ask!