Skip to content

dakgitk/programming-2

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Programming 2

Welcome to the Programming 2 course! πŸ‘‹ In this course, we will deepen our programming skills and apply previously learned programming techniques, including in the context of databases. In addition to syntax and necessary libraries, we will focus on unit testing, automation tools, and version control.

πŸ‘‰ Full course description

πŸ“… Weekly schedule

The course requirements include weekly exercises covering different areas of the course. GitHub Classroom will be used for the technical implementation of the exercises. Exercises must be submitted according to the schedule, and late submissions will generally not be accepted. In cases of force majeure, extensions must be requested well in advance of the exercise deadline.

There are two types of weekly sessions:

  • Theory sessions on Tuesdays at 11:00 - 13:45 (lunch break at 11:45 - 12:30). During these sessions we will cover the week's topic.
  • Lab sessions on Thursdays at 11:00 - 13:45 (lunch break at 11:45 - 12:30). During these sessions we will work on the week's exercises.

The course's attendance policies follow Haaga-Helia's common policies. Attendance should be marked on Moodle during each session.

The weekly topics and exercise deadlines can be found below. The exercise descriptions can be found in Moodle's "Exercises" tab.

πŸ‘‰ Here are the code examples covered during the lessons

Week Topic Deadline
1 Version control and tools of the course 31.3. at 23:59
2 The Map data structure 7.4. at 23:59
3 Unit testing 14.4. at 23:59
4 Inheritance and interfaces 21.4. at 23:59
5 Streams and lambdas 28.4. at 23:59
6 JDBC & DAO 5.5. at 23:59
7 Data structures and algorithms 12.5. at 23:59
8 Advanced and applied topics 18.5. at 23:59

Week 1: Version control and tools of the course

Important

To confirm your course participation, it is necessary to submit the first week's exercises before the deadline.

In the first week of the course, we will get acquainted with the tools we will be using throughout the remainder of the course. Our goal is to enable the application to run smoothly outside of the code editor and to automate if needed, the building, dependency installation, packaging, and testing of the application.

Git version control will be used in this course for distributing assignments, submitting them, and for automatic evaluation. In future courses and in working life, you will likely use version control as an essential part of daily work.

The course's Java content revisits topics covered in Programming 1, aiming to ensure that by the end of the first week, all participants have a sufficient foundation in topics like collections and object-oriented programming to study the subsequent topics.

Recommended materials

Command-line/terminal:

"In your development process, you'll undoubtedly be required to run some commands in the terminal (or on the "command line" β€” these are effectively the same thing). This article provides an introduction to the terminal, the essential commands you'll need to enter into it, how to chain commands together, and how to add your own command line interface (CLI) tools."

Command line crash course. mdn web docs.

Git:

Gradle:

Java in Visual Studio Code:

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle. Submitting the "Git installation and GitHub account" exercise in Moodle is necessary to receive exercise points.

  • Git installation and GitHub account
  • Git "Hello world"
  • Warming up

Week 2: The Map data structuce

"Maps are data structures stores a collection of key-value pairs. Each key is unique and allows for quick access to values. A real life example of a map could be storing the grades for students in a class (student name is key, grade is value)."

Data Structures & Algorithms, Google

Recommended materials

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • Map exercises

Week 3: Unit testing

This week, we will get familiar with JUnit unit testing and write our own unit tests for existing code.

Recommended materials

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • JUnit exercises

Week 4: Inheritance and interfaces

This week, we will deepen our object-oriented programming skills by exploring inheritance and interfaces. Inheritance and interfaces are object-oriented solutions that promote code reusability and compatibility.

Recommended materials

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • Interfaces and inheritance

Week 5: Streams and lambdas

"The Stream API is probably the second most important feature added to Java SE 8, after the lambda expressions. In a nutshell, the Stream API is about providing an implementation of the well known map-filter-reduce algorithm to the JDK.

The Collections Framework is about storing and organizing your data in the memory of your JVM. You can see the Stream API as a companion framework to the Collections Framework, to process this data in a very efficient way. Indeed, you can open a stream on a collection to process the data it contains."

Processing Data in Memory Using the Stream API. https://dev.java/learn/api/streams/map-filter-reduce/

Recommended materials

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • Streams and lambdas

Week 6: JDBC & DAO

This week, we will start by learning how to establish a connection to a database from a Java program and perform basic CRUD operations (Create, Read, Update, & Delete). We will also explore the DAO (Data Access Object) design pattern, which models both database operations and the data contained in the database using Java classes.

Recommended materials

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • SQL databases (Chinook, JDBC & DAO)

Week 7: Data structures and algorithms

"A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer."

Oxford Languages

Recommended materials

