98 Pages

lecture11 C#

Course: COMS 319, Spring 2008
School: Iowa State
Rating:
 
 
 
 
 

Word Count: 3003

Document Preview

S Com 319 C# Language Quick Overview Yih-Cheng (Bruce) Lee byclee@iastate.edu Before we begin You all know Java language. The syntax of C# is very similar to Java. You can read C# code very easily. When you see C# syntax, please think about corresponding Java syntax in your mind. Syntax is very similar but coding style for GUI is different. People used to call Windows Forms for .Net application on windows...

Register Now

Unformatted Document Excerpt

Coursehero >> Iowa >> Iowa State >> COMS 319

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
S Com 319 C# Language Quick Overview Yih-Cheng (Bruce) Lee byclee@iastate.edu Before we begin You all know Java language. The syntax of C# is very similar to Java. You can read C# code very easily. When you see C# syntax, please think about corresponding Java syntax in your mind. Syntax is very similar but coding style for GUI is different. People used to call Windows Forms for .Net application on windows desktop and Web Forms for .Net application on web. This introduction to C# just covers C# 1.0 fundamental knowledge. Outline 1. 2. 3. 4. 5. Overview of C# Using Value Type Variables Statements and Exceptions Methods and Parameters OOP related syntax 1. Overview of C# 1-1. Structure of a C# Program 1-2. Basic Input/Output Operations 1-3. Recommended Practices 1-4. Compiling, Running, and Debugging 4 1-1. Structure of a C# Program Hello, World The Class The Main Method The using Directive and the System Namespace 5 Hello, World (A console program) using System; class Hello { public static void Main() { Console.WriteLine("Hello, World"); } } // what is Console ? 6 The Class A C# application is a collection of classes, structures, and types A class is a set of data and behaviours Syntax class name { ... } A C# application can consist of many files A class CAN span multiple files (PARTIAL) 7 The Main Method When writing Main, you should: Use an uppercase "M", as in "Main" Designate one Main as the entry point to the program Declare Main as public static void Main When Main finishes, or returns, the application quits 8 The using Directive and the System Namespace The .NET Framework provides many utility classes Organized into namespaces System is the most commonly used namespace Refer to classes by their namespace System.Console.WriteLine("Hello, World"); The using directive using System; ... Console.WriteLine("Hello, World"); 1-2. Basic Input/Output Operations The Console Class Write and WriteLine Methods Read and ReadLine Methods 10 The Console Class Provides access to the standard input, standard output, and standard error streams Only meaningful for console applications Standard input keyboard Standard output screen Standard error screen 11 Write and WriteLine Methods Console.Write and Console.WriteLine display information on the console screen WriteLine outputs a line feed/carriage return Both methods are overloaded A format string and parameters can be used Text formatting Numeric formatting 12 Read and ReadLine Methods Console.Read and Console.ReadLine read user input Read reads the next character ReadLine reads the entire input line 13 1-3. Recommended Practices Commenting Applications Generating XML Documentation Exception Handling 14 Commenting Applications Single-line comments // Get the user's name Console.WriteLine("What is your name? "); name = Console.ReadLine( ); Multiple-line comments /* Find the higher root of the quadratic equation */ x = (...); 15 Generating XML Documentation /// <summary> The Hello class prints a greeting /// on the screen /// </summary> class Hello { /// <remarks> We use console-based I/O. /// For more information about WriteLine, see /// <seealso cref="System.Console.WriteLine"/> /// </remarks> public static void Main( ) { Console.WriteLine("Hello, World"); } } //SandCastle open source project on codeplex.com 16 Exception Handling using System; public class Hello { public static void Main(string[ ] args) { try{ Console.WriteLine(args[0]); } catch (Exception e) { Console.WriteLine("Exception at {0}", e.Message); } } } 17 1-4. Compiling, Running, and Debugging csc.exe - C# compiler with .Net framework Use IDE tool to run/debug for convenience 18 2. Using Value Type Variables 2-1. Common Type System 2-2. Naming Variables 2-3. Using Built-in Data Types 2-4. Creating User-Defined Data Types 2-5. Converting Data Types 19 2-1. Common Type System Overview of CTS Comparing Value and Reference Types Comparing Built-in and User-Defined Value Types Simple Types 20 Overview of CTS CTS supports both value and reference types Type Value Type Reference Type 21 Comparing Value and Reference Types Value types: Reference types: Directly contain their data Store references to their data (known as objects) Each has its own copy of data Operations on one cannot affect another Two reference variables can reference same object Operations on one can affect another 22 Comparing Built-in and User-Defined Value Types Value Types Built-in Type User-Defined Examples of built-in value types: Examples of user-defined value types: int float enum struct 23 Simple Types Identified through reserved keywords int // Reserved keyword - or System.Int32 24 2-2. Naming Variables Rules and Recommendations for Naming Variables C# Keywords 25 Rules and Recommendations for Naming Variables Rules Answer42 Use letters, the 42Answer underscore, and digits Recommendations Avoid using all uppercase letters Avoid starting with an underscore Avoid using abbreviations Use PascalCasing naming in multipleword names 26 different Different BADSTYLE _poorstyle BestStyle Msg Message C# Keywords Keywords are reserved identifiers abstract, base, bool, default, if, finally Do not use keywords as variable names Results in a compile-time error Avoid using keywords by changing their case sensitivity int INT; // Poor style 27 2-3. Using Built-in Data Types Declaring Local Variables Assigning Values to Variables Compound Assignment Common Operators Increment and Decrement Operator Precedence 28 Declaring Local Variables Usually declared by data type and variable name: int itemCount; Possible to declare multiple variables in one declaration: int itemCount, employeeNumber; --or-int itemCount, employeeNumber; 29 Assigning Values to Variables Assign values to variables that are already declared: int employeeNumber; employeeNumber = 23; Initialize a variable when you declare it: int employeeNumber = 23; You can also initialize character values: char middleInitial = 'J'; 30 Compound Assignment Adding a value to a variable is very common itemCount = itemCount + 40; There is a convenient shorthand itemCount += 40; This shorthand works for all arithmetic operators itemCount -= 24; 31 Common Operators Common Operators Example Equality operators == != Relational operators Conditional operators Increment operator Decrement operator Arithmetic operators < > <= >= is && || ?: ++ -+ - * / % Assignment operators = *= /= %= += -= <<= >>= &= ^= |= 32 Increment and Decrement Changing a value by one is very common itemCount += 1; itemCount -= 1; There is a convenient shorthand itemCount++; itemCount--; This shorthand exists in two forms ++itemCount; --itemCount; 33 Operator Precedence Operator Precedence and Associativity Except for assignment operators, all binary operators are left-associative Assignment operators and conditional operators are right-associative 34 2-4. Creating User-Defined Data Types Enumeration Types Structure Types 35 Enumeration Types Defining an Enumeration Type enum Color { Red, Green, Blue } Using an Enumeration Type Color colorPalette = Color.Red; Displaying an Enumeration Variable Console.WriteLine("{0}", colorPalette); // Displays Red 36 Structure Types public struct Employee { public string firstName; public int age; } Defining a Structure Type Using a Structure Type Employee companyEmployee; companyEmployee.firstName = "Joe"; companyEmployee.age = 23; 37 2-5. Converting Data Types using System; class Test { static void Main( ) { int intValue = 123; long longValue = intValue; Console.WriteLine("{0} = {1}",(long)intValue,longValue); } } using System; class Test { static void Main( ) { long longValue = Int64.MaxValue; int intValue = (int) longValue; Console.WriteLine("{0} = {1}", (int)longValue,intValue); } } 38 3. Statements and Exceptions 3-1. Introduction to Statements 3-2. Using Selection Statements 3-3. Using Iteration Statements 3-4. Using Jump Statements 3-5. Handling Basic Exceptions 3-6. Raising Exceptions 3-1. Introduction to Statements Statement Blocks Types of Statements Statement Blocks Use braces As block delimiters { // code } A block and its parent block cannot have a variable with the same name { int i; Sibling blocks can have variables with the same name { int i; ... } ... { int i; ... ... { int i; ... } } } Types of Statements Selection Statements The if and switch statements Iteration Statements The while, do, for, and foreach statements Jump Statements The goto, break, and continue statements 3-2. Using Selection Statements The if Statement Cascading if Statements The switch Statement The if Statement Syntax: if ( Boolean-expression ) first-embedded-statement else second-embedded-statement No implicit conversion from int to bool int x; ... if (x) ... // Must be if (x != 0) in C# if (x = 0) ... // Must be if (x == 0) in C# Cascading if Statements enum Suit { Clubs, Hearts, Diamonds, Spades } Suit trumps = Suit.Hearts; if (trumps == Suit.Clubs) color = "Black"; else if (trumps == Suit.Hearts) color = "Red"; else if (trumps == Suit.Diamonds) color = "Red"; else color = "Black"; The switch Statement Use switch statements for multiple case blocks Use break statements to ensure that no fall through occurs switch (trumps) { case Suit.Clubs : case Suit.Spades : color = "Black"; break; case Suit.Hearts : case Suit.Diamonds : color = "Red"; break; default: color = "ERROR"; break; } 3-3. Using Iteration Statements The while Statement The do Statement The for Statement The foreach Statement The while Statement Execute embedded statements based on Boolean value Evaluate Boolean expression at beginning of loop Execute embedded statements while Boolean value Is True int i = 0; while (i < 10) { Console.WriteLine(i); i++; } 0 1 2 3 4 5 6 7 8 9 The do Statement Execute embedded statements based on Boolean value Evaluate Boolean expression at end of loop Execute embedded statements while Boolean value Is True int i = 0; do { Console.WriteLine(i); i++; } while (i < 10); 0 1 2 3 4 5 6 7 8 9 Place update information at the start of the loop for (int i = 0; i < 10; i++) { Console.WriteLine(i); } The for Statement Variables in a for block 1 scoped only within the block 0 are 2 3 4 5 6 7 8 9 for (int i = 0; i < 10; i++) A for loop can iterate over Console.WriteLine(i); several values Console.WriteLine(i); // Error: i is no longer in scope for (int i = 0, j = 0; ... ; i++, j++) The foreach Statement Choose the type and name of the iteration variable Execute embedded statements for each element of the collection class ArrayList numbers = new ArrayList( ); for (int i = 0; i < 10; i++ ) { numbers.Add(i); } foreach (int number in numbers) { Console.WriteLine(number); } 0 1 2 3 4 5 6 7 8 9 3-4. Using Jump Statements The goto Statement The break and continue Statements The goto Statement (Don't use) Flow of control transferred to a labeled statement Can easily result in obscure "spaghetti" (number code if % 2 == 0) goto Even; Console.WriteLine("odd"); goto End; Even: Console.WriteLine("even"); End:; The break and continue Statements The break statement jumps out of an iteration The continue statement jumps to the next iteration int i = 0; while (true) { Console.WriteLine(i); i++; if (i < 10) continue; else break; } 3-5. Handling Basic Exceptions Why Use Exceptions? Exception Objects Using try and catch Blocks Multiple catch Blocks Why Use Exceptions? Traditional procedural error handling is cumbersome Core program logic int errorCode = 0; FileInfo source = new FileInfo("code.cs"); if (errorCode == -1) goto Failed; int length = (int)source.Length; if (errorCode == -2) goto Failed; char[] contents = new char[length]; if (errorCode == -3) goto Failed; // Succeeded ... Failed: ... Error handling Exception Objects Exception SystemException OutOfMemoryException IOException NullReferenceException ApplicationException Using try and catch Blocks Object-oriented solution to error handling Put the normal code in a try block Handle the exceptions in a separate catch block try { Console.WriteLine("Enter a number"); Program logic int i = int.Parse(Console.ReadLine()); } catch (OverflowException caught) { Console.WriteLine(caught); } Error handling Multiple catch Blocks Each catch block catches one class of exception A try block can have one general catch block A try block is not allowed to catch a class that is derived from a class caught in an earlier catch block try { Console.WriteLine("Enter first number"); int i = int.Parse(Console.ReadLine()); Console.WriteLine("Enter second number"); int j = int.Parse(Console.ReadLine()); int k = i / j; } catch (OverflowException caught) {...} catch (DivideByZeroException caught) {...} 3-6. Raising Exceptions The throw Statement The finally Clause Checking for Arithmetic Overflow Guidelines for Handling Exceptions The throw Statement Throw an appropriate exception Give the exception a meaningful message throw expression ; if (minute < 1 || minute >= 60) { throw new InvalidTimeException(minute + " is not a valid minute"); // !! Not reached !! } The finally Clause All of the statements in a finally block are always executed Monitor.Enter(x); try { ... } finally { Monitor.Exit(x); } Any catch blocks are optional Checking for Arithmetic Overflow By default, arithmetic overflow is not checked A checked statement turns overflow checking on checked { int number = int.MaxValue; Console.WriteLine(++number); } unchecked { int number = int.MaxValue; Console.WriteLine(++number); } OverflowException Exception object is thrown. WriteLine is not executed. MaxValue + 1 is negative? -2147483648 Guidelines for Handling Exceptions Throwing Avoid exceptions for normal or expected cases Never create and throw objects of class Exception Include a description string in an Exception object Throw objects of the most specific class possible Catching Arrange catch blocks from specific to general Do not let exceptions drop off Main 4. Methods and Parameters 4-1. Using Methods 4-2. Using Parameters 4-3. Using Overloaded Methods 4-1. Using Methods Defining Methods Calling Methods Using the return Statement Using Local Variables Returning Values Defining Methods Main is a method Use the same syntax for defining your own methods using System; class ExampleClass { static void ExampleMethod( ) { Console.WriteLine("Example method"); } static void Main( ) { // ... } } Calling Methods After you define a method, you can: Call a method from within the same class Use method's name followed by a parameter list in parentheses You must indicate to the compiler which class contains the method to call The called method must be declared with the public keyword Methods can call methods, which can call other methods, and so on Call a method that is in a different class Use nested calls Using the return Statement Immediate return Return with a conditional statement static void ExampleMethod( ) { int numBeans; //... Console.WriteLine("Hello"); if (numBeans < 10) return; Console.WriteLine("World"); } Using Local Variables Local variables Created when method begins Private to the method Destroyed on exit Shared variables Class variables are used for sharing Scope conflicts Compiler will not warn if local and class names clash Returning Values Declare the method with non-void type Add a return statement with an expression Sets the return value Returns to caller Non-void methods must return a value static int TwoPlusTwo( ) { int a,b; a = 2; b = 2; return a + b; } int x; x = TwoPlusTwo( ); Console.WriteLine(x); 4-2. Using Parameters Declaring and Calling Parameters Mechanisms for Passing Parameters Pass by Value Pass by Reference Output Parameters Using Variable-Length Parameter Lists Guidelines for Passing Parameters Using Recursive Methods Declaring and Calling Parameters Declaring parameters Place between parentheses after method name Define type and name for each parameter Calling methods with parameters Supply a value for each parameter static void MethodWithParameters(int n, string y) { ... } MethodWithParameters(2, "Hello, world"); Mechanisms for Passing Parameters Three ways to pass parameters in in out Pass by value Pass by reference out Output parameters Pass by Value Default mechanism for passing parameters: Parameter value is copied Variable can be changed inside the method Has no effect on value outside the method static void AddOne(int x) Parameter must be of the same type or { x++; // compatible type Increment x } static void Main( ) { int k = 6; AddOne(k); } Console.WriteLine(k); // Display the value 6, not 7 Pass by Reference What are reference parameters? A reference to memory location Using reference parameters Use the ref keyword in method declaration and call Match types and variable values Changes made in the method affect the caller Assign parameter value before calling the method Output Parameters What are output parameters? Values are passed out but not in Using output parameters Like ref, but values are not passed into the method Use out keyword in method declaration static void OutDemo(out int p) { and call // ... } int n; OutDemo(out n); Using Variable-Length Parameter Lists Use the params keyword Declare as an array at the end of the parameter list static Always passlong[ ] v) long AddList(params by value { long total, i; for (i = 0, total = 0; i < v.Length; i++) total += v[i]; return total; } static void Main( ) { long x = AddList(63,21,84); } Guidelines for Passing Parameters Mechanisms Pass by value is most common Method return value is useful for single values Use ref and/or out for multiple return values Only use ref if data is transferred both ways Using Recursive Methods A method can call itself Directly Indirectly Useful for solving certain problems static ulong Fibonacci(ulong n) { if (n <= 2) return 1; else return Fibonacci(n-1) + Fibonacci(n-2); } 4-3. Using Overloaded Methods Declaring overloaded methods Method signatures Using overloaded methods Declaring Overloaded Methods Methods that share a name in a class Distinguished by examining parameter lists class OverloadingExample { static int Add(int a, int b) { return a + b; } static int Add(int a, int b, int c) { return a + b + c; } static void Main( ) { Console.WriteLine(Add(1,2) + Add(1,2,3)); } } Method Signatures Method signatures must be unique within a class Signature definition Forms Signature Definition No Effect on Signature Name of method Name of parameter Parameter type Parameter modifier(out,ref) Return type of method Using Overloaded Methods Consider using overloaded methods when: You have similar methods that require different parameters You want to add new functionality to existing code Do not overuse because: Hard to debug Hard to maintain 5. OOP related syntax 5-1. Deriving Classes 5-2. Implementing Methods 5-3. Using Sealed Classes 5-4. Using Interfaces 85 5-1. Deriving Classes Extending Base Classes Accessing Base Class Members Calling Base Class Constructors 86 Extending Base Classes class Token Derived class { ... } class CommentToken: Token { Colon ... } Base class Token concrete CommentToken concrete 87 Accessing Base Class Members* class Token { ... protected string name; } class CommentToken: Token { ... ... public string Name( ) { ... return name; } } } class Outside { void Fails(Token t) { t.name } 88 5-2. Implementing Methods Defining Virtual Methods Working with Virtual Methods Overriding Methods Working with Override Methods 89 Defining Virtual Methods Syntax: Declare as virtual class Token { ... public int LineNumber( ) { ... } public virtual string Name( ) { ... } } Virtual methods are polymorphic 90 Working with Virtual Methods To use virtual methods: You cannot declare virtual methods as static You cannot declare virtual methods as private 91 Overriding Methods Syntax: Use the override keyword class Token { ... public virtual string Name( ) { ... } } class CommentToken: Token { ... public override string Name( ) { ... } } 92 Working with Override Methods You can only override identical inherited virtual methods class Token { ... public int LineNumber( ) { ... } public virtual string Name( ) { ... } } class CommentToken: Token { ... public override int LineNumber( ) { ... } public override string Name( ) { ... } } You must match an override method with its associated virtual method You can override an override method You cannot explicitly declare an override method as virtual You cannot declare an override method as static or private 93 Using Sealed Classes namespace System { public sealed class String { ... } } namespace Mine { class FancyString: String { ... } } 94 5-3. Using Interfaces Declaring Interfaces Implementing Multiple Interfaces Implementing Interface Methods 95 Declaring Interfaces* Syntax: Use the interface keyword to Interface names should declare methods begin with a capital "I" interface IToken { int LineNumber( ); string Name( ); } No access specifiers No method bodies IToken interface LineNumber( ) Name( ) 96 Implementing Multiple Interfaces* A class can implement zero or more interfaces interface IToken { IToken IVisitable string Name( ); interface interface } interface IVisitable { void Accept(IVisitor v); } class Token: IToken, IVisitable Token An interface can extend zero or more interfaces { ... concrete A class can be more accessible than its base interfaces } An interface cannot be more accessible than its base interfaces A class must implement all inherited interface methods 97 Implementing Interface Methods The implementing method must be the same as the interface method The implementing method can be virtual or nonvirtual class Token: IToken, IVisitable { public virtual string Name( ) { ... } public void Accept(IVisitor v) { ... } } 98 Same access Same return type Same name Same parameters References C# specification, http://msdn2.microsoft.com/enus/library/aa645596(vs.71).aspx Microsoft open source project: http://www.codeplex.com Microsoft Code gallery: http://code.msdn.microsoft.com/
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Iowa State - COMS - 319
Information HidingIntroduction of Information Hiding (1/2) David Parnas first introduced the concept of informationhiding around 1972 He argued that the primary criteria for system modularizationshould concern the hiding of critical design de
Iowa State - COMS - 319
User Interface DesignThe Importance of the User Interfaces The interface is in many ways the &quot;packaging&quot; for computersoftware If it is easy to learn, simple to use, straightforward, andforgiving, the user will be inclined to make good use of
Iowa State - COMS - 319
Com S 319 Windows Forms in C#Yih-Cheng (Bruce) Lee byclee@iastate.edu Office Hour: Tu 11:30 ~ 12:30 Office: B13 AtanasoffOutline Accessing properties of an object in .Net way Form class Windows Forms Controls by FunctionWindows Forms Controls
Iowa State - COMS - 319
User Interface Design IIInput Design Basic Principles The goal is to simply and easily capture accurate informationfor the system Reflect the nature of the inputs Find ways to simplify their collectionOnline versus Batch Processing Online
Iowa State - COMS - 319
ADA IDesign Goals of Ada From the Ada Language Reference Manual (LRM):&quot;Ada was designed with three overriding concerns: program reliability and maintenance, programming as a human activity, and efficiency&quot; Of note is the sentence, also from th
Iowa State - COMS - 319
Com S 319 Windows Form Technique 1Bruce Yih-Cheng Lee 2008/3/3 Update UI from different threads Delegate (function pointer) InvokeRequired property of Control class BeginInvoke method of Control class BackgroundWorker DoWork event Progr
Iowa State - COMS - 319
Ada II&quot;=&quot;: BOOLEAN operator for equality Is_It := (One + 1) = Two;Is_It := (1 + 1) = 2; Is_It := 2 = 2; Is_It := TRUE; The single equal sign is the BOOLEAN operator for equality,and if the two expressions being evaluated are of the same value
Iowa State - COMS - 319
Ada IIISubprogram with Ada.Text_IO; use Ada.Text_IO;procedure Proced1 is procedure Write_A_Line is begin Put(&quot;This is a line of text.&quot;); New_Line; end Write_A_Line; begin Write_A_Line; Write_A_Line; end Proced1;Output - Result of execution-
Iowa State - COMS - 319
A Comparison of Ada and JavaTM as a Foundation Teaching LanguageBenjamin M. Brosgol Ada Core Technologies 79 Tobey Road Belmont, MA 02478 (617) 489-4027 (phone) (617) 489-4009 (FAX) brosgol@gnat.com http:/www.gnat.comIntroductionJava has entered t
Texas State - GEOGRAPHY - 3303
Image Source: BP PressGeography 3321 Energy Resource ManagementEnergy Web Site Review and SummaryPetroleumPrepared for Prof. Mark L. Carter ByNicholas J. PocknallSeptember 20th, 2007Table of Contents Useful Internet Resources for Petrole
Wisconsin - SOC - 131
1DURKHEIMPunishment is primarily concerned with keeping the society held together. Social Solidarity: What holds individuals together in social institutions Two Types of Solidarity: Mechanical and Organic (Society moved from Mech to Org) Mechanica
Wisconsin - COM DIS - 110
CD110 INTRODUCTION TO COMMUNICATIVE DISORDERS Review Lecture for Second Exam November 14, Fall 2007I.Speech Anatomy and PhysiologyA. Respiratory system as power supply, develops relatively constant pressures that will be used to create vocal fo
Wisconsin - COM DIS - 110
CD110 INTRODUCTION TO COMMUNICATIVE DISORDERS Review Lecture for Section on Hearing December 12, FALL 2007I.Acoustics &amp; Psychoacoustics A. Terminology for sound 1. Kinematics: the study of pure motion (vibration of air molecules) 2. Dynamics: the
Wisconsin - SOC - 131
Nietzsche, Durkheim, Foucault, and SpierenbergI. Friedrich Nietzsche (1844-1900) a. German philosopher i. Critical work on religion, culture, morality, and science ii. Famous ideas: 1. God is dead 2. Will to power b. &quot;On the Genealogy of Morals&quot; i.
Wisconsin - PSY - 202
Review Study Guide for Psychology, Exam III Schizophrenia I. Brain Pathology A. Enlarged cerebral ventricles among those with negative symptoms of schizophrenia i. Hollow, fluid-filled cavities in brain ii. Continues to enlarge as the disorder progre
Wisconsin - PSY - 202
Vocabulary Study Guide for Exam II CHAPTER FOUR (pp. 139-195) Developmental Psychology: a branch of psychology that studies physical, cognitive, and social change throughout the life span. Zygote: the fertilized egg; it enters a 2-week period of rapi
Wisconsin - SOC - 131
Theorist DurkheimKey Arguments 1.) Crime is necessary and serves a purpose within society. (Lec.1/29) 2.) Society defines itself by how they punish. (Disc. 2/8) 3.) In order for punishment to restore the collective conscience of a society, it must
Wisconsin - ASTRO - 103
AST 103 Midterm 1 Review Exam is 3/3/08 in class Exam is closed book/closed notes. Formulas will be provided. Bring a No. 2 pencil for the exam and a photo ID. Calculators are OK, but will not be needed. There will be 50 multiple-choice questions. Th
Texas State - GEOGRAPHY - 3303
PetroleumNicholas J. PocknallPetroleum the what and how Petroleum oily, flammable liquid that occurs naturally in deposits, usually beneath the surface of the earth; it is also called crude oil. Consists mostly of hydrocarbons, with traces of
Wisconsin - ASTRO - 103
Wisconsin - ASTRO - 103
Texas State - GEOGRAPHY - 3303
Nicholas James Pocknall 826 Burleson Street Apt. B San Marcos, TX 78666 November 27th, 2007 Representative Rick Hardcastle Capitol Building E2.706 Capitol Building Austin, TX 78768-2910Dear Rick Hardcastle: I am writing you to give my support on th
Wisconsin - ECON - 302
Economics 302 Spring 2008 Answers to Homework #2 Homework will be graded for both content and neatness. This homework does not require the use of Microsoft Excel, but you will find Excel speeds up the calculations greatly in this homework. 1) Conside
University of Texas - FIN - 356
CHAPTER 1 INTRODUCTION TO CORPORATE FINANCEAnswers to Concept Questions 1. The three basic forms are sole proprietorships, partnerships, and corporations. The advantages and disadvantages of sole proprietorships and partnerships are: Disadvantages:
University of Texas - FIN - 356
CHAPTER 2 FINANCIAL STATEMENTS AND CASH FLOWAnswers to Concepts Review and Critical Thinking Questions 1. Liquidity measures how quickly and easily an asset can be converted to cash without significant loss in value. It's desirable for firms to have
University of Texas - FIN - 356
CHAPTER 3 FINANCIAL STATEMENTS ANALYSIS AND LONG-TERM PLANNINGAnswers to Concepts Review and Critical Thinking Questions 1. Time trend analysis gives picture of changes in the company's financial situation over time. Comparing a firm to itself over
University of Texas - FIN - 356
CHAPTER 4 DISCOUNTED CASH FLOW VALUATIONAnswers to Concepts Review and Critical Thinking Questions 1. Assuming positive cash flows and interest rates, the future value increases and the present value decreases. Assuming positive cash flows and inter
University of Texas - FIN - 356
CHAPTER 5 INTEREST RATES AND BOND VALUATIONAnswers to Concepts Review and Critical Thinking Questions 1. No. As interest rates fluctuate, the value of a Treasury security will fluctuate. Long-term Treasury securities have substantial interest rate r
University of Texas - FIN - 356
CHAPTER 6 STOCK VALUATIONAnswers to Concepts Review and Critical Thinking Questions 1. The value of any investment depends on its cash flows; i.e., what investors will actually receive. The cash flows from a share of stock are the dividends. Investo
Wisconsin - ECON - 302
Economics 302 Name _ Spring 2008: Monday/Wednesday Lecture First Midterm Student ID Number _ March 3, 2008 Section Number _This 75 point midterm consists of three parts: a short response section with 5 short response questions worth 5 points each or
Wisconsin - ECON - 302
Economics 302 Spring 2007 Answers to First Midterm February 22, 2007Name _ Student ID Number _ Section Number _This midterm consists of four parts: a binary choice section comprised of 10 questions worth 2 points each; a short response section wi
Texas State - GEOGRAPHY - 3343
Nick Pocknall - GEO 4313 - 10/15/2007Environmental Impact Statement Briefing Project Proposed Action: &quot;Environmental Impact Assessment of Non-governmental activities in Antarctica&quot; Date: April 30th, 1997 Location: Washington, D.C. Primary Activity
Iowa State - CHEM - 178L
CHEMISTRY 178L SAFETY ASSIGNMENT &quot;Salts and Hydrolysis&quot; 1. Ammonium NitrateA) Causes eye irritation. May cause severe irritation and possible burns. Dizziness, drowsiness, headache, breath shortness. May cause nausea, vomiting, and diarrhea, possib
Iowa State - CHEM - 178L
Chem 178L Safety Acids and Bases 1. Hydrochloic AcidA) Causes eye and skin burns. May cause severe respiratory tract irritation with possible burns. May cause severe digestive tract irritation with possible burns. B) Extensive irrigation with water
Iowa State - SOC - 330
-WEDNESDAY FEBRUARY 13TH DAY 13-Beyond Black and White: Remaking Race in America by Lee and Bean -rigid definitions of race no longer apply -in 2050 20% of the population will be multiracial -use of the term mulatto, quadroon for 1 fourth black, octo
Iowa State - SOC - 330
-WEDNESDAY JANUARY 16TH DAY 2-melanin - pigmint in the skin that prevents skin disease vitamin d - comes from fish or sunlight, prevents brittle bones natural selction cultural selection - lighter skin children were favored in northern climates black
Iowa State - CHEM - 178L
Oxalic Acid Eye: May cause severe eye irritation. May result in corneal injury. Skin: Causes skin irritation. Harmful if absorbed through the skin. Rare chemical burns may occur from oxalic acid and may cause hypocalcemia. Gangrene has occurred in th
Wisconsin - CHEM - 103
Net Equations a. Only strong soluble electrolytes are written as ions. i. Seven strong acids: H2SO4 (aq) [sulfuric acid], HNO3 (aq) [nitric acid], HClO3 (aq) [chloric acid], HClO4 (aq) [perchloric acid], HCl (aq) [hydrochloric acid], HBr (aq) [hydrob
Wisconsin - CHEM - 103
Finish Chapter 6 K/T/W. Read &quot;Chemistry of Fuels/Energy Sources&quot; pp. 283-293. Begin Chapter 7. Atomic Structure.Electromagnetic Radiation (Transverse Waves) C = *r where C = 3.0*10^8 m/s a. Entire spectrum b. Visible spectrum c. Traveling waves ver
Wisconsin - NUTRI SCI - 132
Lipids, Lecture 3 Mucosa Chylomicrons Carry lipids from gut to liver; deliver TG to cells. (Lymphatic system joins bloodstream) Dietary lipids end up here -Triglyceride (TG) -Cholesterol (chol) -Phospholipids Liver Lipoproteins A &quot;bubble&quot; lipids can
Wisconsin - SPANISH - 204
Spanish 204 Daz 5 de Octubre, 2007 Ventajas y Desventajas del &quot;Spanglish&quot; &quot;Spanglish,&quot; un trmino que es definido por www.dictionary.com como &quot;espaol hablado con una mezcla grande de plabras de ingls.&quot; El uso de spanglish es mas y mas comn cada da, es
Wisconsin - CS - 252
CS/ECE 252 Introduction to Computer EngineeringSpring 2008 All Sections Instructor David A. WoodHomework 2Problem 1a) Suppose that the total number of students in some class is 224. If each student is assigned a unique bit pattern, what is the
Wisconsin - CS - 252
CS/ECE 252 Introduction to Computer EngineeringSpring 2008 All Sections Instructor David A. WoodHomework 3Problem 1Draw a logic circuit corresponding to the following logic expression. Your circuit must use only 2-input AND, 2-input OR, and NOT
Wisconsin - CS - 252
CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON Prof. David A. Wood TAs Spyros Blanas, Priyananda Shenoy &amp; Shengnan Wang Midterm Examination 1 In Class (50 minutes) Monday, February 18, 20
Wisconsin - CHEM - 104
10-17-07 Discussion 396Lake Study Lab Part IWe have ruled out that the problem is caused by pesticides in the water because the samplings have shown that the levels of these substances are below toxic levels for most fish. The dissolved oxygen lev
Iowa State - SPRT - 101
SPORTS1st Round Memphis 1 TX Arlington 16 Mississippi St. 8 Oregon 9 Michigan St. 5 Temple 12 Pittsburgh 4 Oral Roberts 131st Round1 16 8 9 5 122nd RoundReg. SemisReg. FinalsNat. SemisChampionshipNat. SemisReg. FinalsReg. Semis
Iowa State - CPRE - 281X
IntroductionWhile the processor is the core of the computer, even it has a tendency for failures and errors that will affect that performance dramatically. If the processor cannot handle this failures and errors, no one would want that processor, ev
Iowa State - CPRE - 281X
16 bit Signed Multiplier 282X Lab ProjectBrad SmithIn this project, we were given a layout for a 16 bit signed Multiplier, and were supposed to put it together in both Verilog HDL and Block Schematic format. The Multiplier was to consist of 1 7 bi
Iowa State - CPRE - 281X
Page 1Parallel Instruction Pipeline ProcessorDeveloped by Brad Smith 50% Apurv Kumaria 50%Page 2OverviewThis paper will cover the inspiration, development, and testing of the Parallel Instruction Pipeline Processor that was developed for t
Iowa State - CPRE - 488X
Homework 1 CPRE 488X, Fall 2006 Due: Wednesday, Sept. 6, on WebCT Brad Smith Section-Tuesday 1. [10] Q1-1. Briefly describe the distinction between requirements and specifications.Requirements is what is given to the engineers from the customer, de
Iowa State - CPRE - 488X
Homework 2 CPRE 488X, Embedded Systems Design, Fall 2006 Due: Monday Sept. 18 on WebCT Name: Brad Smith Lab Section: Tuesday 6-9Search the Internet for the answers to questions 1-2. Other questions are from textbook pages 174-176 and 446-447.1. [
Michigan State University - WRA - 150
Jordan 1 Marcia Jordan A39400684 WRA 150Our Town-Thornton WilderWhile reading the selection in Our Town, I noticed a few things. One major thing that grabbed my attention was the way that the stag manager knew of everything in the town. He knew e
Michigan State University - COM - 100
Marcia Jordan A39400684 Com 100, section 004- Lindsay Informative Speech Hi, My name is Marcia Jordan, and I am a second year sophomore here at Michigan State, studying in the field of social Science-Criminal Justice here to inform you all of my hobb
Iowa State - ENG - 250
Allison Manning English 250 December 10th, 2007 Hurricane Katrina-Natural Disaster or Political Screw Up? Hurricane Katrina was a terrible natural disaster that devastated many on the Gulf Coast. It is easy to say that the hurricane is to blame for e
Iowa State - LATIN - 101
The Myth of Pandora The myth of Pandora's Box began with Epimetheus. Epimetheus was a titan and his responsibility was to give a good trait to every creature created. Epimetheus had a brother named Prometheus whose responsibility was to create mankin
Michigan State University - WRA - 150
Jordan 1Marcia Jordan Professor Wood WRA 150, Section 020 21 March 2007 An Analysis of Langston Hughes &quot;Mother to Son&quot; It is fairly easy to identify with a mothers feelings for her child to persist in life toward their dreams and aspirations withou
Iowa State - ENG - 250
Bibliography Weigel, George. &quot;Just War and Iraq Wars.&quot; First Things: A Monthly Journal of Religion &amp; Public Life Apr. 2007: 14-20. EBSCOhost. Iowa State University, Ames, IA. 24 September 2007 &lt; http:/web.ebscohost.com/ehost/pdf?vid=4&amp;hid=106&amp;sid=f32
Iowa State - ENG - 250
Works Cited Fonda, Daren, and Rita Healy. &quot;How Reliable is Brown's Resume?&quot; Time. 8 Sept. 2005. CNN. 5 Dec. 2007 &lt;http:/time.com&gt;. Keating, Sharon. &quot;Hurricane Katrina, One Year Later.&quot; About.Com. 26 Aug. 2006. The New York Times Company. 5 Dec. 2007
Michigan State University - WRA - 150
Jordan 1Marcia Jordan Professor Wood WRA 150, Section 020 21 March 2007 An Analysis Of Langston Hughes &quot;Mother To Son&quot; It is fairly easy to identify with a mothers feelings for her child to persist in life toward his or her dreams and aspirations w
Michigan State University - WRA - 150
Jordan 1Should Sex Change Operations Be Banned? What exactly is a sex change operation? The Oxford Online Reference guide defines sex change as &quot;a change in a person's physical sexual characteristics, typically by surgery and hormone treatment&quot;.(So
Penn State - SOC - 110
Jackie Diaz 09/22/07 SOC 110 Week 4 Essay: First Group of Readings Transsexual is a term that refers to individuals whose gender identity does not correspond to their biological sex. Due to our dual-gendered society where differences in genitalia unq