Jump to content

Programmr C# More User Input of Data

WolfDeville

Hey all!

 

I need some help :'( I went on this http://www.programmr.com/more-user-input-data and I done the exercise and the code I wrote seems to work but it keeps saying "Oops!" when I click "test your code" meaning I failed. Here is the code:

 

 

using System;
using System.Linq;

 

class Program
{
    static void Main()
    {
        var firstName = "";
        var lastName="";
        var grade = 0;
        var studentId = 0;
        var login = "";
        var gpa=0.0;

        Console.WriteLine("Please enter the details:\nFirst name:\nLast name:\nGrade(9-12):\nStudent Id:\nUsername:\nGPA(0.0-4.0):");

        //write your code here
        firstName = Console.ReadLine();
        lastName = Console.ReadLine();
        grade = int.Parse(Console.ReadLine());
        studentId = int.Parse(Console.ReadLine());
        login = Console.ReadLine();
        gpa = double.Parse(Console.ReadLine());
       
      

        Console.WriteLine("Your Information:\nUsername:{0}", login);
        Console.WriteLine("Id:{0}", studentId);
        Console.WriteLine("Name:{0} {1}", lastName,firstName);
        Console.WriteLine("GPA:{0}", gpa);
        Console.WriteLine("Grade:{0}", grade);
       
       
    }
}

 

Am I doing something wrong?

Link to comment
Share on other sites

Link to post
Share on other sites

it works man

there is no issue
i copied ur work over to that site ran it and said i comeplted the excercise

Link to comment
Share on other sites

Link to post
Share on other sites

What browser are you using? I was using IE10 before and it wasn't working but I just tried it in Firefox and it worked :S

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×