


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































05_methods_menus.ppt
Top-Down Design - Analogy
Input -> Process -> Output
one program or placed in a library and used by many different programs.
converts strings to numbers, and is used by many different programs.
Convert Text to Integer – int.Parse
If txtQuantity.Text contains “3” then the function call:
intNumber = int.Parse(txtQuantity.Text)
would return a value of 3 into intNumber.
MessageBox.Show(TextMessage); MessageBox.Show(TextMessage, TitleBar); MessageBox.Show(TextMessage, TitleBar, ButtonType); MessageBox.Show(TextMessage, TitleBar, ButtonsType, Icon);
private decimal calcExtendedPrice(int intQty, decimal decPrice) { decimal decExtendedPrice; decExtendedPrice = intQty * decPrice; return decExtendedPrice; }
private decimal calcExtendedPrice(int intQty, decimal decPrice { if (intQty < 26) return intQty * decPrice; else return intQty * (decPrice * .95); //5% discount }
private decimal calcExtendedPrice(int intQty, decimal decPrice ) { decimal decExtendedPrice; if (intQty < 26) decExtendedPrice = intQty * decPrice; else decExtendedPrice = intQty * (decPrice * .95); // 5% discount
return decExtendedPrice; }