"Jag litar på att du redan har lärt dig om Set och Map. Här är några uppgifter som hjälper dig att förstärka din nya kunskap."
2
Uppgift
Java Syntax, nivå, lektion
20 words that start with the letter "L"
Do you have a favorite letter? Well, your preferences play no role in this task. Your teacher (the one who came up with this task) favors the letter "L", so you'll have to work with it, whether you like it or not. You need to create a Set and add 20 words that start with the letter "L". And, well, that's it.
10
Uppgift
Java Syntax, nivå, lektion
Greater than 10? You're not a good fit for us
The Oddiozo transshipment center is looking for employees. The only requirement is this: employees must not have more than ten limbs (we don't know where this form of discrimination came from). We'll help them with a program that will create a set of numbers (Set ), add 20 different numbers, and then remove from the set all the numbers greater than 10.
10
Uppgift
Java Syntax, nivå, lektion
Census
People and other citizens of the universe quite often try to find their relatives. Let's take a step towards a program that can search for people. In this task, we need to create a dictionary (Map), add ten (last name, first name) entries, and then check how many people have the same first name or last name.
10
Uppgift
Java Syntax, nivå, lektion
Kind Emma and the summer holidays
Emma Richards is the supervising teacher of grade 7B at some Terran school. The details aren't important. What is important is that she gives gifts to the students on their birthdays. But not everyone is lucky: Summer birthdays are skipped due to the summer break. Let's write a program for Emma: create a dictionary with names and birth dates, and then remove anybody born in the summer.
10
Uppgift
Java Syntax, nivå, lektion
We don't need repeats
It's difficult to imagine a situation where you might need the program we're going to ask you to write. However, small modifications can make it practical. You can also imagine it as part of something larger, such as a search engine. Let's create a dictionary, fill it with (last name, first name) entries, and then remove people with the same first name.
5
Uppgift
Java Syntax, nivå, lektion
Only for the rich
Our customer is the Monte Vegas Casino on Planet Diabloblo. Extremely arrogant guys, but they pay well. They've asked us to make an automatic mailing list for potential customers. Don't worry. The junior programmer (you) has been assigned a simple task: create a (last name, salary) dictionary and remove any entries for people whose salary is less than 500 credits.