- Import features from the Java Standard Library
- Declare and instantiate a
Scanner
- Get input from the user using a
Scanner
- Use a
while
loop to get the computer to repeat instructions - Use a
for
loop to get the computer to repeat instructions - Use a
switch/case
structure to get the computer to make a decision - Use nested loops and decisions to control the flow of a program
- Accumulate a total in a variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Global Variables | |
speedFwd = 70; % Forward speed | |
speedBwd = -70; % Backward speed | |
speedTurn = 40; % Turning speed | |
sensorPort = 4; % Color sensor port | |
ultrasonicPort = 2; % Ultrasonic sensor port (right side) | |
thresholdDistance = 20; % Ideal distance from the wall | |
maxTurnTime = 1.0; % Max turn duration to avoid circles | |
global key |
OlderNewer