Click here to Skip to main content
15,885,918 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace feedbackformasp.net
{
    class Program
    {
        static void Main(string[] args)
        {
            string cont;
           do
           {

                Console.WriteLine("course list");
                Console.WriteLine("1.c#:2.asp.net:3.ado.net");
                //int ch= Convert.ToInt32 (Console.ReadLine());
            }
            here is the error 
switch (Convert.ToInt32(Console.ReadLine()))
            {
                case 1:
                Console.WriteLine("1. whether c# is too easy"+"\n"+"2.how many days coarse do u prefer"+"\n"+"3.which timings are preferable for u");
                    break;
                case 2:
                    Console.WriteLine("1.coarse duration"+"\n"+"2.timings"+"3.syllabus cover");
                        break;
                case 3:
                    Console.WriteLine("1.how do u feel ado.net"+"\n"+"2.thank you for ur interest");
                    break;
                default:
                    Console.WriteLine("wrong choice");
                    break;

            }
            Console.WriteLine("do u want to continue to continue ? (Y/N): ");
            cont = Console.ReadLine();
        while(cont=="Y"||cont=="y");
        Console.ReadLine();
       

        }
    }
}
Posted
Updated 10-Aug-14 21:30pm
v3
Comments
[no name] 11-Aug-14 3:10am    
This is not a question..we are not here to play quiz contest.
improve your question and update the error you are getting..
naralasaimanoj 11-Aug-14 3:19am    
just run it over in visual studio 2010,u will get out the error
CB Sharma 11-Aug-14 3:17am    
Can you provide the error details you are facing?
naralasaimanoj 11-Aug-14 3:20am    
i used do na? it is showing at the place 'switch' , expecting while etc
CB Sharma 11-Aug-14 3:24am    
This is not the quiz contest understood.

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

We also have no idea what you consider "the error present in this program" - from my prospective there are loads of them, but you are not likely to have spotted any of those!

Try it yourself, you may find it is not as difficult as you think!

But...I'll give you a clue as the the problem I suspect you have spotted:
Where does the "do" loop end? And it's not at the "while"...
 
Share this answer
 
Close the braces regarding the "do" properly.

C#
static void Main(string[] args)
        {
            string cont;
           do
           {

                Console.WriteLine("course list");
                Console.WriteLine("1.c#:2.asp.net:3.ado.net");
                //int ch= Convert.ToInt32 (Console.ReadLine());
            
          
switch (Convert.ToInt32(Console.ReadLine()))
            {
                case 1:
                Console.WriteLine("1. whether c# is too easy"+"\n"+"2.how many days coarse do u prefer"+"\n"+"3.which timings are preferable for u");
                    break;
                case 2:
                    Console.WriteLine("1.coarse duration"+"\n"+"2.timings"+"3.syllabus cover");
                        break;
                case 3:
                    Console.WriteLine("1.how do u feel ado.net"+"\n"+"2.thank you for ur interest");
                    break;
                default:
                    Console.WriteLine("wrong choice");
                    break;

            }
            Console.WriteLine("do u want to continue to continue ? (Y/N): ");
            cont = Console.ReadLine();
           }
        while(cont=="Y"||cont=="y");
        Console.ReadLine();


        }
 
Share this answer
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace feedbackformasp.net
{
    class Program
    {
        static void Main(string[] args)
        {
            string cont;
            do
            {

                Console.WriteLine("course list");
                Console.WriteLine("1.c#:2.asp.net:3.ado.net");

                switch (Convert.ToInt32(Console.ReadLine()))
                {
                    case 1:
                        Console.WriteLine("1. whether c# is too easy" + "\n" + "2.how many days coarse do u prefer" + "\n" + "3.which timings are preferable for u");
                        break;
                    case 2:
                        Console.WriteLine("1.coarse duration" + "\n" + "2.timings" + "3.syllabus cover");
                        break;
                    case 3:
                        Console.WriteLine("1.how do u feel ado.net" + "\n" + "2.thank you for ur interest");
                        break;
                    default:
                        Console.WriteLine("wrong choice");
                        break;

                }
                Console.WriteLine("do u want to continue to continue ? (Y/N): ");
                cont = Console.ReadLine();
            }
            while (cont == "Y" || cont == "y");
            Console.ReadLine();


        }
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900