Lab Assignment #3: More objects and strings

Due by 11:59PM on Wednesday, Feb 10.


Reading Assignment

Read section 2.6 (again) and sections 3.1-3.2 of the text Computing Concepts with Java Essentials. This covers material on the String and Time classes.

Please do the readings from the book and also read this entire assignment before lab this week!


Getting Started

To get started, make sure you understand all the problems in the previous assignments, as well as the exercises that you did in the lab and class. If you don't understand them, read the text again. Ask yourself if you understand the material in the text before you begin working on the lab.

Comments

As usual, make sure that all your programs are header by a comment block of the following form:

/*
Your Name
Your ID Number
Your Username
Which Assignment
Your Laboratory Section Number
*/

Fully document your code with meaningful comments. Use a consistent and readable indentation scheme. You will be graded on both the correctness of your programs and the style in which they are written.


In-Lab Work

To receive credit for this in-lab assignment, you must complete the following exercise and submit them during your lab session. You will mail your submission as usual to a201@cs.indiana.edu. Your AI will provide you with the correct subject during lab.

This is not a test! If you have any trouble at all with these programs, your AI will be happy to help you!


Lab Assignment

This is your actual lab assignment for the week. You will write and debug three programs. Your AI may discuss strategies for solving these problems, but there will not be time in lab for you to complete the programs.

Please take care to use the exact filenames specified in the problems below.

  1. Take the broken piglatin program that you created in the lab, and modify it so that the uppercase characters are handled somewhat properly. Don't worry about names. Simply make sure that the first word starts with an uppercase character, and no other characters in any other words are uppercased. So, the program should run in the follwoing way with the same input as in the above exercise:

    Give me a 4 word sentence: My name is Joe.

    Piglatin sentence: Ymay amenay siay oejay.

    Save your program as Smartpig.java.

  2. Exercise P2.21, Page 84. Save your program in a file named Letters.java. Feel free to use the special characters like '\n', '\t' and so on.

  3. Write a program that asks for the due date and time for the next quiz or assignment. Then it should output how many full hours you have before you need to submit the assignment. (So if you have two and a half hours left, you should generate two hours). A sample run may look like the following. You may design the actual input sequence or format, but make sure your prompt tells the user what to type:
    Please enter the name of assignment due (Lab/quiz): Lab3
    Please enter the date it is due:
    Month: 2
    Date: 10
    Hour (in 24 hour format): 23
    Minute:59

    You have about 168 hours to finish this assignment! Keep it up!

    Hint: remember that one hour has 3600 seconds. And remember integer division!

    Name this program Deadline.java


Submitting Your Lab Assignment

For this lab, you must submit the in-lab exercise during your normally scheduled lab session. By Wednesday, February 10 at midninght you should submit these three files:

Do not submit .prj or .class files. Only the three files named above should be submitted.

In order to submit files, click on the following link to send mail to:

a201@cs.indiana.edu

with the following Subject:

lab3

and then Attach your program files to the e-mail message. You may attach all three files in the same message, but you don't have to. You can submit your programs in separate e-mails if you wish. Do not type anything in the body of the message! You must use the filenames specified in this assignment and you must attach the files to the mail message.


Last modified: Tue Feb 9 00:01:43 EST 1999 by asengupt@cs.indiana.edu