Lab 1

Compiling and Interpreting ๐Ÿง‘โ€๐Ÿ”ฌ

Labs provide hands-on experience with course material. They have three parts: review questions, guided exercise, open-ended exercise.

The first few Labs provide practice with fundamentals, and the later Labs go hand-in-hand with the term project check-ins.

Tips are at the very bottom. You should read them.

Part 1/3: Review Questions

Answer the following questions from our course textbook. If you have trouble getting a copy of the book, email me and check the KCTCS libraries. Type your answers all the way out โ€“ don't just say "a" or "b" or etc.

  • Chapter 1, Review Questions: 2, 6, 8, 15, and 19
  • Chapter 1, Exercises: 1 and 5 (note, you can use jspaint.app to doodle a flowchart if you'd like)

Also answer these questions:

  1. What do you hope to get out of this course?
  2. What problems do you think you might have in completing the work in this course or getting a good grade?
  3. Send me an email that says hello
  4. Story Problem: ACME Recipes published a recipe book with the following recipe by mistake. All the lines got scrambled! Put the recipe back in the correct order. If there are multiple correct orders, make a case for why yours is the best.
    Put chocolate chips into the mixing bowl.
    Put beaten eggs into the mixing bowl.
    Add double cream into the mixing bowl.
    Put the baking dish into the oven.
    Turn off the oven.
    Pre-heat the oven.
    Put sugar into the mixing bowl.
    Grab a clean mixing bowl.
    Put flour into the mixing bowl.
    Put cocoa  powder into the mixing bowl.
    Put baking powder into the mixing bowl.
    Pour the contents of the mixing bowl into the baking dish.
    Put butter into the mixing bowl.
    Wait until baked.
    Mix the contents of the mixing bowl well.
    Serve with chocolate sauce.
  5. (Come back and answer this question after completing the rest of the assignment) What problems, if any, did you encounter at any point in this Lab? What did you do to overcome them?

Part 2/3: Guided Exercise

Let's do an activity to get you familiar with helpful resources and course tools.

First, pick THREE languages that are available for this course:

  • Compiled Languages: C/C++, C#, Java, or Visual Basic
  • Interpreted Languages: Javascript, PHP, Python, or Swift.

Second, familiarize yourself with the online resources for those three languages. Languages are always evolving, so being aware of what information is out there is a skill I want you to make a deliberate effort to practice. There are a lot out there, and Google will be your enemy, especially if you are learning PHP or Javascript. Instead, as you go through this course, I highly recommend you reference these links below, answering any questions you have about your language by navigating their table of contents, then reaching out to me via email with any questions you still have:

Third, describe what sort of information is available to you for those three languages on the sites listed above. How are those websites organized? How often do they define terms? How often do they give working examples? And so on.

Fourth, find (still on those sites I linked above) a "hello world" example for each of those three languages. Take and embed a screenshot of each. (Javascript: The "hello world" example for Javascript is a bit hard to find, it's here.)

Fifth, visit http://repl.it/ and sign up for a free account. You can make your username whatever you wish. All programming you'll do for this course you'll do on Repl.it.

Sixth, pick just two of your three languages and make a new "repl" for it:

Embed screenshots showing your two blank repls. For example, this is what I get when I create a repl for the Julia language:

Blank Julia repl example.

Finally, refer back to the hello world examples that you found earlier. Make your two repls display the text "hello world" if they aren't already by default. Then revise them so they display "Hello {your name here}" instead and click the Run button. Embed screenshots showing your code and your results.

For example (Note: Yours will look different from mine! We're using different languages, since I'm using Julia, and you're not!):

Hello name Julia repl example.

Optional Fun Exercise

This is completely optional, not worth extra credit or anything, just a fun warm up. I do encourage you to, as you best see fit, try basing a few Tinker journals on these optional exercises though.

Start a new Python repl with this code:

# Load...
from turtle import *

# Initialize...
tim = Turtle()

# Draw!
tim.forward(100)
tim.right(90)
tim.forward(100)

Add to and modify the code (trial and error) to make these shapes:

  • a square
  • a rectangle
  • a triangle (any kind)
  • a house
  • a five-point star

Embed screenshots showing me your art!

Part 3/3: Open-Ended Exercise

Let's do an activity that lets me learn a little more about you.

(Note: New this semester, I've updated my plagiarism policy to account for AI-assisted coding.)

First, pick just one of the eight course languages. This can be any of the eight. It doesn't have to be one of the three you chose above. This does not need to be the language that you want to stick with in the long term for the course. You should pick a language you are interested in trying out, and you can tell me more about it / your preferences in your first Check-in.

Second, create a new repl for your language and make your program display "Hello {your name here}". For example, "Hello Alice" or "Hello Bob".

Third, copy and paste the "print" line of code a few times, one line after the other. You should only copy and paste one line of code. If you are using a language like Java, for example, don't copy and paste the whole thing.

Fourth, change the second and third prints to say "I'm going to ask you some icebreaker questions today" and "Let's begin!" Run your code again to make sure it still works and is displaying multiple lines of output. Embed screenshots of your code and results.

For example:

Multiple prints Julia example.

Fifth, continue to add to and modify your program so that it prints each of the following questions, then prints your personal answers to those questions:

  • What is your name?
  • Where are you from?
  • What year of college are you in?
  • Pets?
  • Where do you see yourself in five years?
  • What do you NOT want to receive as a birthday present, and why?
  • What Operating System do you use on your personal computer(s)?

Feel free to add additional lines to add details like "โ€“โ€“โ€“โ€“" or other "decorations" to make the code/output easier to read.

Sixth (almost done), have the program end by displaying the following list of items with your "ranking" next to each. Rank them 1 to 5 (1: Never Heard of It. 2: Some Idea What It Is. 3: Clear Idea but Never Used It. 4: Clear Idea and Used It At Least Once. 5: I Have Used It and I Can Explain Why and When We Should Use It.).

  • File Extensions
  • Text Editor
  • ZIP Folder
  • Programming Languages
  • Operating Systems
  • Data Types
  • Numerical Data
  • Comments
  • String Data
  • String Concatenation
  • String Interpolation
  • Console I/O
  • Control Structures
  • If/Else
  • Loops
  • Methods
  • Objects/Classes
  • File I/O
  • Try/Catch

Finally, take and embed a screenshots (or multiple screenshots if you need to scroll) that shows the final version of your code and the final version of your output.

Submission

Complete Parts 1, 2, and 3 in a single Word/etc. document, then submit your document as a Word or PDF file (NOT a .pages file) to Blackboard.

Grading

Each Lab is worth 6/100 towards your final grade.

6/6 - Great job, maximum points! The student completes the Lab accurately and sufficiently and honestly, demonstrating the best of their ability.

3/6 - Student completes most but not all of the Lab. Or, student completes the Lab, but only to the minimal letter of the prompt, not actually applying the concepts of the unit. If you encounter problems or have questions, be sure to send me an email well before 24 hours before the due date, then continue to attempt to resolve the issue on your own while you wait for a reply.

1/6 - Student completes less than half of the Lab with sufficient work, or student leaves entire sections blank. Make sure that you are leaving yourself enough time to complete assignments, as usually students submit incomplete work because they were rushed at the last minute.

0/6 - Student does not submit on time or submits plagiarized or unacceptable work. Double check that you have submitted the right file, as usually students get zeros because they submitted a previous week's work by accident.

Tips

How Do I Take a Screenshot?

In Windows: Open your Start menu and search for the Snipping Tool. Use that.

In Mac: Cmd+Ctrl+Shift+4, then Cmd+V into your Word document

In Linux: If you have a GNOME shell, I recommend the Screenshot Tool extension.

On a Chromebook: I recommend the Full Page Screen Capture extension.