"The purpose of this exercise is to explore various data structures and algorithms, especially from the perspective of their performance. We will also touch on performance testing of programs and the concept of asymptotic runtime.

The first part of the exercise focuses on the performance of Java lists. In the second part, the application to be developed will use an open dataset of names and dictionary entries to find Finnish first names that also have another meaning in the dictionary. Examples of such names include Tuuli ("wind") and Onni ("luck" or "happiness")."

Videos:

Articles:

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • Sorting and filtering

Week 8: Advanced and applied topics

At the end of the course, we will deepen and apply previous topics, exploring concepts such as concurrency and recursion.

Recommended materials

Exercises

Note

You can find the exercise descriptions in the "Exercises" tab in Moodle.

  • Commit history
  • ⭐ Bonus exercise: Generics and Sudoku

βœ… Confirming the course participation

To confirm your course participation, it is necessary to submit the firt week's exercises before the deadline. The first week's exercises will revisit topics you have learned previously. The purpose of this practice is not to stop anyone from learning or completing the course but to make sure that everyone can get started with the course without problems.

πŸ’¬ Communication channels

Course-related discussion is organized in Teams. If you are stuck with your code or you don't understand the materials or exercises, don't hesitate to ask for help. It is likely that other students have similar issues, so send your questions to the course channel for others to learn as well instead of as a private message.

πŸ“₯ Submitting exercises

The course has weekly exercises which need to be submitted before the deadline. Exercises will be submitted to GitHub. Don't hesitate to ask for help with the exercises during the lessons or in Teams from the teacher or your fellow students.

πŸ“Š Assesment

The course assesment is based on the 0 to 5 grading scale. The final grade is calculated from the exercises' average so that each week's exercises have the same weight. Grades from individual exercises aren't rounded, but the possible rounding is done only once the final grade is calculated.

This is roughly the formula for the final grade:

int numberOfWeeks = 8

double week1GitHelloWorldPoints = 1
double week1WarmingUpPoints = 4.5
// Week points are from 0 to 5
// Week 1 points calculation is a bit special, because there's two separate exercises
double week1Points = (week1GitHelloWorldPoints + week2WarmingUpPoints * 0.8)
double week2Points = 4.9
double week3Points = 4.4
double week4Points = 4.2
double week5Points = 3.5
double week6Points = 2.7
double week7Points = 5.0
double week8Points = 5.0

// The final grade is calculated as the average of the week points and rounded up 
double totalPoints = week1Points + week2Points + week3Points + week4Points // ...
double finalGrade = Math.round(totalPoints / numberOfWeeks)
System.out.println("Your final grade is: " + finalGrade);

⏱️ Workload

The course lasts 8 weeks and is worth 5 credits. This means that the official workload in hours is around 135 hours, which responds to around 17 hours a week. That being said, reserve enough time for course each week.

int durationInWeeks = 8;
int credits = 5;
int workHoursForOneCredit = 27;

int totalWorkHours = credits * workHoursForOneCredit;
System.out.println(totalWorkHours); // 135 hours

double workHoursForOneWeek = 1.0 * totalWorkHours / durationInWeeks;
System.out.println(workHoursForOneWeek); // 16.875 hours a week

πŸ” Finding information

This course material is mostly based on external online resources, such as documentation and tutorials. Each topic contains links to relevant materials but you will also need to find relevant resources yourself.

The purpose of the course exercises is not only to assess whether you have understood the material presented in the lessons or learning materials; rather, solving the exercises requires independent information gathering. Alongside working independently, we recommend asking questions and discussing topics on the course's Teams channel.

πŸ“‘ Using sources of information

Programming problems often have ready-made or partial solutions available across the Internet, from forums to tutorials. In the worst case, you might find a solution that works for your problem but don't fully understand what the code does or why it solves the issue. In professional software development, this can lead to potentially serious consequences.

Using online sources and drawing inspiration from them is allowed and encouraged, but you must not simply copy solutions; you need to understand how your code works. Additionally, especially since this is a university course, you are required to cite your sources when you borrow code, for example, from StackOverflow. An appropriate citation could be the webpage URL as a Java comment alongside the borrowed code, or another type of reference compliant with the source’s terms of use.

🧠 Prerequisites

"The course prerequisite is that you have passed the course Programming 1 (SOF005AS2AE), or can demonstrate equivalent skills and knowledge prior commencing the course. We recommend that you take the course Data Management and Databases (SOF001AS2AE) alongside the Programming 2 course if you don't already have equivalent skills in basics of databases and SQL."

Course description

If you haven't acquired solid skills from the Programming 1 course, this course will require a significant amount of work and personal effort.

About

Material for the Programming 2 course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%