Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Phonebook Application | Dictionaries and Key-Value Collections
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Lists & Collections

bookChallenge: Phonebook Application

Opgave

Swipe to start coding

Create a simple phonebook application using a dictionary to manage contacts. Implement three functions: one to add contacts, one to search for a contact by name, and one to delete a contact by name.

  • Add a contact by setting the provided name as the key and the number as the value in the dictionary.
  • Search for a contact by name and return the associated number if found, or the string "Contact not found" if the name does not exist in the dictionary.
  • Delete a contact by name and return true if the contact was deleted, or false if the name was not found in the dictionary.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 3
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Phonebook Application

Stryg for at vise menuen

Opgave

Swipe to start coding

Create a simple phonebook application using a dictionary to manage contacts. Implement three functions: one to add contacts, one to search for a contact by name, and one to delete a contact by name.

  • Add a contact by setting the provided name as the key and the number as the value in the dictionary.
  • Search for a contact by name and return the associated number if found, or the string "Contact not found" if the name does not exist in the dictionary.
  • Delete a contact by name and return true if the contact was deleted, or false if the name was not found in the dictionary.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 3
single

single

some-alt