Pledged lab quiz
- The only "good programming practice" that is required for
this lab is to include your name and e-mail ID in the header
comments. You are welcome to include more, but make sure you
get the programs working first, as the quiz is timed.
- The activities of this week are not to be
discussed outside of lab. The quiz is open book but nothing
else. You are to produce two programs. Templates for them are
available:
- Print.java (right click on the
link, and select "save as" (or "save target as" or "save link
as"), then save the file onto your home directory)
- MXPLUSB.java (right click on the
link, and select "save as" (or "save target as" or "save link
as"), then save the file onto your home directory)
- Complete and
submit program Print.java (right click on the
link, and select "save as" (or "save target as" or "save link
as"), then save the file onto your home directory) that
prompts from its user for a word. The program then displays the
first and last character of the word. A sample run with the
user entry underlined could be
Enter a word: subbookkeeper
The first letter of your word is s
The last letter of your word is r
- Complete and
submit program MXPLUSB.java (right click on the
link, and select "save as" (or "save target as" or "save link
as"), then save the file onto your home directory) that
first prompts its user for three floating-point values: a
slope, a y-intercept, and an x-coordinate values. The
program then uses those three values to compute the quantity
mx + b, where m is the slope value,
b is the y-intercept value, and x is the
x-coordinate value. This program MAY NOT USE the Line class of
programming assignments J2 and J3. A sample run with the user
entries underlined could be:
Enter slope: 3.5
Enter y-intercept: 4.5
Enter x-coordinate: 2.0
The corresponding y-value is 11.5
Advice
- Remember neither the lab assistants nor other students may
help you design, write, or debug the programs. If you are
having a problem getting JCreator to work right (which does NOT
mean a compilation error), or an error with the submissions,
then you may ask a TA.
- To maximize your points, make sure your programs compile
successfully.
- If towards the end things are not going as well as you
would want (i.e., the program does not compile), it might be
best to try commenting out errant statements (i.e., put a
// in front of them)