Homework 6 - Arrays
Due date: Thursday, Nov. 17, 2005
- Problem 21, page 611.
Related problems: Ch. 5, #24, p. 295; Ch. 6, #15, #16, p. 360.
- Carefully read and study the contents of Chapter 10 (Arrays).
- As we have been discussing in the last two or three lectures, MyJava Coffee
Outlet has gone into the fast-food
business (MyJava Lo-Fat Burgers). They provide a computer screen, a mouse, and
a keypad for its customers.
You are hired as a freelance computer consultant. Write a Java program
that lists items for three categories:
Entree, Side Dish, and Drink, accepts orders from users, and
produces what's asked for in problem 21.
The following table lists the items
available for each entry and their prices.
Entree |
Side Dish |
Drink |
Tofu
Burger
$3.49 |
Rice Cracker $0.79 |
Cafe Mocha $1.99 |
Cajun Chicken
$4.59 |
No-Salt Fries $0.69 |
Cafe
Latte $1.99 |
Buffalo
Wings $3.99 |
Zucchini
$1.09 |
Espresso
$2.49 |
Rainbow
Fillet $2.99 |
Brown
Rice $0.59 |
Oolong Tea
$0.99 |
- As illustrated in yesterday's (11-10-05) lecture, a typical session might
look like: My Java Lo-Fat Burgers.
- There is another form of showInputDialog, it creates drop-down
boxes for input. I created
a small example, DropDown.java. Download it, compile, and run. Then look at the code - it will be clear
how to create and use your own input drop-down's.
- I rewrote the input portion of the program to use input drop-downs. Here's
some screen shots using this
version of the program: Drop-Down Version.
Feel free to use either method (or Scanner class) for input.
- Submit your program according to: Guidelines for Project Submissions
- The beginning comments of your .java files should at least include:
-
Name: <Your Name>
Homework No.: 6
Course Name: CSC 211
Section No.: <101>
Brief description of what the program is designed to do.
- Good luck and have fun!