Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:21:41+00:00 2026-05-16T15:21:41+00:00

this is my first time posting my problem here, i hope i get help

  • 0

this is my first time posting my problem here, i hope i get help 🙂

My Problem:

I am trying to display the “This Old Man” (first two stanzas only) in the Console.
I am beginning to learn methods, so please bear my n00bishness.

The Song goes:

This old man, he played one
He played knick−knack on my thumb
With a knick−knack paddy−whack
Give a dog a bone
This old man came rolling home


This old man, he played two
He played knick−knack on my shoe
With a knick−knack paddy−whack
Give a dog a bone
This old man came rolling home

I coded the following:

namespace Song
{
    class Song
    {
        static void Main(string[] args)
        {
            doVerse(1);
            doChorus();
        }
        static void doChorus()
        {
            Console.WriteLine("With a knick−knack paddy−whack");
            Console.WriteLine("Give the dog a bone");
            Console.WriteLine("This old man came rolling home");
            Console.WriteLine();
            Console.ReadLine();
        }
        static void doVerse(int verseNum)
        {
            string message = "";
            message += "This old man, he played ";
            message += verseNum;
            message += ". \nHe played knick−knack ";
            //message += getPlace(verseNum);
            Console.WriteLine(message);
        }
        static void getPlace()
        {
            string message = "";
            switch (verseNum)
            {
                case 1:
                    message = "on my thumb ";
                    break;
                case 2:
                    message = "on my shoe";
                    break;
                default:
                    message = "not yet defined";
                    break;
            }
            return message;
        }
    }
}

Visual studio is giving me the following errors:

http://i56.tinypic.com/fx850m.jpg

I hope you guys understand my intention with this program.

Thanks

Regards,

Kyle 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:21:42+00:00Added an answer on May 16, 2026 at 3:21 pm

    Change your getPlace method to this:

    static string getPlace(int verseNum)
    {
        string message = "";
        switch (verseNum)
        {
            case 1:
                message = "on my thumb ";
                break;
            case 2:
                message = "on my shoe";
                break;
            default:
                message = "not yet defined";
                break;
        }
        return message;
    }
    

    I’m guessing this is homework, so I’ll explain why it wasn’t working. You had two errors:

    1. You’re method was set to static void
      and you were trying to return a
      string. You had to replace void
      with string to indicate that the
      method returns a string.
    2. You were using a
      variable called verseNum which was
      not present in the method. To pass
      in the variable you have to include
      it within the method signature.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First time posting on here, so I hope I do this correctly, however I
this is my first time posting here, I have a question which I have
First time posting here, will try to be succinct. This is a classic 'can't
So this is my first time posting here but I'm more or less stumped.
This is my first time posting to Stack Overflow. I'm trying to build a
First time posting here. I have problem about referencing a typedef struct from separate
First time posting in Stack Overflow, hope I'm doing this right. I'm writing an
I am a junior web developer and this is my first time posting here.
first time posting here, but god know's I use this site to search for
this is my first time posting on StackOverflow but this site is awesome. Thanks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.