Skip to content
Loading
  • Nitin Sontakke
    0
    Again, when in input it is "Total of 2 bike" why does your output shows 1? Are you saying that you are having trouble identifying "members"?
     
    If yes, you cannot treat each line same. First you will need to identify which line is this and treat it separately. Identify that "Bike details" have started and they are over, etc.
    0
  • 0
    Sorry .I updated my question.
    0
  • Nitin Sontakke
    0
    Dinesh, I am not seeing what is updated. Still 2 in input and 1 in output!
     
    Because this issue is faced by you, you know everything about it. The things which are quite obvious to you will not be very obvious to us. So you will need to point us out very preciously where the problem is.
     
    Please try to imagine our situation. You will need to tell us each and every minor thing and also help us understand the issue immediately so that we focus on resolving the issue and not understanding the issue, which i assume already aware of.
    0
  • 0
    I don't know how to explain you to understand my problem.Anyhow thanks for your help@
    Nitin Sontakke
    0
  • 0
    Your coding is not very well structured.You have a line that is not being printed, but you are processing it. At the moment you are repeating code for each item, which leads to errors.
     
    You may want to change these lines to be done in loops. That way, all the items in the array will be actioned. Try to make your code something similar to this structure. (This is pseudocode, so you will have to use the correct C# syntax for your code.)
     
    Main print report code
       {
          Print header()
          Print Usage()
          Print footer()
       }
     
    Print header()
    {
       (format header how you want it)
     }

    Print Usage()
       {
          For each item in array
             // (format the data how you want it printed) 
             // then Print data to console
          Next
       }

    Print footer()
       {
          Console.WriteLine("Name:" + bikeName);
          Console.WriteLine("Total:" + issuedBike);
          Console.WriteLine("InUse:" + inUseBike);
          Console.WriteLine();
       }
     
    Obviously, you will have to design the header and footer how you want them.
     
    The advantage of using functions and loops is to save coding the same line many times. it also makes it easier to change a coded section without having to go through all the code.
    0