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

  • SEARCH
  • Home
  • 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 8721313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:12:03+00:00 2026-06-13T07:12:03+00:00

Can anyone tell me why am I getting this error? This is my first

  • 0

Can anyone tell me why am I getting this error? This is my first post to this forum. The research I have done to fix the problem on my own says I may have an improper curly brace somewhere, but I cannot locate it. Any help is greatly appreciated.


using System;

    class Program
    {
    //declare constant
    const double ANGLES_FROM_RADIANS = 57.295779513082323;

    static void Main()
    {

        //declare vairiables
        double xc = 0.0;
        double yc = 0.0;
        double radius = 0.0;
        double theta = 0.0;

        //call methods
        double GetUserInput (ref double xc, ref double yc);
        double CalcCoords (double xc, double yc, ref double radius, ref double theta);
        double Output (double radius, double theta);
     }


    //method prologue

    static double GetUserInput (ref double xc, ref double yc)
    {
        xc = 0;
        yc = 0;
        while (xc = 0)
        {
     Console.WriteLine("Please enter a possitive, non-zero value for the  x-ccordinate   of a point.");
            xc = int.Parse(Console.ReadLine());
            if (xc <= 0)
            {
                Console.WriteLine("Error, x must be greater than zero.");
            }
        }
        Console.WriteLine("Please enter a possitive value for the y-coordinate of a point.");
        yc = int.Parse(Console.ReadLine());

        Return Console.WriteLine("Your Coordinates are ({0},{1})", xc, yc);
    }

    //method prologue
    static double CalcCoords (double xc, double yc, ref double radius, ref double theta)
    {
            {
            radius = Math.sqrt((xc * yc) + (xc * yc));
            return radius;
            }
            {
            theta = Math.Atan(yc / xc) * ANGLES_FROM_RADIANS;
            return theta;
        }
    }

    //method prologue
    static double Output (double radius, double theta)
    {
        Console.WriteLine("For your polar coordinates:");
        Console.WriteLine("Distance from the origin: {0:f}", radius);
        Console.WriteLine("The angle (in degrees) from the x-axis is: {0:f3}", theta);
    }   

        Console.ReadLine();

    }//End Main()
    }//End class Program
  • 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-06-13T07:12:04+00:00Added an answer on June 13, 2026 at 7:12 am

    Last brace is extra mate .This one –

    }//End Main()
    

    Also why last Console.ReadLine(); is misplaced. Shouldn’t it be in under any method scope?

    EDIT

    I don’t know what your code suppose to do. It contains lot of errors and the intent of code is not clear too. This code is compiling though –

    class Program
        {
            //declare constant
            const double ANGLES_FROM_RADIANS = 57.295779513082323;
    
            static void shdg()
            {
                //declare vairiables
                double xc = 0.0;
                double yc = 0.0;
                double radius = 0.0;
                double theta = 0.0;
            }
    
            //method prologue
            static void GetUserInput(ref double xc, ref double yc)
            {
                xc = 0;
                yc = 0;
                while (xc == 0)
                {
                    Console.WriteLine("Please enter a possitive, non-zero value for the  x-ccordinate   of a point.");
                    xc = int.Parse(Console.ReadLine());
                    if (xc <= 0)
                    {
                        Console.WriteLine("Error, x must be greater than zero.");
                    }
                }
                Console.WriteLine("Please enter a possitive value for the y-coordinate of a point.");
                yc = int.Parse(Console.ReadLine());
    
                Console.WriteLine("Your Coordinates are ({0},{1})", xc, yc);
            }
    
            //method prologue
            static double CalcCoords(double xc, double yc, ref double radius, ref double theta)
            {
                {
                    radius = Math.Sqrt((xc * yc) + (xc * yc));
                    return radius;
                }
                {
                    theta = Math.Atan(yc / xc) * ANGLES_FROM_RADIANS;
                    return theta;
                }
            }
    
            //method prologue
            static void Output(double radius, double theta)
            {
                Console.WriteLine("For your polar coordinates:");
                Console.WriteLine("Distance from the origin: {0:f}", radius);
                Console.WriteLine("The angle (in degrees) from the x-axis is: {0:f3}", theta);
            }
        }//End class Program
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error. Can anyone tell me what it means or how
Can anyone tell me why am I getting this error when running app/console in
Can anyone tell me why I keep getting a displaymessage is not defined error
Can anyone tell me what is happenning here? I am getting duplicated session ID's
Can anyone tell me why this code would not be working? $('body').on('test', function() {
Can anyone tell me if I can (in the command line) issue a POST
Can anyone tell me how to have keywords like AND and OR in the
Can anyone help me with this code and tell me what is wrong? My
can anyone tell me how to select data by date in MS.ACCESS database using
Can anyone tell me why the following code fails to submit the form into

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.