Colorado State University Logo | CS 150: Culture and Coding (AUCC 3B/GT-AH3) Colorado State University Logo | CS 150: Culture and Coding (AUCC 3B/GT-AH3)
CS 150: Culture and Coding (AUCC 3B/GT-AH3)
Computer Science

Lab 01 - Your First Program

Introduction

Welcome to your first lab. You will find that throughout the semester the labs will have three to five problems that you will need to solve. As you progress, those problems will get harder, and you will have more freedom in choosing how you solve them.

For this lab, you will learn

  • Modifying a basic System.out.println
  • Initializing variables
  • The differences between System.out.print and System.out.println

Part 0: What’s in a Name

For all labs, you will want to modify your name and email by the author line

/* ..
 * @author YOU NAME <br>
 *         YOUR EMAIL<br>
 */

You should do this now!

Part 1: First Programmer

Recall from the lecture, who wrote the western world’s first computer program?

You should add a space in the quotes in the following line of code, and type in her name.

 public static void main(String[] args) {
    System.out.println("The first computer program was written by:");
    //...
 }

Once that is done, you should click the “run program” button.

Part 2: Initializing a Variable

Note the following line of code that declares the variable theAnswer:

int theAnswer;

You need to initialize the variable theAnswer to be 42.

Part 3: Printing out The Answer

For your last problem in this lab, you should print out theAnswer on the line following the quote followed by a new line.

Which function should you use? print or println?

Turning In

Once you have completed all three above, and it looks correct, you can click ‘Submit Mode’ and then ‘Submit for Grading’.

You have up to five submissions, so make sure it is correct before submitting.

Computer Science Department

279 Computer Science Building
1100 Centre Avenue
Fort Collins, CO 80523
Phone: (970) 491-5792
Fax: (970) 491-2466

CS 150: Culture and Coding (AUCC 3B/GT-AH3)

Survey of computer science, formal logic, and computational thinking. Explores the historical, gender, and cultural perspectives on the role of technology in society. Includes learning a basic programming language. Students will be expected to write small programs, and construct written arguments on ways in which technology influences our modern culture. Previous computer science experience not necessary.