views:

91

answers:

2

I am using Microsoft Visual Studio 2008 with VB.NET, and in class we were assigned this project:

A procedure should calculate a 2% price increase on all red shirts, but a 1% price increase on all other items. In addition to calculating the price increase, the procedure also should calculate the new price.

You can use the variables strItemColr, strItem, decOrigPrice, decIncrease, and decNewPrice. Format the original price, price increase, and new price in the lblOriginal, lblIncrease, and lblNewPrice controls, respectively.

Write the Visual Basic code.

If not an answer, just some help please. I'm 16 and I am in the highschool/college class. Our teacher teaches via Skype at the college so I am limited to her help.

+3  A: 

I would not try to solve the problem, I will just give you hints. Is that fair? And on purpose I will use different variable names so it's more clear:

'Check the shirt color
If shirtColor = "Red" Then
    increase1 = oldprice1 * 0.02
    newPrice1 = oldPrice1 + increase1
Else
    increase2 = oldPrice2 * 0.01
    newPrice2 = oldPrice2 + increase2
End If

Now, to get an A from me, you would have to create an enumeration of the colors instead of teh string or use an existing enumeration like the System.Drawings.Color Strings are tricky and one spelling mistake or a capitalization of a letter and it's a different color for VB.NET

Miroslav Jeliaskoff
tip: set a ' at the end of the first line to get some other colo[u]rs
Default
A: 

Thanks guys! These really helped. Especially Miroslav and Dave. My teacher decided to come help some of the other students out (we only have like 6) because its a bit harder when you arent actually with the teacher. Thanks alot!

Earl
FYI: stackoverflow isn't like acstandard message board. You shouldn't add extra info or comments as "answers" on your question, edit your question, or add comments to other answers
Binary Worrier
Ok... no big deal unless its gonna destroy the sites server. Im finished anyway you may delete my question.
Earl