CS 151 - Lecture 1

Cover page image

Cay S. Horstmann

CS 151

The Textbook

What You Need to Succeed

Prerequisites
Time
Laptop

Questions

Plagiarism and Cheating

Git

Adding

Things To Do Today

Lab

A Simple Programming Problem

  1. Solve this simple problem: In Java, implement the method Arrays.swapLargestAndSmallest(int[] a) that swaps the largest and smallest element in a. If there are multiple largest or smallest elements, pick the first one.
  2. Check your answer in CodeCheck.

Installing Git

Adding to the Repository

  1. In the cs151 subdirectory that was created by git clone, make a subdirectory lab1
  2. In that directory, make a file Arrays.java with the solution to the simple programming problem. If you couldn't solve the problem, just put in the outline from CodeCheck.
  3. Open a terminal and change to the directory into which you cloned the repo:
    cd cs151
    
  4. Type
    git add lab1/Arrays.java
  5. Type
    git commit -a -m "Added lab1"
  6. Type
    git push origin master
  7. In the BitBucket web interface, locate Arrays.java
  8. Did you find it? Hooray—you have just reached level 2.