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

The Tax lesson

Picture
To try and accomplish this lesson i had to learn a little bit about how to figure up the mathematical end of it all. The code isn't really all that difficult once the formula is figured out.

This lesson is all about using If Else statements in such a way as figuring out how much and item costs before tax and how much tax has then been placed upon that item.

For Example; I have to pay $123 for an item at the cash register, and I know that the tax in my area is 23%. That would make the item original price tag $100 and the tax on the item $23 finishing out with a final price of $123.00. 

That example is really simple. because it is based off of perfect numbers... But what about the following scenario?

The final price being $123 and the tax rate being 50%........
These numbers changed EVERYTHING!!! I struggled with this and struggled with this until I finally found this Web page...

Click on the picture above to go to the web page  

On this web page I found a formula that I never knew before. It is actually really simple and straight forward.

Here is how it breaks down.

Take the percent... In the example it is 50% and divide it by 100... giving us .50, then add 1 to it. This will give us the number 1.5 

We then take the Gross price of $123 and divide it by 1.5, that we got from the previous step. This gives us $82, which is the original price of the item that we call the Net price. If we take $82 and subtract it from $123 that would give us $41 which is half of $82 and so that confirms everything.

In my video below I will basically do this same procedure as I just described above, for those that don't get it from the text.  




​The Assignment 

Wherever you are and whatever you pay for, you usually spend your money on two things:
the first is for a good or service you are buying, and the second is taxes.

This means that the amount of money you are transferring (named "gross price") to the seller is a sum of the actual price (named "net price") and the tax.
The tax is calculated as a percentage of the net price and its rate depends on a lot of unpredictable factors (e.g. where you live, what you buy, etc., etc., etc.).
Your task is to write a simple "tax calculator" – it should accept two values:a gross price and a tax rate expressed as a percentage (i.e. a value greater than 0 and, let's be optimistic, less than 100).

Look at the code below – it only reads two input values and outputs the results, so you need to complete it with a few smart calculations. It would be good to verify if the values entered are reasonable (e.g. gross price is greater than zero and tax rate falls into the previously mentioned range).

​Test your code using the data we've provided. 

Sample Code

#include
using namespace std;

int main(void)
{

     float grossprice, taxrate, netprice, taxvalue;
     cout << "Enter a gross price: ";
     cin >> grossprice;
     cout << "Enter a tax rate: ";
     cin >> taxrate;
     // Insert you code here

     cout << "Net price: " << netprice << endl;
     cout << "Tax value: " << taxvalue << endl;
     return 0;
​}




​Helping video

Proudly powered by Weebly