Sunday, March 10, 2019
Programming – Example of a Selection Structure
IntroductionThe purpose of this paper is to provide a round-eyed poser of a selection expression that is contained as protrude of the Programming Solution Proposal I am developing throughout the course of this scheduling class. The selection bodily social system I chose to make an example of isnt really inclusive as part of my original planming proposal due in week 5, however, I devised a actually simple If-Then-Else structure that uses somewhat of the same information and calculation as what I may use in my utmost proposal. Ive write the pseudocode for a section that at this time appears to make sense to use, disposed(p) the selection structure I chose, and I also paralleled that with a opthalmic Logic com/cards/flowchart. The visual logic flowchart was go throughd in good sanctify with specific values that are to be used in order for others to properly try it. These values will change as the program gets fine-tuned, however, for now there are specific values that mus t be used to obtain the correct percentages. Purpose of the structureThe reason I chose the If-Then-Else structure is because it watch overmed 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 non be included as part of my final proposal paper, I thought it would be good to work with and vagabond if I could somehow make it work. The program Ill ultimately be creating is one where seasonal stats will be entered in by an admirer coach, for athletes on any given basketball team.Through this they will be commensurate to determine a players overall field goal total, free gift percentage, rebound average, etc. However, for now, Ive decided to simply use an If-Then-Else structure that displays a friendly out institutionalize message of what the user might see if he/she entered their field goals attemptedvalue and field goals made value. The pseudocode for the If-Then-Else structureAgain, I must reite rate, that the selection structure I chose to use may not be part of my final proposal paper, however, the pseudocode that is displayed below is a simple and short example of how I used the information for my original proposal, use the If-Then-Else structure deliver Enter amount of field goals attempted foreplay FGA Write Enter amount of field goals made Input FGM suffice Average = 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 game finis IfVisual Logic flowchart The Visual Logic flowchart I put together, which parallels the pseudocode above, has been executed successfully. The field goal average in this VL example is metric using the following values FieldGoalAttempts (FGsAttempted) 5000FieldGoalsMade (FGsMade) 50 The values for the variables above test the True decision statement. Entering the follow ing values below execute and test the False decision statement FieldGoalAttempts (FGsAttempted) 2000FieldGoalsMade (FGsMade) 50 The .vls file has been uploaded as a separate attachment in the Assignments tab of the UoP Student website.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment