Robotics C++ Physics II AP Physics B Electronics Java Astronomy Other Courses Summer Session  

Exercises

Exercise 1

Exercise 4

Exercise 7

Exercise 10

Exercise 13

Exercise 2

Exercise 5

Exercise 8

Exercise 11

Exercise 14

Exercise 3

Exercise 6

Exercise 9

Exercise 12

Exercise 15

 

Exercise 1

Create a one-dimensional array and populate it with 100 random integers from 0 to 99, including the end points

Print the elements of the array, 10 elements per line, with a space between each element.

Find and print, appropriately labeled, the sum of the elements in the array.

Exercise 2

DO THIS WITHOUT USING AN ARRAY

Print the odd integers between 1 and 99 backwards

Print the number, followed by the sum to that point, separated by a comma

Put a space between the number pairs for readability

Print the pairs 5 per line

Exercise 3

Create an array consisting of 100 random integers in the range 100 to 500, including the end points

Print the array, 5 numbers per line, with a space between each

Find and print, appropriately labeled the following. (Print the part number prior to each section of code)

   Part 1: The smallest number in the array

    Part 2: The largest number in the array

    Part 3: The sum of the numbers in the array

    Part 4: The prime numbers in the array 

Exercise 4

Create an array consisting of 100 random integers in the range 100 to 800, including the end points

Print the array, 5 numbers per line, with a space between each

Find and print, appropriately labeled, the number that occurs the most often (if there are ties, print only 1)

Exercise 5

 

Exercise 6

 

Exercise 7

 

Exercise 8

 

Exercise 9

 

Exercise 10

 

Exercise 11

 

Exercise 12

 

Exercise 13

 

Exercise 14

 

Exercise 15