Search This Blog

Thursday, April 21, 2016

Our current Train Status System

Step1:

Welcome to designer dairy blog..  Here we are going to look how to apply the  java script conditional

statement for various output

we are going to check

     1. train is running or not ? 
     2. How many trains are available ?
     3. How many trains are running ?
     4. How many trains are not running ?
     5. what are the weekday trains available ?
     6. At what time train is going to start ?

 Step2:

Depending upon  the trainOperational value it will check and satisfied the conditions


var totaltrains = 12

var trainOperational = 8;

//var trainOperational = 12;

var weekday = "friday";


if(trainOperational > 0) {


if(totaltrains == trainOperational)
{
  console.log("All trains are running at the JavaScript Express!");
}

 else {

 for(var trainNumber =1; trainNumber <=totaltrains; trainNumber++)
 {
  
    if(trainNumber<=trainOperational && trainNumber!=3)
     
    {
     
      console.log("Train#" +trainNumber  + " is running");
    }
  
    else if(trainNumber==10 || trainNumber==12 )
    {
      console.log("Train#" +trainNumber  + " is running at noon");
    }
  
    else if(trainNumber==3 && weekday=="friday" )
    {
      console.log("Train#" + trainNumber  + " is running");
    }
  
    else
     
    {
     
      console.log("Train#" + trainNumber  + " is not running");
     
    }
  
 }

}

}
else
{
   console.log("No trains are operational today. Bummer!");
 
}


Step 3:

Enjoy Folks

Validating to select in sequencial order using angular

    < input type = "checkbox" (change) = "handleSelectTaskItem($event, taskItem)" [checked] = " taskItem . i...