Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. activity-selection algorithm in c#

activity-selection algorithm in c#

Scheduled Pinned Locked Moved C#
csharpalgorithms
11 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M mazizi0

    hi dears... i want the activity-selection algorithm in c#. thanks for u...

    P Offline
    P Offline
    Pete OHanlon
    wrote on last edited by
    #2

    There are many ways to select an activity. If you have a problem with some code you have written, feel free to post a question on it. Good luck.

    I was brought up to respect my elders. I don't respect many people nowadays.
    CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

    M 1 Reply Last reply
    0
    • M mazizi0

      hi dears... i want the activity-selection algorithm in c#. thanks for u...

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #3

      I'm assuming you're talking about this[^]. Start there and write your own code. It's what you're going to school for or getting paid to write isn't it?? Either way, we're not writing your code for you.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        I'm assuming you're talking about this[^]. Start there and write your own code. It's what you're going to school for or getting paid to write isn't it?? Either way, we're not writing your code for you.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        M Offline
        M Offline
        mazizi0
        wrote on last edited by
        #4

        sorry, my meaning was activity-selection algorithm that is greedy algorithm in C#. i have a project for university, i thanks so much if u help me. best regards...

        D 1 Reply Last reply
        0
        • P Pete OHanlon

          There are many ways to select an activity. If you have a problem with some code you have written, feel free to post a question on it. Good luck.

          I was brought up to respect my elders. I don't respect many people nowadays.
          CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

          M Offline
          M Offline
          mazizi0
          wrote on last edited by
          #5

          sorry, my meaning was activity-selection algorithm that is greedy algorithm in C#. i have a project for university, i thanks so much if u help me.
          best regards...

          P 1 Reply Last reply
          0
          • M mazizi0

            sorry, my meaning was activity-selection algorithm that is greedy algorithm in C#. i have a project for university, i thanks so much if u help me.
            best regards...

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #6

            So you're trying to get me to pass your course. If you can't solve this, how do you expect to do this as a career?

            I was brought up to respect my elders. I don't respect many people nowadays.
            CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

            1 Reply Last reply
            0
            • M mazizi0

              hi dears... i want the activity-selection algorithm in c#. thanks for u...

              R Offline
              R Offline
              riced
              wrote on last edited by
              #7

              Here's an activity selection algorithmm coded in C# - probably not what you want. :) But you have not explained what you want.

                static void Main(string\[\] args)
                {
                   Random rndGen = new Random();
                   var activities = new List() { "bake bread", "mow lawn", "read book", "sleep", "don batman costume", "sneeze",
                                  "have a beer", "code furiously", "make excuse for late assignment", "plead for help"};
              
                   for (int i = 0; i < 3; i++)
                   {
                      int act = rndGen.Next(activities.Count);
                      Console.WriteLine((i+1).ToString() + ". " + activities\[act\]);
                   }
                   Console.ReadLine();
                }
              

              Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

              P 1 Reply Last reply
              0
              • M mazizi0

                sorry, my meaning was activity-selection algorithm that is greedy algorithm in C#. i have a project for university, i thanks so much if u help me. best regards...

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #8

                The whole point behind you getting these assignments is for YOU to demonstrate that you can applied what you've learned. It's NOT for us to do the work for you.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                1 Reply Last reply
                0
                • R riced

                  Here's an activity selection algorithmm coded in C# - probably not what you want. :) But you have not explained what you want.

                    static void Main(string\[\] args)
                    {
                       Random rndGen = new Random();
                       var activities = new List() { "bake bread", "mow lawn", "read book", "sleep", "don batman costume", "sneeze",
                                      "have a beer", "code furiously", "make excuse for late assignment", "plead for help"};
                  
                       for (int i = 0; i < 3; i++)
                       {
                          int act = rndGen.Next(activities.Count);
                          Console.WriteLine((i+1).ToString() + ". " + activities\[act\]);
                       }
                       Console.ReadLine();
                    }
                  

                  Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #9

                  I think maybe a command line parser is in order.

                  1 Reply Last reply
                  0
                  • M mazizi0

                    hi dears... i want the activity-selection algorithm in c#. thanks for u...

                    J Offline
                    J Offline
                    J4amieC
                    wrote on last edited by
                    #10

                    mazizi0 wrote:

                    hi dears...

                    Hello luvver

                    mazizi0 wrote:

                    i want the activity-selection algorithm in c#.

                    Oooh, ooh I know this game. I want a Porsche.

                    mazizi0 wrote:

                    thanks for u...

                    No no. Thanks for YOU!

                    1 Reply Last reply
                    0
                    • M mazizi0

                      hi dears... i want the activity-selection algorithm in c#. thanks for u...

                      P Offline
                      P Offline
                      pt1401
                      wrote on last edited by
                      #11

                      So what are you going to do when (if) you pass your course & get a job? Ask your fellow employees to do your work for you, then take the credit for it? How long do you think you'd last in that job? Man up - put a bit of effort in and do it yourself or you're on a slippery slope to nowhere career-wise.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups