Sie sind auf Seite 1von 3

Topic 1:

Nested Conditional and Iterative Statements


Objectives At the end of the lab session, students should be able to: Use conditional statements for decision-making Use iterative statements for repeating operations Use iterative statements for complex computations requiring iterations Develop algorithms for engineering formulas and applications Create a program that demonstrates the use of engineering equations

Preliminary Report to be extracted 10 minutes after the start of the class next meeting. Final Program to be extracted 10 minutes before the end of the class next meeting.
Preliminary Report Requirements
Introduction (10%, should provide a clear introduction to the concept behind the laboratory exercise. Significance of concept was properly emphasized.) Provide a brief background of conditional and iterative statements and explain its importance to engineering problem-solving applications. Concept Theory (30%, required concepts are clearly discussed; discussed concepts are correct) Concept Examples (20%, Group members provided their own examples and/or code snippets based on their understanding of the concept.) Conditional Statements C has two statements that implement decision-making: if and switch. Research about the forms of if (if, if-else, if-else if-else) and switch. Show the syntax of each statement, the equivalent algorithm/flowchart representation, and a simple example that demonstrates the use of each statement. Iterative Statements C has three statements that implement iterations and loops: while, do-while, and for. Show the syntax of each statement, the equivalent algorithm/flowchart representation, and a simple example that demonstrates the use of each statement.

Engineering Equations Research about two complex engineering equations related to your field. Equations should have at least four variables. Algorithms, Flowcharts and/or Pseudo-codes (20%, Design meets the final program requirements; flowcharts and/or seudo-codes are correct and implementable. ) Test data (10%, proposed test data are valid and can thoroughly check the validity of the final program) Teachers Evaluation (10%, group members are knowledgeable of the topic; sources and references are properly cited; written reports presented well)

Final Program Requirements


Program shows a formula selection screen that allows the user to select a formula. Formula selection screen allows the user to quit the program. Program asks the user what variable in the equation to compute. Variable selection screen allows the user to go back to the formula selection screen. Program asks values for input variables and computes the selected variable. Program goes back to the variable selection screen. User can select another variable to compute or select to go back to the formula selection screen. Program goes back to the formula selection screen. Do not use goto and/or global variables (this rule applies to all suceeding final programs).

Test Walkthrough 1. Select a formula from the formula selection screen. 2. Select a variable from the variable selection screen. 3. Compute for the variable. Provide at least 2 sets of test data per variable. 4. Enter an invalid choice at the variable selection screen. 4. Repeat step 2 until all variables are computed. 5. Repeat step 1 until all formulas are demonstrated. 6. Enter an invalid choice at the formula selection screen. 7. Quit the program. Final Program Evaluation Criteria
Program Execution (40%) Final program requirements are met. -5 is given for each final program requirement not met, for a maximum of -40. Adherence to Design (20%) Implementation is faithful to the design.

Implementation did not deviate from the flowchart or pseudo-code algorithms. Robustness (10%) Implementation is free from semantic errors, e.g. logical errors, runtime errors, etc. -2 deduction is given for each error encountered, to a maximum of -10. Code Formatting (10%) Proper indents used for conditional and iterative statement blocks. Proper literal names were used. In-line comments (where appropriate) were used. Code Efficiency and Modularization (10%) Loops are efficient. Functions are modular. Program did not make use of unnecessary variables Teacher's Evaluation (10%) Group members are all knowledgeable of the program. Program outputs are properly organized. Graphics were used to demonstrate functionalities, when needed. Program is user friendly. The lab instructor can easily navigate and use the program. Program explains what it can do.

Das könnte Ihnen auch gefallen