Getting Started Lab
This is a lab assignment and so you will not be submitting it. However, the concepts and practice will help you on both the homework and exams so I encourage you to make a serious effort on it during class and consider finishing it outside of class.
Exercise 0
- Mount the COURSES drive
- Create a new folder in your STUWORK folder called
Lab1
- Open VSCode
- Click and drag you
Lab1
folder to the VSCode window to open it - Create a new file named
Hello.java
- Drag up from the bottom of the VSCode screen to open a
Terminal
Exercise 1
You’ll now test out using Gradescope.
- Navigate to Moodle, today’s class section and click on the “In Class Assignment” Gradescope link
- Upload
Hello.java
to Gradescope (yes, even though it’s empty) - Notice what the autograder does when your code doesn’t work correctly
- In
Hello.java
, write the necessary code to print out “Hello world!” - Verify your program works by typing in the Terminal
javac Hello.java
and thenjava Hello
- Upload
Hello.java
to Gradescope again and make sure that you pass the “Check if it prints correctly” test case - Add your partner to the submission on Gradescope
Exercise 2
You’ll be required to include README.md
documents for all your homework this term. .md
is a Markdown file, which is a specific way of formatting files, commonly used in programming projects (including this website :D). You can see an example README here.
Here are the important formatting aspects:
#
makes a large heading,##
medium,###
small, use them to mark sections of your document*
makes a bulletted list, you can also use numbers1.
- Three ` (the key to the left of 1) start a section of code and three more end that section
- One ` makes an inline “code” formatting
like this
, good for variables and class names *word*
makes word italic**word**
makes word bold
Use this information to make a README for your submission, along with a document Collaborations.txt
that just has both partners’ names. Verify that you pass all test cases once you upload these two documents as well.
Exercise 3
Let me know that you’ve submitted your Gradescope assignment. I’ll aim to give you ‘feedback’ right away so you can see what that looks like as well.
Extra
The cool thing about object-oriented programming is that you can simulate nearly anything in the real world. If you have extra time, aim to practice private and class variables, creating objects of your own making, and other Java functionality, by making a basic class with the ingredients below. I include some ideas at the end if you would like to use one of them.
Ingredients
- Create a new class in its own file, which I’ll refer to here at
YourClass
YourClass
has and uses at least one private variableYourClass
tracks how many instances ofYourClass
have been created (using a class variable which uses thestatic
keyword!) and uses that numberYourClass
’smain
creates at least one instance ofYourClass
(more would be great!)main
takes at least one command line argument and uses it meaningfullyYourClass
takes user input while the program is running and uses it meaningfullyYourClass
prints out something useful
Ideas
- Library catalog
- Sport stats displayer
- Song recommender
- Tweak the above ideas to be about cooking recipes, video games, workouts, or anything else that interests you