CSC 241 Lab 3

docx

School

University of Wisconsin, Madison *

*We aren’t endorsed by this school

Course

740

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

7

Uploaded by MegaFlagGoldfinch46

Report
Lexi Siegel CSC 241 Lab 3 6/19/21 Purpose of Experiment To construct a program that demonstrates repetition program control. Code for Lab 3: Looping Control with Java - Game Play: Seize the Station
Output In Console Screen
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Questions and Answers Concerning this Computer Project (1) What is meant by repetition program control? Can sequential program control be used in conjunction with repetition program control? Repetition program control is when there are loops within the code that cause some code statements to be executed repetitively. Yes, sequential program control can be used in conjunction with repetition program control. (2) How is repetition program control used in this application? Repetition program control is used in this application by incorporating a for loop to ask the user if they would like to proceed. (3) The original starter code for this application has a for() loop with twenty iterations? Were you able to reach the objective of seizing the station within this number of iterations? Explain your answer. No, I was not able to reach the objective of seizing the station within this number of iterations. There were many times when I did not take steps forward, and instead my health was negatively impacted, which caused it to take longer to achieve the goal. (4) How were random numbers used in your program? Random numbers were used in my program to determine whether the user would move forward or if the user’s health would be negatively impacted. They were also used to determine whether an additional companion would team with the player to assist in reaching the goal in a faster pace. (5) For implementation of repetition control in this application, could a while() loop be used here instead of a for() loop? For implementation of repetition control in this application, a while() loop could be used here instead of a for() loop.