26 Pages

Chapter 14

Course: CSCE 121, Fall 2009
School: Texas A&M
Rating:
 
 
 
 
 

Word Count: 1760

Document Preview

14 Chapter Graph Chapter class design Bjarne Stroustrup www.stroustrup.com/Programming Abstract Abstract We have discussed classes in previous lectures Here, we discuss design of classes Library design considerations Class hierarchies (object-oriented programming) Data hiding Data Stroustrup/Programming 2 Ideals Ideals Our ideal of program design is to represent the Our concepts of the application...

Register Now

Unformatted Document Excerpt

Coursehero >> Texas >> Texas A&M >> CSCE 121

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.
14 Chapter Graph Chapter class design Bjarne Stroustrup www.stroustrup.com/Programming Abstract Abstract We have discussed classes in previous lectures Here, we discuss design of classes Library design considerations Class hierarchies (object-oriented programming) Data hiding Data Stroustrup/Programming 2 Ideals Ideals Our ideal of program design is to represent the Our concepts of the application domain directly in code. If you understand the application domain, you understand the code, and vice versa. For example: vice Window a window as presented by the operating system Line a line as you see it on the screen Point a coordinate point Color as you see it on the screen Shape whats common for all shapes in our Graph/GUI view of the world of The last example, Shape, is different from the rest The Shape is in that it is a generalization. in You cant make an object thats just a Shape Stroustrup/Programming 3 Logically identical operations have the same name same For every class, draw_lines() does the drawing move(dx,dy) does the moving s.add(x) adds some x (e.g., a point) to a shape s. point) For every property x of a Shape, For x() gives its current value and set_x() gives it a new value e.g., Color c = s.color(); s.set_color(Color::blue); Stroustrup/Programming 4 Logically different operations have Logically different names Lines ln; Point p1(100,200); Point p2(200,300); ln.add(p1,p2); win.attach(ln); Why not win.add(ln)? Why win.add(ln) p1: p2: // add points to ln (make copies) // add // attach ln to window // attach add() copies information; attach() just creates a reference attach() we can change a displayed object after attaching it, but not after adding it attach() (100,200) win: ln: &ln (200,300) add() (100,200) (200,300) Stroustrup/Programming 5 Expose uniformly Expose Data should be private Data hiding so it will not be changed inadvertently Use private data, and pairs of public access functions to get and set the Use data data c.set_radius(12); // set radius to 12 // set c.set_radius(c.radius()*2); // double the radius (fine) // double c.set_radius(-9); // set_radius() could check for negative, // set_radius() // but doesnt yet double r = c.radius(); // returns value of radius double // returns c.radius = -9; // error: radius is a function (good!) // error: c.r = -9; // error: radius is private (good!) // error: Our functions can be private or public Public for interface Private for functions used only internally to a class Stroustrup/Programming 6 What does private/protected buy us? What We can change our implementation after release We dont expose FLTK types used in representation to our users We could provide checking in access functions E.g., s.add(x) rather than s.points.push_back(x) E.g., s.add(x) s.points.push_back(x) We enforce immutability of shape But we havent done so systematically (later?) Functional interfaces can be nicer to read and use We could replace FLTK with another library without affecting user code Only color and style change; not the relative position of points const member functions The value of this encapsulation varies with application domains Is often most valuable Is the ideal i.e., hide representation unless you have a good reason not to Stroustrup/Programming 7 Regular interfaces Line ln(Point(100,200),Point(300,400)); Mark m(Point(100,200), 'x'); // display a single point as an 'x' // display Circle c(Point(200,200),250); // Alternative (not supported): Alternative Line ln2(x1, y1, x2, y2); // from (x1,y1) to (x2,y2) // from // How about? (not supported): How Square s1(Point(100,200),200,300); // width==200 height==300 width==200 Square s2(Point(100,200),Point(200,300)); // width==100 height==100 // width==100 Square s3(100,200,200,300); // is 200,300 a point or a width plus a height? Square is Stroustrup/Programming 8 A library library A collection of classes and functions meant to be used collection together together A good library models some aspect of a domain good As building blocks for applications To build more such building blocks It doesnt try to do everything Our library aims at simplicity and small size for graphing data and for Our very simple GUI We cant define each library class and function in isolation A good library exhibits a uniform style (regularity) Stroustrup/Programming 9 Class Shape Class All our shapes are based on the Shape class E.g., a Polygon is a kind of Shape E.g., Polygon Shape Shape Circle Text Ellipse Line Open_polyline Image Axis Lines Marked_polyline Closed_polyline Function Rectangle Marks Polygon Mark Stroustrup/Programming 10 Class Shape is abstract is You cant make a plain Shape protected: Shape(); // protected to make class Shape abstract // protected For example Shape ss; // error: cannot construct Shape error: Protected means can only be used from a derived class Instead, we use Shape as a base class struct Circle : Shape { // // }; }; // a Circle is a Shape // a Stroustrup/Programming 11 11 Class Shape Class Shape ties our graphics objects to the screen Shape is the class that deals with color and style Window knows about Shapes Shape All our graphics objects are kinds of Shapes All Shape It has Color and Line_style members It Color Line_style Shape can hold Points Point Shape has a basic notion of how to draw lines It just connects its Points It Point Stroustrup/Programming 12 Class Shape Class Shape deals with color and style It keeps its data private and provides access functions void set_color(Color col); int color() const; void set_style(Line_style sty); Line_style style() const; // // private: // // Color line_color; Line_style Shape Class Shape ls; Stroustrup/Programming 13 Class stores Points Point It keeps its data private and provides access functions Point point(int i) const; // read-only access to points // read-only int number_of_points() const; // // protected: void add(Point p); // add p to points void // add // private: vector<Point> points; // not used by all shapes // not Stroustrup/Programming 14 Class Shape Class Shape itself can access points directly: void Shape::draw_lines() const // draw connecting lines // draw { if (color().visible() && 1<points.size()) for (int i=1; i<points.size(); ++i) fl_line(points[i-1].x,points[i-1].y,points[i].x,points[i].y); } Others (incl. derived classes) use point() and number_of_points() point() number_of_points() Others why? void Lines::draw_lines() const // draw a line for each pair of points // draw { for (int i=1; i<number_of_points(); i+=2) fl_line(point(i-1).x, point(i-1).y, point(i).x, point(i).y); } Stroustrup/Programming 15 Class Shape (basic idea of drawing) (basic void Shape::draw() const // The real heart of class Shape (and of our graphics interface system) The // called by Window (only) called { // save old color and style // save // set color and style for this shape // set // draw what is specific for this particular shape // Note: this varies dramatically depending on the type of shape // e.g. Text, Circle, Closed_polyline // reset the color and style to their old values // reset } Stroustrup/Programming 16 Class Shape (implementation of drawing) (implementation void Shape::draw() const // The real heart of class Shape (and of our graphics interface system) The // called by Window (only) called { Fl_Color oldc = fl_color(); // save old color // save // there is no good portable way of retrieving the current style (sigh!) // there fl_color(line_color.as_int()); // set color and style // set fl_line_style(ls.style(),ls.width()); Note! draw_lines(); // call the appropriate draw_lines() // // a virtual call // virtual // here is what is specific for a derived class is done fl_color(oldc); fl_line_style(0); fl_line_style(0); // reset color to previous // // (re)set style to default // (re)set } Stroustrup/Programming 17 Class shape Class In class Shape In Shape virtual void draw_lines() const; virtual // draw the appropriate lines draw In class Circle In Circle void draw_lines() const { /* draw the Circle */ } void draw In class Text In Text void draw_lines() const { /* draw the Text */ } void */ Circle, Text, and other classes Text Derive from Shape Derive Shape May override draw_lines() May draw_lines() Stroustrup/Programming 18 class Shape { // deals with color and style, and holds a sequence of lines class // deals public: public: void draw() const; // deal with color and call draw_lines() // deal virtual void move(int dx, int dy); // move the shape +=dx and +=dy virtual move void set_color(Color col); // color access // color int color() const; // style and fill_color access functions // style Point point(int i) const; // (read-only) access to points // access int number_of_points() const; protected: Shape(); // protected to make class Shape abstract // protected void add(Point p); // add p to points // add virtual void draw_lines() const; // simply draw the appropriate lines simply private: vector<Point> points; // not used by all shapes // not Color lcolor; // line color // line Line_style ls; // line style // line Color fcolor; // fill color // fill // prevent copying }; Stroustrup/Programming 19 Display model completed Display draw_lines() Shape draw() Circle draw_lines() draw() Display Engine Window draw_lines() Shape draw() attach() wait_for_button() Text draw_lines() our code make objects Stroustrup/Programming 20 Language mechanisms Language Most popular definition of object-oriented programming: Most OOP == inheritance + polymorphism + encapsulation OOP Base and derived classes struct Circle : Shape { }; Also called inheritance Virtual functions // polymorphism // polymorphism virtual void draw_lines() const; Also called run-time polymorphism or dynamic dispatch Private and protected // inheritance // inheritance // encapsulation // encapsulation protected: Shape(); private: vector<Point> points; Stroustrup/Programming 21 A simple class hierarchy simple We chose to use a simple (and mostly shallow) class hierarchy Based on Shape Shape Circle Text Ellipse Line Open_polyline Image Axis Lines Marked_polyline Closed_polyline Function Rectangle Marks Polygon Mark Stroustrup/Programming 22 Object layout Object The data members of a derived class are simply added at The the end of its base class (a Circle is a Shape with a radius) the Shape: Circle: points line_color ls points line_color ls ---------------------r Stroustrup/Programming Stroustrup/Programming 23 Benefits of inheritance Benefits Interface inheritance A function expecting a shape (a Shape&) can accept function Shape& can any object of a class derived from Shape. any Simplifies use We can add classes derived from Shape to a program We without rewriting user code without sometimes dramatically Adding without touching old code is one of the holy grails Adding of programming of Implementation inheritance Simplifies implementation of derived classes Common functionality can be provided in one place Changes can be done in one place and have universal effect Another holy grail Stroustrup/Programming 24 Access model Access A member (data, function, or type member) or a base can be Private, protected, or public Stroustrup/Programming 25 Next lecture Next Graphing functions and data Stroustrup/Programming 26
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:

