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. constructors in VisualC#.NET

constructors in VisualC#.NET

Scheduled Pinned Locked Moved C#
csharphelp
16 Posts 9 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.
  • S Offline
    S Offline
    shaheen13
    wrote on last edited by
    #1

    1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

    hey

    J M P K 4 Replies Last reply
    0
    • S shaheen13

      1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

      hey

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

      shaheen13 wrote:

      Can sumone plz help me with this..its urgent....

      No, it homework. Go do it yourself!

      1 Reply Last reply
      0
      • S shaheen13

        1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

        hey

        M Offline
        M Offline
        Malcolm Smart
        wrote on last edited by
        #3

        shaheen13 wrote:

        1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

        Not sure about the rest of it, but Ctrl+S will help with step 5 and Ctrl+B should get you past step 6. Good luck with the others. Be sure to post back with the grade you get!

        Knowledge is hereditary, it will find its way up or down. Luc Pattyn
        and since what every time when i want to add button to this control one add two times posted in C# forum

        P R 2 Replies Last reply
        0
        • S shaheen13

          1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

          hey

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

          shaheen13 wrote:

          Can sumone plz help me with this..its urgent....

          Sure. When you come round to my house and paint the kitchen for me - oh, and weed the garden. Then I'll code it up for you.

          Deja View - the feeling that you've seen this post before.

          My blog | My articles

          N R 2 Replies Last reply
          0
          • M Malcolm Smart

            shaheen13 wrote:

            1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

            Not sure about the rest of it, but Ctrl+S will help with step 5 and Ctrl+B should get you past step 6. Good luck with the others. Be sure to post back with the grade you get!

            Knowledge is hereditary, it will find its way up or down. Luc Pattyn
            and since what every time when i want to add button to this control one add two times posted in C# forum

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

            Malcolm Smart wrote:

            1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent.... Not sure about the rest of it, but Ctrl+S will help with step 5 and Ctrl+B should get you past step 6. Good luck with the others. Be sure to post back with the grade you get!

            Good advice. Of course, I'm disturbed at how poor the requirements are for this. For instance, a constructor calling either a poorly named method, or a really dodgy implementation. I'm sorry, but this whole mess would need to be redesigned and the tutor will be awarded an F for this very poor design.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            C 1 Reply Last reply
            0
            • P Pete OHanlon

              Malcolm Smart wrote:

              1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent.... Not sure about the rest of it, but Ctrl+S will help with step 5 and Ctrl+B should get you past step 6. Good luck with the others. Be sure to post back with the grade you get!

              Good advice. Of course, I'm disturbed at how poor the requirements are for this. For instance, a constructor calling either a poorly named method, or a really dodgy implementation. I'm sorry, but this whole mess would need to be redesigned and the tutor will be awarded an F for this very poor design.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              C Offline
              C Offline
              carbon_golem
              wrote on last edited by
              #6

              Agreed. Poorly designed assignment, starting bad habits early.

              "Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand

              1 Reply Last reply
              0
              • P Pete OHanlon

                shaheen13 wrote:

                Can sumone plz help me with this..its urgent....

                Sure. When you come round to my house and paint the kitchen for me - oh, and weed the garden. Then I'll code it up for you.

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                N Offline
                N Offline
                nelo_
                wrote on last edited by
                #7

                I see where you're coming from Pete but I think you're being a bit harsh... :-D Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!? :-\

                P C S 3 Replies Last reply
                0
                • N nelo_

                  I see where you're coming from Pete but I think you're being a bit harsh... :-D Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!? :-\

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

                  nelo_ wrote:

                  I see where you're coming from Pete but I think you're being a bit harsh... Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!?

                  You're right. It's far too harsh for me to expect somebody to actually be able to do something for themself. Obviously, my plumber just asks for somebody else to come and fit the bath for me, and he in turn asks somebody else - I suspect that there's only one plumber doing everybody's work for them. This explains why nothing ever gets done - that poor sod's far too busy.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  M 1 Reply Last reply
                  0
                  • N nelo_

                    I see where you're coming from Pete but I think you're being a bit harsh... :-D Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!? :-\

                    C Offline
                    C Offline
                    carbon_golem
                    wrote on last edited by
                    #9

                    Well, the poster's profile claims that Job Title is Engineer. :wtf: I'm glad we're working on ice cream and not skyscrapers. If that's the claim, then maybe some harshness is in order. If he/she needs homework help at the last minute "plz urgent", google can give results in under a second. Problem better phrased as "I'm having trouble understanding try/catch and making custom exceptions. Does anyone have a simplified explanation, my text is convoluted and the examples I've found on the net are not making much sense to me." Posted with the utmost respect for Mr. nelo_.

                    "Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand

                    1 Reply Last reply
                    0
                    • M Malcolm Smart

                      shaheen13 wrote:

                      1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

                      Not sure about the rest of it, but Ctrl+S will help with step 5 and Ctrl+B should get you past step 6. Good luck with the others. Be sure to post back with the grade you get!

                      Knowledge is hereditary, it will find its way up or down. Luc Pattyn
                      and since what every time when i want to add button to this control one add two times posted in C# forum

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #10

                      Malcolm Smart wrote:

                      and since what every time when i want to add button to this control one add two times

                      :laugh: Can you give me an original link to that gem?

                      Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                      1 Reply Last reply
                      0
                      • P Pete OHanlon

                        nelo_ wrote:

                        I see where you're coming from Pete but I think you're being a bit harsh... Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!?

                        You're right. It's far too harsh for me to expect somebody to actually be able to do something for themself. Obviously, my plumber just asks for somebody else to come and fit the bath for me, and he in turn asks somebody else - I suspect that there's only one plumber doing everybody's work for them. This explains why nothing ever gets done - that poor sod's far too busy.

                        Deja View - the feeling that you've seen this post before.

                        My blog | My articles

                        M Offline
                        M Offline
                        Malcolm Smart
                        wrote on last edited by
                        #11

                        Pete O'Hanlon wrote:

                        I suspect that there's only one plumber

                        And he is actually the original poster, trying to cross train to be a developer!! I'm sorely tempted to take you up on your painting / weeding offer though Pete, I'm so far behind with this project it's untrue. I'm packing the kids and wife off you with paint brushes and spades in hand.

                        Knowledge is hereditary, it will find its way up or down. Luc Pattyn
                        and since what every time when i want to add button to this control one add two times posted in C# forum

                        P 1 Reply Last reply
                        0
                        • P Pete OHanlon

                          shaheen13 wrote:

                          Can sumone plz help me with this..its urgent....

                          Sure. When you come round to my house and paint the kitchen for me - oh, and weed the garden. Then I'll code it up for you.

                          Deja View - the feeling that you've seen this post before.

                          My blog | My articles

                          R Offline
                          R Offline
                          Rajesh R Subramanian
                          wrote on last edited by
                          #12

                          :laugh: Don't be too flippant, Pete. It's an urgent query, if you haven't noticed it yet. :|

                          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                          P 1 Reply Last reply
                          0
                          • M Malcolm Smart

                            Pete O'Hanlon wrote:

                            I suspect that there's only one plumber

                            And he is actually the original poster, trying to cross train to be a developer!! I'm sorely tempted to take you up on your painting / weeding offer though Pete, I'm so far behind with this project it's untrue. I'm packing the kids and wife off you with paint brushes and spades in hand.

                            Knowledge is hereditary, it will find its way up or down. Luc Pattyn
                            and since what every time when i want to add button to this control one add two times posted in C# forum

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

                            Malcolm Smart wrote:

                            I'm sorely tempted to take you up on your painting / weeding offer though Pete, I'm so far behind with this project it's untrue. I'm packing the kids and wife off you with paint brushes and spades in hand.

                            Cool. When will I expect them? Have you posted them first or second class?

                            Deja View - the feeling that you've seen this post before.

                            My blog | My articles

                            1 Reply Last reply
                            0
                            • S shaheen13

                              1.Create an IceCreamConeException class whose constructor receives a string that consists of an ice cream flavor and number of scoops. 2. Create an IceCreamCone class with two fields: • IceCreamFlavor • Scoops 3. The IceCreamCone constructor calls two data-entry methods: • GetFlavor(), which throws an IceCreamConeException if the flavor isn’t one of the following: vanilla, chocolate, strawberry, peach, or banana. • GetScoops(), which throws an IceCreamConeException when the scoop quantity exceeds 3. 4. Create a program that establishes several IceCreamCone objects and handles any throw IceCreamConeExceptions. 5. Save your program. 6. Now “build” your program Can sumone plz help me with this..its urgent....

                              hey

                              K Offline
                              K Offline
                              Kevin McFarlane
                              wrote on last edited by
                              #14

                              How do I get other people to do my homework problem for me?[^]

                              Kevin

                              1 Reply Last reply
                              0
                              • R Rajesh R Subramanian

                                :laugh: Don't be too flippant, Pete. It's an urgent query, if you haven't noticed it yet. :|

                                Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

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

                                Rajesh R Subramanian wrote:

                                It's an urgent query, if you haven't noticed it yet

                                And I urgently mocked it. There was no delay, no flim flam. The mockery was instant.

                                Deja View - the feeling that you've seen this post before.

                                My blog | My articles

                                1 Reply Last reply
                                0
                                • N nelo_

                                  I see where you're coming from Pete but I think you're being a bit harsh... :-D Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!? :-\

                                  S Offline
                                  S Offline
                                  Scott Dorman
                                  wrote on last edited by
                                  #16

                                  nelo_ wrote:

                                  I see where you're coming from Pete but I think you're being a bit harsh... Gone are the days when students would be in class, make some notes, read the handouts, read the recommended text books, look at API documentation, or even ask the tutor. Where would we all be without google and code project hey!?

                                  I don't think Pete's being too harsh at all. You're right, "gone are the days when students would..." and that's the problem. The problem isn't resources like Google and CP. The problem is that students expect instant answers and other people to do their homework because they can't be bothered to learn the material and the professors (and/or tutors) are more than happy to teach to this increasingly downward trend.

                                  Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


                                  [Forum Guidelines] [Articles] [Blog]

                                  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