Code Monkey home page Code Monkey logo

launch_museo's Introduction

Museo

Setup

  • Fork this Repository
  • Clone YOUR fork
  • Complete the activity below
  • Commit and push your solution to your fork

Iteration 1

Create a Photograph and an Artist class that respond to the following interaction pattern.

For AgeAtDeath(), assume an artist was born and died on the same day.

var photoAttributes = new Dictionary<string, string>
{
    { "id", "1" },
    { "name", "Rue Mouffetard, Paris (Boy with Bottles)" },
    { "artistId", "4" },
    { "year", "1954" }
};

var photo = new Photograph(photoAttributes);

Console.WriteLine(photo.Id);
// Output => "1"

Console.WriteLine(photo.Name);
// Output => "Rue Mouffetard, Paris (Boy with Bottles)"

Console.WriteLine(photo.ArtistId);
// Output => "4"

Console.WriteLine(photo.Year);
// Output => "1954"

var artistAttributes = new Dictionary<string, string> 
{
    { "id", "2" },
    { "name",  "Ansel Adams" },
    { "born", "1902" },
    { "died", "1984" },
    { "country", "United States" }

};

var artist = new Artist(artistAttributes);

Console.WriteLine(artist.Id);
// Output => "2"

Console.WriteLine(artist.Name);
// Output => "Ansel Adams"

Console.WriteLine(artist.BirthYear);
// Output => "1902"

Console.WriteLine(artist.DeathYear);
// Output => "1984"

Console.WriteLine(artist.Country);
// Output => "United States"

Console.WriteLine(artist.AgeAtDeat());
// Output => 82

Iteration 2

Create a

var curator = new Curator();

foreach (Photograph photo in curator.Photographs)
{
    Console.WriteLine(photo.Name);
}
// Output =>

foreach (Artist artist in curator.Artists)
{
    Console.WriteLine(artist.Name);
}
// Output =>

var photo1 = new Photograph(new Dictionary<string, string>
{
    { "id", "1" },
    { "name", "Rue Mouffetard, Paris (Boy with Bottles)" },
    { "artistId", "4" },
    { "year", "1954" }
});

var photo2 = new Photograph(new Dictionary<string, string>
{
    { "id", "2" },
    { "name", "Moonrise, Hernandez" },
    { "artistId", "2" },
    { "year", "1941" }
});

var artist1 = new Artist(new Dictionary<string, string>
{
    { "id", "1" },
    { "name",  "Henri Cartier-Bresson" },
    { "born", "1908" },
    { "died", "2004" },
    { "country", "France" }

});

var artist2 = new Artist(new Dictionary<string, string>
{
    { "id", "2" },
    { "name",  "Ansel Adams" },
    { "born", "1902" },
    { "died", "1984" },
    { "country", "United States" }

});

curator.AddPhotograph(photo1);
curator.AddPhotograph(photo2);
curator.AddArtist(artist1);
curator.AddArtist(artist2);

foreach (var photo in curator.Photographs)
{
    Console.WriteLine(photo.Name);
}
// Output => "Rue Mouffetard, Paris (Boy with Bottles)
//            Moonrise, Hernandez"

foreach (var artist in curator.Artists)
{
    Console.WriteLine(artist.Name);
}
// Output => "Henri Cartier-Bresson
//            Ansel Adams"

Artist foundArtist = curator.FindArtistById("1");

Console.WriteLine(foundArtist.Name);
// Output => "Henri Cartier-Bresson"

Iteration 3

Update your Curator class so that is supports the following functionality:

  • A Curator can return a dictionary of all artists and their photographs.
  • A Curator can return a list of names of artists who have more than one photograph
  • A Curator can return a list of photographs that were taken by a photographer from a given country.

launch_museo's People

Contributors

memcmahon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.