Digital FXtbook
Easy Contacts
  • Home
    • Free Software
    • The Author
    • Former Students Hall of Fame
    • A tribute....
  • Gaming
    • Board Game Game Design Document
    • Modeling >
      • Introduction: The Temple
      • Minecraft Steve
      • Minecraft Tools and Weapons
      • Roblox Character modeling
      • Sword of Light
      • Buzz Axe
      • Halo 1 Blood Gulch Base
      • Hammer
      • Sword
      • Character Modeling Big Daddy
      • Shield
      • The OM6G
      • Weapon
      • Character Modeling Legion the Geth
      • Character Modeling Geth Armor
    • Animation >
      • Character Animation
    • Rigging >
      • Rigging with HumanIK
      • Characterizing and MoCap
      • Integration with Unity
    • Unity >
      • Terrain
      • Importing Models
  • Coding
    • Beginning C# >
      • First Unit >
        • First Program
        • Comments >
          • PsuedoCode
        • Variable Types >
          • AlphaNumeric Variables
          • Numeric Variables
        • Getting input from the user
        • Try and Catch
        • Operators >
          • Assignment Operators >
            • Zeller's Congruence
            • Leap Year
          • Comparison Operators >
            • Logical Data, Illogical Assignment
          • Arithmetic Operators >
            • Use of Parenthesis
            • Algebra in code and assundry CHAOS
            • Pre and Post Operators
            • Shortcut Operators
            • Floats Conversion from Metric to English
            • When is Easter??
          • Logical Operators
        • Casting
      • Second Unit >
        • Conditional Statements >
          • Number validator
          • Number tester
          • Speed Camera
        • Random Class
        • Arrays >
          • Simple Arrays
          • Complex Arrays
        • Loops >
          • For Loops >
            • Adding Numbers
          • For Each Loops
          • While Loops
          • Do While Loops
      • Third Unit
    • Intermediate C# >
      • Object Oriented Programming
    • Unity Coding >
      • Introduction Unity Lesson
      • Number Wizard Game #1
      • Second Unity Game: Text Adventure
      • Number Wizard Game GUI
      • Block Breaker >
        • Block Breaker Game #1
        • Block Breaker Game #2
        • Block Breaker Game #3
        • Block Breaker Game #4
    • Linda Training >
      • What is C#?
      • Working with Classes
  • Student Films
    • Advanced Student's movies
    • Beginning Student's movies
  • Adobe
    • Photoshop >
      • Introduction
      • Selection Tools >
        • Melonhead >
          • Melonhead Creative
        • Breakfast Lunch or Dinner
        • Blu 42
      • Painting Tools >
        • Invisi-World
        • Image Adjustment
        • FreeStyle project
      • Drawing Tools >
        • Abstract Expressionism
    • Premier >
      • Linda Training Intro
      • Basic Editing
      • Editing Refinement
    • Illustrator >
      • Vector Ninjas
      • Live Art Painting
      • Starting the Pen Tool
      • Apple and Pear
      • Creating Your LOGO
      • Self Portrait
  • Com Apps
    • Com Apps page 1
    • Com Apps page 2
    • Com Apps page 3
    • Com Apps page 4
  • Links
    • Distance Reconnecting
    • Key Board Fix/Hack
    • Buiding Piers >
      • Buiding Piers
      • Buiding Piers
    • The Top Six Animation Schools
    • The Top Video Game Design Schools
    • Contests >
      • International Team

Logical Data
with an Illogical Assignment 

In this lesson you are going to have the opportunity to interact with operators and Logical Data. Somtimes in code the things that you need to test for can be very specific and strange if you don't know the circumstances of why you are trying to get them. This is exactly the case in the assignment. You are being asked to utilize operators to test for specific values.
Good luck and enjoy... Believe it or not this is really not all that hard.


The Code

#include <iostream>

using namespace std;

int main()
{
     bool answer;
     int value;
     cout << "Enter a value: ";
     cin >> value;

     answer = ... // insert your expression here

     cout << (answer ? "THAT'S TRUE :)" : "THAT'S NOT TRUE :(") << endl;

     return 0;
} 

The conditions

Take a look at the code below: it reads an integer value, and is then ready to perform a complicated test and print the answer – it may be positive or it may not.

Okay, you may be a bit surprised with the form of the line sending the result to the output, but don't worry – it'll look familiar to you soon.

Just accept it as-is and just remember that the purpose of this construction is to write a clear message concerning the test result.

We need a number whose value:
1. is greater than or equal to 0 and less than 10, or
2. multiplied by 2 is less than 20 and reduced by 2 is greater than minus 2, or
3. reduced by 1 is greater than 1 and divided by 2 is less than 10, or
4. is equal to 111.


​Write the above condition in the form of an expression accepted by the C++ language and assign its result to the answer variable. Test your code using the data we've provided. 

Helpful hints:
Greater than looks like this >
​Less than looks like this <
Greater than or equal to looks like this >=
Less than or equal to looks like this <=

Reduced/Subtract looks like this -
Increased/Added looks like this +

Multiplied looks like this *
Divide by looks like this /

Testing to see if something is Equal to something else looks like this ==
Testing to see if something is Not Equal to something else looks like this !=

Or looks like this ^ (it is a Shift 6)
And looks like this && (it is a double Shift 7)


The Results

Example input
-2
​
Example output
THAT'S NOT TRUE :(


Example input
0
 
Example output
THAT'S TRUE :)


Example input
4

Example output

THAT'S TRUE :)


Example input
10

Example output THAT'S TRUE :)


Example input
22

Example output
THAT'S NOT TRUE :(


Example input
100

Example output
THAT'S NOT TRUE :(


Example input
111

Example output
THAT'S TRUE :) 



​Pre-Assignment Video

The Assignment



​So now that we have watched the video finish up the code and make sure that it works for all of the examples



Proudly powered by Weebly