The following Figure 1 shows partial flowchart (algorithm) of number processing with multiple possible output. Analyze the flowchart and trace the process and possible output of the program. Your analysis must include the followings: (a) The possible input and output that can be produced at the end of the program (b) The flow of process and how the value of the variables in the program changes based on the input data (c) Trace and produce output based on input given in (a) (d) Explain and discuss the process in each selection structure based on obtained result Read input choice TRUE choice=='A' result1=0 number=1 Read input number TRUE <number>resulti result1-number FALSE FALSE TRUE choice=='B' FALSE number!=0 TRUE FALSE Display result1 result1=0 result2=0 Read input number TRUE number!=0 result1 result1+ number result2++ FALSE Read input number Displey invalid input result 1-result1/result? Display result 1 Read input cont TRUE cont=1 FALSE Figure 1: Flowchart
Added by Christine V.
Close
Step 1
The "choice" input can be any value, while the "number" input can be any integer value. - Output: The possible outputs at the end of the program depend on the values of the inputs and the flow of the process. Without knowing the specific values of the inputs, it Show more…
Show all steps
Your feedback will help us improve your experience
Vaibhav Jain and 95 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Terminal - Decision - Flowline - Internal module call - Input/Output - External module call - Process
Supreeta N.
Who can do these four questions?
Arjun S.
Spreadsheet models are referred to as what-if models because they: A. allow easy instantaneous recalculation for a change in model inputs B. have specialized functions to perform detailed analysis C. are mathematical and logic-based models D. come preloaded on computers In _____ decision making, companies have to decide whether they should manufacture a product or outsource its production to another firm. A. two-way B. voting-based C. make-versus-buy D. goal-seek The modeling process begins with the framing of the _____ that shows the relationships between the various parts of the problem being modeled. A. mathematical model B. correlation model C. conceptual model D. circular model A(n) _____ is a visual representation that shows which entities influence others in a model. A. influence diagram B. time series plot C. decision tree diagram D. entity chart Which of the following approaches is a good way to proceed with the influence diagram building for a problem? A. The influence diagram for all the model parts at the same level is built in parallel to reduce the likelihood of error. B. The influence diagram for the entire problem is built first and then separate portions are clustered to form separate models. C. The influence diagram for a portion of the problem is built first and then expanded until the total problem is conceptually modeled. D. The influence diagram is reverse engineered – the diagram is developed in the opposite direction starting with the model output.
Sri K.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD