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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ Problem Need Help Part 2

C++ Problem Need Help Part 2

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++data-structuresoop
10 Posts 8 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.
  • A Offline
    A Offline
    alishaklas
    wrote on last edited by
    #1
    1. Write a C++ program which reads the names and ages of 10 people, and store these data in structures that are elements of an array. Print the average age of these people. Also, print a table of 10 lines, with on each line the given data of a person, along with the (positive or negative) deviation of his or her age from the average age. store only the first 30 characters (followed by the null character) of names that are longer than 30 characters. Be sure to incorporate into your program the use of classes, private data, public function process data, constructors and destructors where appropriate. Notes: must use object oriented Notes: have choice * ask how many people would you like to enter data for. Thanks, Alisha
    C M 2 Replies Last reply
    0
    • A alishaklas
      1. Write a C++ program which reads the names and ages of 10 people, and store these data in structures that are elements of an array. Print the average age of these people. Also, print a table of 10 lines, with on each line the given data of a person, along with the (positive or negative) deviation of his or her age from the average age. store only the first 30 characters (followed by the null character) of names that are longer than 30 characters. Be sure to incorporate into your program the use of classes, private data, public function process data, constructors and destructors where appropriate. Notes: must use object oriented Notes: have choice * ask how many people would you like to enter data for. Thanks, Alisha
      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Hi Alisha. Welcome to CP. This is a community of developers who love to help each other. Sadly, it appears we cannot help you. I could write this inside of 15 minutes, but if I did, how would it help you ? Your teachers assume they have given you enough information to do this problem, and certainly enough exists on the web and in books as well. In fact, I can think of a number of CP articles which between them would tell you all you need to know. If I did this problem, then you would have no idea how to do your next assignment, which would build on the skills you were supposed to build in writing this one. At what point do you propose to learn for yourself ? Both myself and the rest of this online community will fall over themselves to offer advice if in trying to write this assignment you get stuck somewhere, but no-one is going to do your homework for you. One day, you may live to thank us. The alternative is that you'll be cleaning the swimming pool of someone who did their own homework. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      R R 2 Replies Last reply
      0
      • C Christian Graus

        Hi Alisha. Welcome to CP. This is a community of developers who love to help each other. Sadly, it appears we cannot help you. I could write this inside of 15 minutes, but if I did, how would it help you ? Your teachers assume they have given you enough information to do this problem, and certainly enough exists on the web and in books as well. In fact, I can think of a number of CP articles which between them would tell you all you need to know. If I did this problem, then you would have no idea how to do your next assignment, which would build on the skills you were supposed to build in writing this one. At what point do you propose to learn for yourself ? Both myself and the rest of this online community will fall over themselves to offer advice if in trying to write this assignment you get stuck somewhere, but no-one is going to do your homework for you. One day, you may live to thank us. The alternative is that you'll be cleaning the swimming pool of someone who did their own homework. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

        R Offline
        R Offline
        Roger Wright
        wrote on last edited by
        #3

        That is one of the most comprehensive and gentle responses I have ever seen on this site to a "please do my homework for me" question. Thank you for setting a high standard for the rest of us to follow. I intend to emulate, to the best of my ability, the model behavior you have established, and I encourage the rest of our members to take notes, and refer to them often. "My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ

        C R K 3 Replies Last reply
        0
        • R Roger Wright

          That is one of the most comprehensive and gentle responses I have ever seen on this site to a "please do my homework for me" question. Thank you for setting a high standard for the rest of us to follow. I intend to emulate, to the best of my ability, the model behavior you have established, and I encourage the rest of our members to take notes, and refer to them often. "My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          *blush* Thanks for noticing. I am working very hard to put down my sarcastic side and to make sure that the way I talk to new members in particular is reflective of what a great place this is. I've talked a lot about the danger we have of becoming insular, and I'm trying to act in accordance with what I have said. It's worried me a lot lately that particularly newbies posting questions in the lounge seem to get tarred, feathered and run out of town. And of course homework questions are our second pet hate. But who hasn't posted something inappropriate somewhere as a newbie ? I'd rather get the chance to help this person and see them become a CPian than to feel smug that I showed them who is boss. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

          M R 2 Replies Last reply
          0
          • C Christian Graus

            *blush* Thanks for noticing. I am working very hard to put down my sarcastic side and to make sure that the way I talk to new members in particular is reflective of what a great place this is. I've talked a lot about the danger we have of becoming insular, and I'm trying to act in accordance with what I have said. It's worried me a lot lately that particularly newbies posting questions in the lounge seem to get tarred, feathered and run out of town. And of course homework questions are our second pet hate. But who hasn't posted something inappropriate somewhere as a newbie ? I'd rather get the chance to help this person and see them become a CPian than to feel smug that I showed them who is boss. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #5

            While you're in such a good mood, you should gently help out "jirigala" (user #98406) who posted the same question in all these articles here here here here here here Probably more too, but the web service only shows 10 threads. ;) --Mike-- "Adventure. Excitement. A Jedi craves not these things."   -- Silent Bob 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

            1 Reply Last reply
            0
            • C Christian Graus

              *blush* Thanks for noticing. I am working very hard to put down my sarcastic side and to make sure that the way I talk to new members in particular is reflective of what a great place this is. I've talked a lot about the danger we have of becoming insular, and I'm trying to act in accordance with what I have said. It's worried me a lot lately that particularly newbies posting questions in the lounge seem to get tarred, feathered and run out of town. And of course homework questions are our second pet hate. But who hasn't posted something inappropriate somewhere as a newbie ? I'd rather get the chance to help this person and see them become a CPian than to feel smug that I showed them who is boss. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

              R Offline
              R Offline
              Roger Wright
              wrote on last edited by
              #6

              Christian Graus wrote: I am working very hard to put down my sarcastic side and to make sure that the way I talk to new members in particular is reflective of what a great place this is. You're doing a great job of it, and (I hope) setting a good example for the rest of us. Christian Graus wrote: I've talked a lot about the danger we have of becoming insular, and I'm trying to act in accordance with what I have said That's a great danger to a site that is growing at the pace CP is experiencing, and a pitfall that we need to avoid. Those of us who have been around since the beginning are bound to feel threatened by the changes, but we need to grow with them, not oppose them. It's not the same elite club it used to be, and we need to adapt accordingly. Christian Graus wrote: But who hasn't posted something inappropriate somewhere as a newbie ? We all have, I think. My one and only article, so far, was posted only out of a feeling of obligation to contribute something to the site that has given me so much. It's relatively worthless, but it solved a problem my employer needed solved, and it was all I had on tap to offer at the time. I hope that someone else has found it useful, but I strongly doubt it. If my submittal had been met with ridicule and abuse, however, I would have never visited again. We need to keep that in mind when we find a newbie in our midst - we don't want to run off any gems in the rough, and the trend lately has been rather hostile. Christian Graus wrote: to feel smug that I showed them who is boss. Yeah, I know the feeling... It's fun, but transitory. Better, much I think, to suffer in silence a few youthful indiscretions, than to lose a potentially valuable member of our community. Thanks, again, for setting a standard I'd like to emulate... "My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ

              1 Reply Last reply
              0
              • R Roger Wright

                That is one of the most comprehensive and gentle responses I have ever seen on this site to a "please do my homework for me" question. Thank you for setting a high standard for the rest of us to follow. I intend to emulate, to the best of my ability, the model behavior you have established, and I encourage the rest of our members to take notes, and refer to them often. "My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ

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

                Roger Wright wrote: That is one of the most comprehensive and gentle responses I have ever seen on this site to a "please do my homework for me" question Maybe Chris should add an option under each thread near [Reply], like [Homework], which would automatically reply an answer like the one Christian wrote. ~RaGE();

                1 Reply Last reply
                0
                • C Christian Graus

                  Hi Alisha. Welcome to CP. This is a community of developers who love to help each other. Sadly, it appears we cannot help you. I could write this inside of 15 minutes, but if I did, how would it help you ? Your teachers assume they have given you enough information to do this problem, and certainly enough exists on the web and in books as well. In fact, I can think of a number of CP articles which between them would tell you all you need to know. If I did this problem, then you would have no idea how to do your next assignment, which would build on the skills you were supposed to build in writing this one. At what point do you propose to learn for yourself ? Both myself and the rest of this online community will fall over themselves to offer advice if in trying to write this assignment you get stuck somewhere, but no-one is going to do your homework for you. One day, you may live to thank us. The alternative is that you'll be cleaning the swimming pool of someone who did their own homework. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

                  R Offline
                  R Offline
                  Rickard Andersson20
                  wrote on last edited by
                  #8

                  I wonder why persons who start asking such questions and getting answers like these never write back again? :rolleyes: Rickard Andersson@Suza Computing C# and C++ programmer from SWEDEN! UIN: 50302279 E-Mail: nikado@pc.nu Speciality: I love C#, ASP.NET and C++!

                  1 Reply Last reply
                  0
                  • A alishaklas
                    1. Write a C++ program which reads the names and ages of 10 people, and store these data in structures that are elements of an array. Print the average age of these people. Also, print a table of 10 lines, with on each line the given data of a person, along with the (positive or negative) deviation of his or her age from the average age. store only the first 30 characters (followed by the null character) of names that are longer than 30 characters. Be sure to incorporate into your program the use of classes, private data, public function process data, constructors and destructors where appropriate. Notes: must use object oriented Notes: have choice * ask how many people would you like to enter data for. Thanks, Alisha
                    M Offline
                    M Offline
                    Michael P Butler
                    wrote on last edited by
                    #9

                    I wish my boss would give me such detailed specs. Sadly he failed his college programming course ;-) Michael Fat bottomed girls You make the rockin' world go round -- Queen

                    1 Reply Last reply
                    0
                    • R Roger Wright

                      That is one of the most comprehensive and gentle responses I have ever seen on this site to a "please do my homework for me" question. Thank you for setting a high standard for the rest of us to follow. I intend to emulate, to the best of my ability, the model behavior you have established, and I encourage the rest of our members to take notes, and refer to them often. "My child was Inmate of the Month at Mohave County Jail" - Bumper Sticker in Bullhead City, AZ

                      K Offline
                      K Offline
                      KaRl
                      wrote on last edited by
                      #10

                      I second that :)


                      Ohé Partisans, Ouvriers et Paysans C'est l'alarme! Le Chant des Partisans

                      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