CSC 230: The Week beginning Oct. 29
|
Homework
Provide a brief definition of the following terms (in the interface
programming context):
- Magic numbers
- Compile Error
- Run time error
- Debug
If you use a source (book or web site), cite your source. (The sites
http://whatis.techtarget.com/ and http://www.webopedia.com/ are decent
sources for technical definitions.)
Movies Revisited
MovieFromFile.doc
MovieFromFile.zip
Due: Nov. 5
-
Monday
Morse.csv
The above file has a strange character that looks
like a space but is not. If you recall this also
happened when we made the list of color names.
Open the file in Notepad, highlight the space-like
character and copy it. Then go to Find and Replace
and paste the character (Ctrl-v) into Find and leave
Replace blank, then choose Replace All.
MorseZip.zip (demos an
array of dynamic controls with events)
-
Wednesday
WriteALetterZip.zip (Dialogs and StreamWriter)
-
Thursday
Old navy
OldNavyZip.zip (files and exe)
- Use backgroundtitle.gif as the Form's BackgroundImage
- Have a PictureBox in the upper left with its BackColor set to
Transparent and its Image set to logo.gif.
- Parse the file OldNavyItems.txt and make arrays for at item's
name, its description, its price, the end of its file name
(e.g. LogoHoodie.jpg),
and its set of colors which will be a
comma-separated string (e.g. Black,RoosterRed,DarkSeaBlue).
- Place the item names in a listbox on the left.
- To the right of the ListBox have a Label (for a description),
a PictureBox (for
an image of the item), and a Panel (for colors, see below).
- When the user selects a item from the ListBox
- Display the corresponding description in the Label.
- Clear the panel's controls (just like clearing a ListBox of Items).
- Parse the color set.
- Use the resulting array to generate an array of dynamic
PictureBoxes (15 by 15).
- Add the Pictureboxes to the Panel, their Y position values can be zero (within
the Panel) and their X position values should be spaced out.
- Load the PictureBox's Image with a file based on the element from
the parsed color array and the extension ".gif".
- Have a global color variable and set it equal to the first color in
the array.
- Concatenate the first color in the array and the end of the selected item's
file name (one of your global arrays) and ".jpg" (e.g. DarkSeaBlueLogoHoodie.jpg)
and use that to display an
image of the selected item with the first color.
- Assign the PictureBox's Tag propety a value equal to the color element (e.g.
DarkSeaBlue).
(I think of the Tag Property as a control's "secret compartment" for storing useful
information.)
- Use AddHandler to give the PictureBoxes three events: MouseEnter, MouseLeave
and Click. (An exe is provided, mouse over and click on the color PictureBoxes to see
the effect.)
- The MouseEnter subroutine should concatenate the sender PictureBox's Tag (a color)
with the Selected Item's "end of file name" and ".jpg" to display the image of the
selected item having the color the user's mouse is over.
- The MouseLeave subroutine should go back to the global color variable
and change the image.
- The MouseClick subroutine should change the global color variable
to correspond
to the sender's Tag.
- When the user clicks the Add to cart Button, make sure that an item is selected,
and make sure that a size is selected.
- Then add the quantity, name, color, size and price information to the cart
TextBox.
- Keep a running Total and Display it.
- When the user clicks the Save Button, use an OpenFileDialog to allow the
user to save the cart information and Total.
- When the User clicks the Clear Button, deselect any selected item.
- Then clear out the PictureBox, the description Label, the Panel, the cart TextBox,
the total TextBox (also set any total variable to zero).
- Also deselect any size RadioButtons and set the Quantity (NumericUpDown)to 1.
-
Friday
UserControls.ppt
YahtzeeZip.zip