.

Friday, January 25, 2019

Programming – Example of a Selection Structure

IntroductionThe purpose of this paper is to show a simple model of a selection structure that is contained as objet dart of the Programming Solution Proposal I am exploitation throughout the course of this programming class. The selection structure I chose to even up an example of isnt really inclusive as part of my master copy programming proposal due in week 5, however, I devised a very simple If-Then-Else structure that put ons somewhat of the same information and computation as what I may use in my final proposal. Ive written the pseudocode for a section that at this time come forths to make smack to use, given the selection structure I chose, and I also paralleled that with a Visual Logic com/cards/flowchart. The visual logic flowchart was penalise correctly with specific values that are to be used in order for others to properly test it. These values will change as the program gets fine-tuned, however, for now there are specific values that must(prenominal) be used to obtain the correct percentages. Purpose of the structureThe reason I chose the If-Then-Else structure is because it seemed to make the most sense for my program and it didnt appear to be too complicated a structure to master. Even though this structure may not be included as part of my final proposal paper, I thought it would be good to ply with and verify if I could somehow make it work. The program Ill ultimately be creating is one where seasonal stats will be entered in by an assistant coach, for athletes on any given basketball team.Through this they will be able to determine a players overall field inclination average, bare throw percentage, rebound average, etc. However, for now, Ive decided to simply use an If-Then-Else structure that displays a friendly output message of what the user might see if he/she entered their field goals movevalue and field goals make value. The pseudocode for the If-Then-Else structureAgain, I must reiterate, that the selection structure I chose to use may not be part of my final proposal paper, however, the pseudocode that is displayed under is a simple and short example of how I used the information for my skipper proposal, using the If-Then-Else structure Write Enter amount of field goals attempted enter FGA Write Enter amount of field goals made Input FGM Set sightly = FGM / FGA If Average => 50 Then Set FieldGoalAverage = Average Write Your field goal average is + FieldGoalAverage + % Else Write Your field goal average is + FieldGoalAverage + % Write You need to work on your shooting crippled End IfVisual Logic flowchart The Visual Logic flowchart I put together, which parallels the pseudocode to a higher place, has been executed successfully. The field goal average in this VL example is calculated using the following values FieldGoalAttempts (FGsAttempted) 5000FieldGoalsMade (FGsMade) 50 The values for the variables above test the True decision statement. Entering the following values below execute a nd test the False decision statement FieldGoalAttempts (FGsAttempted) 2000FieldGoalsMade (FGsMade) 50 The .vls institutionalize has been uploaded as a separate attachment in the Assignments tab of the UoP disciple website.

No comments:

Post a Comment