Debugging a basic C# calculator
Posted by Gizmosis350k
Last Updated: March 24, 2012
  558

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ch03Ex2
{
    class Program
    {
        static void Main(string[] args)
        {
            double firstNumber, secondNumber;
            string userName;
            Console.WriteLine("Enter your name:");
            Console.ReadLine();
            userName = Console.ReadLine();
            Console.WriteLine("Welcome {0}!", userName);
            Console.ReadKey();
            // Something is broken here rofl
            Console.WriteLine ("Now give me a number:");
            firstNumber = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Now give me another number:");
            secondNumber = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine ("The sum of {0} and {1} is {2}.", firstNumber, secondNumber, firstNumber + secondNumber);
            Console.WriteLine ("The result of multiplying {0} by {1} is {2}.", firstNumber, secondNumber, firstNumber * secondNumber);
            Console.WriteLine ("Subtracting {0} from {1} gives you {2}.", firstNumber, secondNumber, firstNumber - secondNumber);
            Console.WriteLine ("If we divide {0} by {1} we get {2}.", firstNumber, secondNumber, firstNumber / secondNumber);
            Console.WriteLine("The remainder left from dividing {0} by {1} is {2}.", firstNumber, secondNumber, firstNumber % secondNumber);
            Console.WriteLine("This program is partially broken lol");
            Console.ReadKey();        
        }
    }
}


Something is causing the console to malfunction when i enter my name, what could be causing it?
   
  
 
 
   

 
 
found the bug, this is awesome
 
erase the readline() from below "Enter your name"
 
keep up the good work
 
will try, Chapter 8 look well tusty still - -