View Single Post
  #1 (permalink)  
Old October 20th, 2017, 11:10 PM
markwharveyaprn markwharveyaprn is offline
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2017
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 exercise 1

Here is how I got it to run, because it won't run the way that it is in the book:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;

namespace Ch04Ex1
{
    class Program
    {
        static void Main(string[] args)
        {
            WriteLine("Enter an integer:  ");
            int myInt = Convert.ToInt32(ReadLine());
            bool isLessThan10 = myInt < 10;
            bool isBetween0and5 = (0 <= myInt) && (myInt <= 5);
            WriteLine($" Integer less than 10? {isLessThan10}");
            WriteLine($"Integer between 0 and 5? {isBetween0and5}");
            WriteLine ($"Exactly one of the above is true? { isLessThan10 ^ isBetween0and5}");
            ReadKey();

        }

        private static int ToInt32(string v)
        {
            throw new NotImplementedException();
        }
    }
}
Reply With Quote