Assign values to variables using basic arithmetic operations x=3 y = x/10 z = x +25 Get input from user Get x Print to user (screen) Print "The value of x is " x Conditionals if (a > b) print "largest is" a else print "largest is"
The for Loop and Practice Problems CS 107
Stephen Majercik Use
To repeat execution of a statement (possibly a compound statement) once for each value of a specified range of values. The values may or may not be used in the statement being executed. This i
The Assignment Statement CS 107
Stephen Majerck Use
To assign a value to a variable. Another way to think about this is that you are storing a value in a particular memory location, and the name of the variable, or its identier, is a human-friendly way of
The while Loop and Practice Problems CS 107
Stephen Majercik Use
To repeat execution of a statement or group of statements as long as a specied condition is satised. Note that the statement may not be executed even once if the condition is not satised whe
CS101 - Lab 3
Introduction to Java programming: arrays
The goal for this lab is to put together everything you've seen so far in this class: basic
instructions, conditionals, loops and list variablesarrays. Start by reviewing the problems we did
CS101 - Lab 5
In this lab you will do more problems involving arrays and strings in Java.
As you read and try to figure out each problem, look over the examples that we did in class.
They will answer many of the questions you may have. Also, there will be
CS101 - Lab 6
In this lab you will implement a cellular automaton.
Always start by thinking of the problem top-down. Split it into logical steps, and write one step
at a time. Then compile it, and check if it does what you want. Write your code incrementa
CS101 - Lab 4
In this lab you will put to work with all the Java elements we have covered so far: conditionals,
loops, nested loops, arrays, and Strings.
Programming style: Pay attention to issues of programming style:
comment your code
CS101 - Lab 2
Introduction to Java programming: loops
The goal for this lab is to get you confortable using loops. Start by reviewing the problems we
did in class and read carefully the lecture notes. Then go ahead and start on the problems below.
CS101 - Lab 1
Introduction to Java programming: basic instructions and conditionals
The goal of this lab is to get you confortable using the basic instructions in Java: communicating
with the user (reading and writing), declaring and manipulating variable