Algorithm Statements 1 Declare variables int intDrawersPerDesk 0 int

Algorithm statements 1 declare variables int

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

Algorithm Statements 1. Declare variables int intDrawersPerDesk = 0, int intAllDesks = 0 with int data types. 2. Declare variables string strWoodType = textBoxWoodType.Text; with string data types. 3. checking if textBox of wood type is empty: string strWoodType = textBoxWoodType.Text; 4. if (strWoodType != String .Empty) checking if its a number for number of desks 5. if ( int .TryParse(textBoxDrawsPerDesk.Text.Trim(), out intDrawersPerDesk)) checking if its a number for number of drawers 6. if ( int .TryParse(textBoxAllDesks.Text.Trim(), out intAllDesks)) calculations, and checking of any of the numbers are zero 7. int intAllDrawers = intDrawersPerDesk * intAllDesks; checking exact wood type 8. string strShortWoodType = strWoodType; adding a surcharge for each drawer: 9. fCost = fCost + (intAllDrawers * 30); 10. display The total code is " + fCost + "." ); . 11. Display "The total code is " + fCost + "." ; //the total cost of the desk 12. Display ( "Please enter the correct wood type (mahogany, oak or pine)." );//if the user type the wrong wood 13. Display "Sum of all drawers is zero. Please higher the number of desk or drawers." , // if the user have a zero desk/drawers 14. Display Please enter the correct wood type." // if the user type the wrong wood Pseudo-code Start: int intDrawersPerDesk = 0; int intAllDesks = 0; //1. checking if textBox of wood type is empty: string strWoodType = textBoxWoodType.Text;
Image of page 2
if (strWoodType != String .Empty) //2. checking if its a number for number of desks if ( int .TryParse(textBoxDrawsPerDesk.Text.Trim(), out intDrawersPerDesk) //3. checking if its a number for number of drawers
Image of page 3
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