Nikhil Gurung

Nikhil Gurung

  • NA
  • 1
  • 1.4k

How do i convert this code to c#?I am new to programming.

Nov 3 2014 3:04 PM
I wanted to start programming and know how it works in both pseudocode and c#

String carName;
                    String carPlate;
                    int i, j;

                    for (i = 0;i < size of carPark; i = i+1
                    for int b = 0;i < 2; b = b+1
                        carPark[i][b] = "empty";
                    // When guest comes
                    carName = Userinputs name;
                    carPlate = User inputs plate;
                    for int i = 0, i< size of carPark; i = i+1
                    for int b = 0; b<2; b= b+1
                        if carPark[i][b] ==/equals to "empty"
                    carPark[i][b] = carName;
                    carPlate[i][b+1] = carPlate;
                    return "Car has bee placed at space " + i
                    return "No empty spaces left"
                        // When guest leaves
                    for int i = 0, i< size of carPark; i = i+1
                    for int b = 0; b<2; b= b+1
                        if carPark[i][b] ==/equals to carName
                            carPark[i][b] = "empty"
                    carPark[i][b+1] = "empty"
                    return "Car has bee placed at space " + i
                    return "Car not found"

Answers (3)