Collection of programming selection tasks to make and remember (Java basics)

For those who have learned the grammar to some extent and want to make something, I have collected and organized some affordable tasks. All are independent so you can work from anywhere. Maybe it can be used other than Java? Please use it for new employee education and killing time.

table of contents

Level 1 FizzBuzz * Time guide 1 hour Warming up

[Level 2 Multiplication Table](http://qiita.com/s_hino/items/85ce20cb675484d300f0#%E3%83%AC%E3%83%99%E3%83%AB2-%E6%8E%9B%E3% 81% 91% E7% AE% 97% E4% B9% 9D% E4% B9% 9D) * Time guide 2 hours How to use loops, function

[Calculation of Level 3 Zodiac](http://qiita.com/s_hino/items/85ce20cb675484d300f0#%E3%83%AC%E3%83%99%E3%83%AB3-%E5%B9%B2%E6% 94% AF% E3% 81% AE% E8% A8% 88% E7% AE% 97) * Time guide 4 hours A little complicated logic (argument, 2D array)

[Level 4 membership registration function](http://qiita.com/s_hino/items/85ce20cb675484d300f0#%E3%83%AC%E3%83%99%E3%83%AB4-%E4%BC%9A%E5% 93% A1% E7% 99% BB% E9% 8C% B2% E6% A9% 9F% E8% 83% BD) * Time guide 6 hours Classes and instances, JavaBeans

[Level 5 Music Player](http://qiita.com/s_hino/items/85ce20cb675484d300f0#%E3%83%AC%E3%83%99%E3%83%AB5-%E3%83%9F%E3%83 % A5% E3% 83% BC% E3% 82% B8% E3% 83% 83% E3% 82% AF% E3% 83% 97% E3% 83% AC% E3% 82% A4% E3% 83% A4 % E3% 83% BC) * Estimated time 8 hours Inheritance and interface

Level 1 FizzBuzz

First of all, warm up with this. Estimated travel time: 1 hour

specification

Outputs "Fizz" when it is a multiple of 3, "Buzz" when it is a multiple of 5, and "FizzBuzz" when it is divisible by both 3 and 5.

Program list

Level 2 multiplication table

The goal is to get used to using loops. Estimated travel time: 3 hours

specification

Output to the console like this

1 2 3 4 5 6 7 8 9 2 4 6 8 10 12 14 16 18 3 6 9 12 15 18 21 24 27 4 8 12 16 20 24 28 32 36 5 10 15 20 25 30 35 40 45 6 12 18 24 30 36 42 48 54 7 14 21 28 35 42 49 56 63 8 16 24 32 40 48 56 64 72 9 18 27 36 45 54 63 72 81

Insert a tab character between characters

Program list

Tips

--Multiplication uses a double loop --Use escape sequences for character spacing and line breaks

Level 3 Zodiac Calculation

It is a program that calculates the zodiac from 4 digits in the Christian era. The goal is to get used to a little complicated logic.

■ Message example The 2017 zodiac sign is the year of the fire rooster.

Estimated travel time: 6 hours

specification

See below http://hishoshou.blog108.fc2.com/blog-entry-6.html

Program list

Tips

Heavenly Stems and Heavenly Stems are calculated based on the remainder of dividing year by a specific number. Heavenly Stems and Zodiac are defined by enum, and the one calculated above is returned. For example, if the result calculated from year is 0, the result will be "Geng". It is supposed to be implemented using an enum, but if you get stuck without knowing it, you can implement it using a conditional branch in an if statement or a switch statement.

Level 4 membership registration function

The goal is to get used to using classes, instances, and JavaBeans. Estimated travel time: 6 hours

specification

Please register the member information for 3 people and output the following words on the console. Taro Yamada's member ID is 0001. Registration: April 1, 2017

Registered member

① ID: 0001 Name: Taro Yamada Registration date and time: Current date and time (yyyy / mm / dd) ② ID: 0002 Name: Hanako Suzuki Registration date and time: Current date and time (yyyy / mm / dd) ③ ID: 0003 Name: Takuma Sato Registration date and time: Current date and time (yyyy / mm / dd)

Output all at the end of the program.

Program list

All java files should be created in the jp.co.kenshu package

int type "id" String type "name" Date type "addDate"

Tips

The point is to create a Kaiin type dynamic array. Please try to create it while keeping track of where the created data is.

Level 5 music player

The goal is to get used to inheritance and how to use the interface. Estimated travel time: 8 hours

specification

Create two types of music players, the Walkman and the iPod. Both have play / pause / stop functions. Please be able to enter any song name and artist name. Use the main method for the operation.

■ Example of start-of-use message Start using your iPod.

■ Example of song title / artist message Play Ikimonogakari Blue Bird.

In addition, the functional features of the Walkman and iPod are as follows, so please implement them using individual methods.

■ Walkman Play: "Play with explosive sound" Pause: "Wait for 3 minutes" Stop: "Stopped"

■iPod Play: "Play back" Pause: "I'm clever, I'll pause" Stop: "Playback has stopped"

Program list

All java files should be created in the jp.co.kenshu package

Tips

There are many programs, but I think it's a good idea to understand each role and proceed.

Player.java Interface that defines only common behavior Title.java Superclass that extracts the process of displaying song titles and artists Walkman.java Class that describes the behavior of the Walkman Ipod.java A class that describes the behavior of the iPod Class that calls MusicPlayAction.java process (Main method)

Afterword

What did you think. I think it will be a good training. Please let me know if there is a shortage or it does not work. We are planning the next web application edition.

Recommended Posts

Collection of programming selection tasks to make and remember (Java basics)
Basics of Java development ~ How to write programs (variables and types) ~
[Java] Contents of Collection interface and List interface
Basics of java basics ② ~ if statement and switch statement ~
java programming basics
Basics of threads and Callable in Java [Beginner]
[Introduction to Java] Basics of java arithmetic (for beginners)
Expired collection of java
[Java] Types of comments and how to write them
Initialization of for Try to make Java problem TypeScript 5-4
Java programming basics practice-array
I summarized the types and basics of Java exceptions
Java: Use Stream to sort the contents of the collection
Setting method to link Java of Eclipse and Github / September 2017
Generate and execute Jar file of Java file belonging to package
[Java] Set structure of collection class (about HashSet and TreeSet)
Command to check the number and status of Java threads
I tried to make Java Optional and guard clause coexist
I tried to make a client of RESAS-API in Java
Reintroduction to Java for Humanities 0: Understanding the Act of Programming
Java --How to make JTable
Basics of character operation (java)
Gradle to touch and remember
Java programming (variables and data)
[Java] Comparator of Collection class
Java programming basics practice-for statement
Summary of Java language basics
Java programming basics practice-switch statement
Advantages and disadvantages of Java
Mechanism and characteristics of Collection implementation class often used in Java
From fledgling Java (3 years) to Node.js (4 years). And the impression of returning to Java
I tried to summarize the methods of Java String and StringBuilder
Basics of conditional branching and return
How to make a Java container
Introduction to Functional Programming (Java, Javascript)
[Java] Input to stdin of Process
[Java] Judgment of identity and equivalence
Summary of object-oriented programming using Java
Java Performance Chapter 5 Garbage Collection Basics
How to make a Java array
A collection of phrases that impresses the "different feeling" of Java and JavaScript
The story of forgetting to close a file in Java and failing
I want to display images with REST Controller of Java and Spring!
Practice of Java programming basics-I want to display triangles with for statements ①
[Useful to remember !!!] Easy creation of constructor and getter / setter in Eclipse
[Java] Note how to use RecyclerView and implementation of animated swipe processing.
[Java improvement case] How to reach the limit of self-study and beyond
Practice of Java programming basics-I want to display triangles with for statements ②
I translated the grammar of R and Java [Updated from time to time]
How to make an app with a plugin mechanism [C # and Java]