Texas A&M - CSCE - 121
Chapter 15ChapterFunctions and graphingBjarne StroustrupBjarnewww.stroustrup.com/Programmingwww.stroustrup.com/ProgrammingAbstractAbstractHere we present ways of graphing functionsHereand data and some of the programmingtechniques needed to do
Texas A&M - CSCE - 121
Chapter 16ChapterGraphical User InterfacesBjarne Stroustrupwww.stroustrup.com/ProgrammingOverviewOverviewPerspectiveI/O alternativesGUILayers of softwareGUI exampleGUI codecallbacksStroustrup/Programming2I/O alternativesI/OUse console in
Texas A&M - CSCE - 121
Chapter 17Chaptervector and Free StoreBjarne StroustrupBjarnewww.stroustrup.com/Programmingwww.stroustrup.com/ProgrammingAbstractAbstractVector is not just the most useful standard container,Vectorit is also provides examples of some of the mos
Texas A&M - CSCE - 121
Chapter 18ChapterVectors and ArraysBjarne StroustrupBjarnewww.stroustrup.com/Programmingwww.stroustrup.com/ProgrammingAbstractAbstractarrays, pointers, copy semantics, elementsarrays,access, referencesaccess,Next lecture: parameterization of
Texas A&M - CSCE - 121
Chapter 19ChapterVectors, templates, and exceptionsBjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis is the third of the lectures exploring theThisdesign of the standard library vector and thetechniques and language features us
Texas A&M - CSCE - 121
Chapter 20The STLThe(containers, iterators, and algorithms)Bjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis lecture and the next present the STL theThiscontainers and algorithms part of the C+ standardlibrarylibraryThe STL
Texas A&M - CSCE - 121
Chapter 21ChapterThe STL(maps and algorithms)Bjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis talk presents the idea of STL algorithms andThisintroduces map as an example of a container.introducesStroustrup/Programming2Ove
Texas A&M - CSCE - 121
Software ideals and historySoftwareBjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis is a very brief and very selective history ofThissoftware as it relates to programming, and especiallyas it relates to programming languages an
Texas A&M - CSCE - 121
Chapter 23ChapterText ProcessingBjarne Stroustrupwww.stroustrup.com/ProgrammingStroustrup/Programming1OverviewOverviewApplication domainsStringsI/OMapsRegular expressionsStroustrup/Programming2Now you know the basicsNowReally! Congratula
Texas A&M - CSCE - 121
Chapter 24ChapterNumericsBjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis lecture is an overview of the fundamentalThistools and techniques for numeric computation.For some, numerics are everything. For many,numerics are occa
Texas A&M - CSCE - 121
Chapter 25ChapterEmbedded systems programmingBjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis lecture provides a brief overview of whatThisdistinguishes embedded systems programmingfrom ordinary programming. It then touchesup
Texas A&M - CSCE - 121
Chapter 26ChapterTestingBjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractThis lecture is an introduction to the design andThistesting of program units (such as functions andclasses) for correctness. We discuss the use ofinterfaces
Texas A&M - CSCE - 121
Chapter 27ChapterThe C Programming LanguageBjarne Stroustrupwww.stroustrup.com/ProgrammingDennis M. RitchieAbstractAbstractThis lecture gives you the briefest introduction to CThisfrom a C+ point of view. If you need to use thislanguage, read a
Texas A&M - CSCE - 121
Ch 1 2 Programming and &quot;Hello, World!&quot;Ch 3 Objects, Types, and ValuesCh 4 ComputationCh 5 ErrorsCh 6 Writing a programCh 7 Completing a programCh 8 Technicalities: Functions, etc.Ch 9 Technicalities: Classes, etc.Ch 10 Input/Output StreamsCh 11 C
Texas A&M - CHEM - 101
EXAM ISample Exam 1-1Dr. V. WilliamsonFORM D is EXAM I, VERSION 1 (v1)1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; therefore, be sure to use a No. 1 or 2 pencilfor m
Texas A&M - CHEM - 101
EXAM ISample Exam 1-1Dr. V. Williamson1. What is the % by weight (mass percent) of Cl in CH2Cl2?A. 16.5B. 83.5C. 41.8D. 19.8E. 94.12. Which of the following transitions in the Bohr hydrogen atommodel gives an emission of the shortest wavelength?
Texas A&M - CHEM - 101
EXAM ISample Exam 1-1Dr. V. Williamson8. Which of the following are FALSE in whole or in Part?I.According to Dalton, who was the first person to describeatoms, atoms are only rearranged in chemical reactions.II. According to Bohr, the electrons mov
Texas A&M - CHEM - 101
EXAM ISample Exam 1-1Dr. V. Williamson15. Mark each of the following as true or false. Which of thefollowing is FALSE?A.B.C.D.E.A row could also be called a period.Column U contains mostly metalsColumn S is the alkali metals.Column Y is the h
Texas A&M - CHEM - 101
EXAM ISample Exam 1-156789101112131415161718Dr. V. WilliamsonACEB (A,D,E=3pts)A (B=3pts)EDACDCA (D=3pts)A6.5 ptsA Vickie M. Williamson 2007, All Rights Reserved4
Texas A&M - CHEM - 101
EXAM ISample Exam 1-2Dr. V. WilliamsonFORM A is EXAM I, VERSION 2 (v2)1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; therefore, be sure to use a No. 1 or 2 pencilfor m
Texas A&M - CHEM - 101
EXAM ISample Exam 1-2Dr. V. Williamson1. Calculate the formula weight (molar mass) of (NH4)2S406.A. 356B. 242C. 260D. 288E. 632. How many grams of oxygen atoms are in 65 g of C2H2O2A. 22B. 36C. 11D. 18E. 723. The ionization energy is higher
Texas A&M - CHEM - 101
EXAM ISample Exam 1-2Dr. V. Williamson9. How many significant figures should there be in the answer tothe following problem?A.2(29.2 20.0) (1.79 x 105)1.39B.3C.1D.5E.410. Which of the following is (are) FALSE?I. Dalton was NOT the first perso
Texas A&M - CHEM - 101
EXAM ISample Exam 1-2Dr. V. Williamson15. What is the Fahrenheit temperature that corresponds to 0 K?A. 549FB. 523FC. 434FD. 459FE. 120F16. A compound containing only carbon, hydrogen, and oxygen isanalyzed and found to be 70.6% carbon, 5.9% hyd
Texas A&M - CHEM - 101
EXAM II1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.Sample Exam 2-1Dr. V. WilliamsonFORM is EXAM II VERSION 1 (v1)DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; therefore, be sure to use a No. 1 or 2 pencil forma
Texas A&M - CHEM - 101
EXAM IISample Exam 2-1Dr. V. Williamson1. Calculate the percent yield if 0.75 mol of calcium metal is treated with excess HCl and yields1.4 g of hydrogen gas in the laboratory.The UNBALANCED reaction equation is: Ca + HCl H2 + CaC12Atomic Molar Mass
Texas A&M - CHEM - 101
EXAM IISample Exam 2-1Dr. V. Williamson6. Which statement about the following reaction is INCORRECT?Zn(s) + 2HI(aq) ZnI2(aq) + H2(g)A. The oxidation number of the Zn ion in ZnI2 is 2+.B. The H in HI is the reducing agent.C. The oxidation number of
Texas A&M - CHEM - 101
EXAM IISample Exam 2-1Dr. V. Williamson11. How many grams of CH3OH would have to be added to water to prepare 150 mL of asolution that is 2.0 M CH3OH?Atomic Molar MassesH = 1.0 g/molC = 12.0 g/molO = 16.0 g/molA. 4.3 X 102B. 0.300C. 2.4D. 9.6
Texas A&M - CHEM - 101
EXAM IISample Exam 2-1Dr. V. WilliamsonKeyquestion6pts each(unless noted)1A (B=3 pts)2B3C4A5D6B7D (B=3 pts)8B9B10A (E=3 pts)11E (B=3 pts)12D13C14B = 4 pts15A16A17A Vickie M. Williamson 2007, All Rights Reserved
Texas A&M - CHEM - 101
EXAM II1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.Sample Exam 2-2Dr. V. WilliamsonFORM is EXAM II VERSION 2 (v2)DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; therefore, be sure to use a No. 1 or 2 pencil forma
Texas A&M - CHEM - 101
EXAM IISample Exam 2-2Dr. V. Williamson1. What is the maximum number of grams of Cu that could be produced by the reaction of30.0 g of CuO and 20.0 g of CH4?4CuO + CH4 2H20 + 4Cu + CO2A. 318B. 95.9C. 80.0D. 24.0F. 6.002. Which is the correct fo
Texas A&M - CHEM - 101
EXAM IISample Exam 2-2Dr. V. Williamson8. Which of the following pairs will result in a reaction when 0.1 M aqueous solutions of eachare mixed?A. KOH and NaNO3B. K2SO4 and CrCl3C. Li2CO3 and MgI2D. NiSO4 and CsNO3E. none of these pairs react9. W
Texas A&M - CHEM - 101
EXAM IISample Exam 2-2Dr. V. Williamson3-14. What is the oxidation number of Co in CoCl6 ?A. +6B. -6C. +8D. -3E. +315. Based on the relative reactivities table or activity series provided, which reaction below willoccur?A. 2AgNO3(aq) + Pb(s) 2
Texas A&M - CHEM - 101
EXAM IISample Exam 2-2question1234567891011121314151617Dr. V. WilliamsonKey6pts each(unless noted)D (A=3 pts)DAC (B=3 pts)BE (A=3 pts)BCBECAEEAC= 4 ptsE Vickie M. Williamson 2007, All Rights Reserved
Texas A&M - CHEM - 101
Sample Exam 3-1Dr. V. WilliamsonFORM E is EXAM III, VERSION 1 (v1)1.2.3.4.5.6.7.8.9.10.11.12.13.DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; the refore, be sure to use a No. 1 or 2 pe ncil formarking the
Texas A&M - CHEM - 101
Sample Exam 3-1Dr. V. Williamson1. The ground state electron configuration for Zn is1112A. [Ar]4s 3d2 10D. [Kr]4s 3d101B. [Ar]3s 3d2 10E. [Ar]4s 3d101C. [Ar]4s 3d 4p2. Which one of the following is the electron configuration for the S22
Texas A&M - CHEM - 101
Sample Exam 3-1Dr. V. Williamson8. The Lewis electron-dot structure of HCN (H bonded to C)A. gives N 2 nonbonding (unshared) electron pairsB. gives N 1 nonbonding (unshared) electron pairC. gives C 2 nonbonding (unshared) electron pairsD. gives H 1
Texas A&M - CHEM - 101
Sample Exam 3-1Dr. V. Williamson14. Which one of the following represents a correct set of quantum numbers for an electron in anatom? (arranged as n, 1, m1, and ms)A. 1,0,0,1/2B. 5,4,-5,1/2C. 2,2,-1,-l/2D. 3,3,3,1/2E. 2,0,0,13215. The molecule Z
Texas A&M - CHEM - 101
Sample Exam 3-1Dr. V. Williamson18. What is the shape around the carbon atom labeled 8 AND the shape around the oxygen that isbetween the C and H, respectively?HO8NCCOHHHCHHHA. triangular plane,linearD. t-shaped,linearB. triangular p
Texas A&M - CHEM - 101
Sample Exam 3-2Dr. V. WilliamsonFORM D is EXAM III, VERSION 1 (v1)1.2.3.4.5.6.7.8.9.10.11.12.13.DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; the refore, be sure to use a No. 1 or 2 pe ncil formarking the
Texas A&M - CHEM - 101
Sample Exam 3-2Dr. V. Williamson1. Which sketch(es) could represent a p orbital?A. 4 &amp; 5B. 2 &amp; 3C.l, 4, &amp; 5D. 2, 3, &amp; 4E. 1 only2. Which of the following is FALSE?A. The Wave Mechanical Model of the atom allows one to calculate the probability of
Texas A&M - CHEM - 101
Sample Exam 3-2Dr. V. WilliamsonC. S, because it is the smallest and has a more complete main electron shell.D. Mg, because it is the smallest metal and will not accept an electron easily.E. S, because it is the largest nonmetal and will lose an elect
Texas A&M - CHEM - 101
Sample Exam 3-2Dr. V. Williamson11. The approximate FXeF bond angle between 2 adjacent F in XeF4 isA. 180B. 120C. 109D. 90E. 160-12. What is the formal charge on the I atom in the IO3 ion?A. -3B. +4C. 0D. -lE. +213. Which one of the followi
Texas A&M - CHEM - 101
Sample Exam 3-2Dr. V. Williamson15. There are _ and _ bonds, respectively, inA. 11 and 2B. 13 and 4C. 13 and 0D. 11 and 4E. 13 and 2316. The molecule ZF4 has 1 lone pair of electrons and sp d hybridization. What would youpredict about the polari
Texas A&M - CHEM - 101
Sample Exam 4-1Dr. V. WilliamsonFORM E is EXAM IV, VERSION 1 (v1)1.2.3.4.5.6.7.8.9.10.11.12.13.DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; the refore, be sure to use a No. 1 or 2 pe ncil formarking the a
Texas A&M - CHEM - 101
Sample Exam 4-1Dr. V. Williamson1. Which solid is incorrectly identified by its bonding type?A. CoCl2, ionicD. H2Se, ionicB. Y, metallicE. I2, molecularC. XeF2, molecular2. What is the pressure in atm of 6.022 g CH4 in a 30.0 L vessel at 129C?A.
Texas A&M - CHEM - 101
Sample Exam 4-1Dr. V. Williamson6. According to the kinetic-molecular theory,A. Gas molecules lose small amounts of energy as they collide.B. The pressure exerted on a gas affects the speed of its molecules.C. Gas molecules have rapid straight-line m
Texas A&M - CHEM - 101
Sample Exam 4-1Dr. V. Williamson10. Increasing the amount of liquid in a closed container will cause the vapor pressure of theliquid to:A. depends on the liquidC. remain the sameB. increaseD. decrease11. You need to heat a reaction to 108.0C in a
Texas A&M - CHEM - 101
Sample Exam 4-1Dr. V. Williamson15. The value of H for the following reaction is -186 kJ. How many kJ of heat would beevolved from the reaction of 25 g of Cl2?2HCl(g)H 2 ( g ) + C l2 ( g )B. 5.3 x 102A. 65C. 131D. 47E. 18616. A gas has a volume
Texas A&M - CHEM - 101
Sample Exam 4-1Dr. V. Williamsono20.Substance|!Hf(kJ/mol)_IF(g)IF5(g)IF7(g)-95-840-941What is the value of H for the following reaction?I F7 ( g )I F 5 ( g ) + F2 ( g )A. 1801 kJD. -101 kJB. -1801 kJE. more data is neededC. 101 kJ21
Texas A&M - CHEM - 101
Sample Exam 4-1question12345678910111213141516171819202122Dr. V. WilliamsonKey5.5 pts each (unless noted)DBACCCBBECD (B,E= 2.5 pts)ECDA (C=3pt)AC (D = 4pts)DEDDC (B =3pts) Vickie M. Williamson 2007, All Rig
Texas A&M - CHEM - 101
Sample Exam 4-2Dr. V. WilliamsonFORM E is EXAM IV, VERSION 1 (v1)1.2.3.4.5.6.7.8.9.10.11.12.13.DO NOT TURN THIS PAGE UNTIL DIRECTED TO DO SO.These tests are machine graded; the refore, be sure to use a No. 1 or 2 pe ncil formarking the a
Texas A&M - CHEM - 101
Sample Exam 4-2Dr. V. Williamson1. Which solid is incorrectly identified by its bonding type (ionic , molecular, network, metallic)?A. H2Se, molecularB. KCl,ionicC. Au, molecularD. CO2, molecularE. C (diamond),network2. Determine the molecular wei
Texas A&M - CHEM - 101
Sample Exam 4-2Dr. V. Williamson8. Which of the following gases are at the same temperature and pressure? All the containers arenon-rigid and have the same volume.A. N2 and NeD. N2 and H2OB. CO2 and NeE. N2 and CO2C. H2O and Ne9. In which phase d
Texas A&M - CHEM - 101
Sample Exam 4-2Dr. V. Williamson12. One proposal for energy sources involves collecting steam from volcanic vents andharnessing the energy given off when the steam condenses to liquid water. Calculate the energygiven off when 10.0 grams of steam at 10
Texas A&M - CHEM - 101
Sample Exam 4-2Dr. V. Williamson17. The following reactions occur for the hypothetical element E:2 E ( 1 ) + O2 ( g )2EO(g)! H = -333 kJE O ( g ) + O2 ( g )E O3 ( s )! H = -196 kJWhat is H in kJ for the reaction2 E ( l ) + 3 02 ( g )A. -137B.
Texas A&M - CHEM - 101
Sample Exam 4-2Dr. V. Williamson22. Using the table of average bond energies below, what is the best estimate of H in kJ for:H-C=C-H(g) + 2H-I(g) -&gt; H2IC-CIH2(g)Bond: C=CEnergy in kJ/mol: 835A. +160B. -63question12345678910111213141
South Carolina - ACCT - 222
ACCT 222 Exam 1 ReviewOrganizations, their responsibilities, etc.FASB: Financial Accounting Standards BoardPrivately funded organization with the primary authority for establishing accountingstandards in the United States.AICPA: American Institute of
South Carolina - MSCI - 575
EXAM 1 QUESTIONS The three major branches on the General Phylogenetic Tree are Eukarya, Bacteria, and_.o Archea Almost _% of marine species went extinct during the K-T Mass Extinction Event 64million years ago.o 11 _ prevents taxa from evolving loc
Tallahassee Community College - ENGL - 1102
Kathryn BeddowENC 1102-CrombieRogerian PaperDecember 9, 2011The American DreamImmigration into the United States can bring joy to many, yet some people feel as thoughit is eliminating opportunities for those who are already citizens. People long for
Tallahassee Community College - ENGL - 1102
Kathryn BeddowENC 1102-CrombieEXP4December 5, 2011Violence in Animal RightsAlex Epstein and Yaron Brook worked side by side to write The Evil of AnimalRights in an attempt to bring about a compromise on using small animals, primarily rats andmice,
Tallahassee Community College - ENGL - 1102
Kathryn BeddowNovember 19, 2011ENC 1102 CrombieEXP3Fallacy, Fallacy, Oh the FallacyIn Max Shulmans story Love is a Fallacy, he uses a relatable situationlove amongcollege studentsto illustrate various fallacies that are often used in everyday life.