strShortWoodType WoodTypestrWoodType if strShortWoodType error float fTotal

Strshortwoodtype woodtypestrwoodtype if

This preview shows page 3 - 4 out of 4 pages.

strShortWoodType = WoodType(strWoodType); if (strShortWoodType != "error" ) { float fTotal = CalculateTotalCost(strWoodType, intAllDrawers); MessageBox .Show( "The total code is " + fTotal + "." ); } else MessageBox .Show( "Please enter the correct wood type (mahogany, oak or pine)." ); }
Image of page 3
else MessageBox .Show( "Sum of all drawers is zero. Please higher the number of desk or drawers." ); } } } else MessageBox .Show( "Please enter the correct wood type." ); } private int NumberOfDrawers( int intDrawersPerDesk, int intAllDesks) { return intDrawersPerDesk * intAllDesks; } public string WoodType( string strTreeType) { switch (strTreeType) { case "mahogany" : { strTreeType = "m" ; break ; } case "oak" : { strTreeType = "o" ; break ; } case "pine" : { strTreeType = "p" ; break ; } default : { strTreeType = "error" ; break ; } } return strTreeType; } private float CalculateTotalCost( string type, int intAllDrawers) { float fCost = 0f; if (type == "p" ) fCost = 100 * intAllDrawers; else if (type == "o" ) fCost = 140 * intAllDrawers; else fCost = 180 * intAllDrawers; fCost = fCost + (intAllDrawers * 30); return fCost; } } }
Image of page 4

You've reached the end of your free preview.

Want to read all 4 pages?

  • Fall '13
  • Davao¬†City, Davao College, wood type, Edward Lance Lorilla, correct wood type

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes