Digital FXtbook
Easy Contacts
  • Home
    • Free Software
    • The Author
    • Former Students Hall of Fame
    • A tribute....
  • Animation
    • Intro to 3d >
      • AutoDesk
      • Introduction: The Temple
      • Creating a Film >
        • Scriptwriting and Planning
        • StoryBoarding
        • Story Reels
      • Modeling >
        • The Nail
        • First Freestyle Lesson >
          • Cup and Straw
          • Garbage Can
        • Fence
        • Hammer
        • House
        • Environment Bubble
      • Animation >
        • Beginning Animation
        • Animation - Walk Cycle
        • Facial Animation
      • Rendering >
        • Arnold Rendering
      • Editing film >
        • Credits
        • Video Editing
      • Characters
    • Modeling and Rigging >
      • Modeling >
        • Image Planes
        • Polygon Modeling >
          • Coke Can
          • Low Polygon Character
          • Character Modeling Legion the Geth
          • Character Modeling Geth Armor
          • Face Modeling
        • NURBS Modeling >
          • Intro to NURBS
          • Lofting
          • CV Curves
          • Organic Modeling
          • Autombile
      • 3d Coat >
        • Integration with Maya >
          • Getting stuff out of Maya
        • UV Texture Mapping >
          • Texture mapping in 3d Coat
        • 3d Painting >
          • Painting in 3d Coat
        • Reintegration with Maya
      • Rigging >
        • Rigging with HumanIK
        • Smooth Skinning
      • Motion Capture
    • 3d Animation >
      • Arnold Rendering
      • Reference Videos
      • Beginning Animation
      • Characters
  • Gaming
    • Board Game Game Design Document
    • Modeling >
      • Introduction: The Temple
      • 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 >
      • Block Breaker >
        • Block Breaker Game #1
        • Block Breaker Game #2
        • Block Breaker Game #3
        • Block Breaker Game #4
      • Terrain
      • Importing Models
  • Coding
    • Beginning C# >
      • First Unit >
        • First Program
        • Introduction Unity Lesson
        • Comments
        • PsuedoCode
        • Numbers and Operators
        • Use of Parenthesis
        • Casting
        • Try and Catch
        • Operators
      • Second Unit >
        • Conditional Statements >
          • Number validator
          • Number tester
          • Speed Camera
        • Random Class
        • Loops >
          • For Loops
          • For Each Loops
          • While Loops
          • Do While Loops
        • Arrays >
          • Simple Arrays
          • Complex Arrays
    • Intermediate C# >
      • Object Oriented Programming
  • 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 >
      • Project 1
    • Illustrator >
      • Vector Ninjas
      • Live Art Painting
      • Starting the Pen Tool
      • Apple and Pear
      • Creating Your LOGO
      • Self Portrait
  • Links
    • Distance Reconnecting
    • Key Board Fix/Hack
    • Buiding Piers >
      • Buiding Piers
      • Buiding Piers
    • The Top Six Animation Schools
    • The Top Video Game Design Schools
  • International Team
  • BPA
    • BPA 2017-2018 >
      • Getting organized
      • Building the Train
      • Texturing the Train
      • Animating the Train
      • Making our Entry Film
    • BPA 2018-2019
    • BPA 2019-2020
  • Arnold Lighting
  • Faculty Video
  • Velomobile
  • CTE Summer Workshop

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