Help with some coding

KING_OF_SAND

New member
So in my computer science class we are asked to do some very simplistic C# coding. All i am required to do is have a child implement his first and last name, parents full name, and phone number. Then i go to debug mode to see if it all works, and it does "to a point." after i implement the phone number and press <Enter> again it is supposed to display all that was entered one last time. and it does but only for a split second after pressing <Enter> when it is supposed to stay up so it can be viewed. can someone explain to me why it is not.

Here is the Code:

Program:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using NameProject;

namespace NameProgram

{

class Program

{

static void Main(string[] args)

{

showMessage sM = new showMessage();

}

}

}

ShowMessage

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace NameProject

{

class showMessage

{

public showMessage()

{

String F;

String L;

String P;

String phoneNumber;

Console.WriteLine("Please Enter Child's first Name: ");

F = Console.ReadLine();

Console.WriteLine("Please Enter Child's last Name: ");

L = Console.ReadLine();

Console.WriteLine("Please Enter Parent's first & last Name: ");

P = Console.ReadLine();

Console.WriteLine("Please Enter Phone Number: ");

phoneNumber = Console.ReadLine();

Console.WriteLine("Child's first Name" + F + "Child's last Name"

+ L + "Parent's Name" + P);

}

}

}

very simple but it works, again to an extent.

also forgive that the indenting is not correct, its the forum that is screwing it up, but i assure you it is correct.
 
using System;

class ReadStr

{

public static void Main()

{

Console.Write("Enter your name:");

string szName = Console.ReadLine();

Console.WriteLine(" Hey "+ szName);

}

}
 
i figured out the problem. there was an issue with my VS2010. i greatly appreciate your help tho!
smile.gif
 
Back
Top