Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, September 3, 2019

Codecademy Logical Operators 5/6


// Sample Solution
using System;

namespace LogicalOperators
{
  class Program
  {
    static void Main(string[] args)
    {
      //Barcelona
      bool beach = true;
      bool hiking = false;
      bool city = true;

      bool yourNeeds = beach && city;
      bool friendNeeds = beach || hiking;

      bool tripDecision = yourNeeds && friendNeeds;
      Console.WriteLine(tripDecision);
      //Portbou
      bool beach2 = true;
      bool hiking2 = false;
      bool city2 = false;

      bool yourNeeds2 = beach2 && city2;
      bool friendNeeds2 = beach2 || hiking2;

      bool tripDecision2 = yourNeeds2 && friendNeeds2;
      Console.WriteLine(tripDecision2);
    }
  }
}

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts