Java homework part 5.

kuppi

Been a while since my last post. Some of my homework has been really simple so I didn't find them post worthy but the previous week we dove into exceptions and maps/hashmaps.

I found exception handling to be extremely interesting and probably really valuable information when it comes to my future with coding. the program I will be going through below is the the last exercise of 4 utilizing both hashmaps and exception handling.

Print a console square in C#

SharpestC

So I also started a C# (C sharp) course. The first task utilized the stuff I'd learned on my C - course

The first task was to print a simple square with nothing in the middle using C#.

This ended up being quite fun and I was able to implement stuff I'd learned previously! The print happened with a simple 2 x for-loop with i controlling the height of the square and j controlling the width. The output of the code was

Python homework part.3

Pythonlogo

Soooo... I sort of got lost in doing the exercises and completed 15 exercises since the last one. I think I'll just post the more demanding ones so there will be between one to two examples of what I did per subject. I'll include some screenshots again on how the programs functioned. I've only got two subjects left after these ones. I hope I can manage to complete them today. First up is sub-functions.

Java homework part 4.

Java

Won't be splitting these into two parts. I'll just write some shorter descriptions on what each program does. This week the first five exercises are about arrays and the next five are about methods. Had no difficulty doing the first five I found arrays quite simple. I ended up struggling with the method exercises. I was stuck on the second to last one for a while and had to ask a friend for some help. The solution ended up being really simple. I'll go in to more detail before the exercise.

Python homework part.2

Pythonlogo

 

This time we only had four exercises dealing with the reading, writing in, overwriting and searching documents with python.

I managed to complete all of these quite quickly and only found a challenge in the exercise 3/4 which you can see below. I'll ad some screenshots to these too from here on.

1/4

Read a document called faktat.txt and print what it said.

faktatpy

Java homework part 3.

Java

The second part of previous homework will be here. This portion of the 10 assignments given was mostly about handling "String" variables with Java. I found the first few exercises to be simple and then the last two to be a bit difficult. I managed to get them correct though I still think that my code could have been a bit more "efficient" on some of the exercises.

Previous part of the same set of homework.

Java homework part 2.

Java

 

 

Our homework is starting to get a bit trickier when it comes to the java course. I did enjoy the exercises though.

I'll separate our 10 homework assignments in to 2 posts of 5 exercises just for the sake of clarity and post length. I felt my last Java related post was a bit long. This first post will be 5 exercises in "while" and "for" statements. I'll again include some short descriptions on what each individual program does. I'll also start including some screenshots where I can from here on.

Python3 programming part 1

Pythonlogo

 

I enrolled in a python3 beginner course and will also be posting some work I've done for the course. I'll skip some of the more basic stuff. Some things written here like certain bits of console output will be in Finnish again due to some course requirements. The VIOPE system that we submit our code in to expects everything to be word for word the same as has been put in it.

Hello World in Python3

 

print("Hei Maailma!")

Java Homework part 1

Java

 

These posts will be a little simpler I'll just post short descriptions on what what was supposed to be done and the source code for my solutions below. Certain things in my solutions will be in Finnish due to course requirements.

Our first homework assignment was 10 little tasks to complete with Java. I used the required Eclipse Oxygen editor with Java Development kit version 1.8 to write these.

Basic Stuff

1/10

Create a calculator that calculates the amount of "daily fine" based on user income