33 Pages

Chapter 13

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

Word Count: 1671

Document Preview

13 Chapter Graphics Chapter classes Bjarne Stroustrup www.stroustrup.com/Programming Abstract Abstract Chapter 12 demonstrates how to create simple windows and Chapter display basic shapes: square, circle, triangle, and ellipse; It showed how to manipulate such shapes: change colors and line style, add text, etc. line Chapter 13 shows how these shapes and operations are Chapter implemented, and shows a few...

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.
13 Chapter Graphics Chapter classes Bjarne Stroustrup www.stroustrup.com/Programming Abstract Abstract Chapter 12 demonstrates how to create simple windows and Chapter display basic shapes: square, circle, triangle, and ellipse; It showed how to manipulate such shapes: change colors and line style, add text, etc. line Chapter 13 shows how these shapes and operations are Chapter implemented, and shows a few more examples. In Chapter 12, we were basically tool users; here we become tool builders. we Stroustrup/Programming 2 Overview Overview Graphing Model Model Code organization Interface classes Point Line Lines Grid Open Polylines Closed Polylines Color Text Unnamed objects Stroustrup/Programming 3 Display model Display Open_polyline draw() attach() attach() Rectangle draw() window Display Engine draw() Objects (such as graphs) are attached to (placed in) a window. The display engine invokes display commands (such as draw line The from x to y) for the objects in a window from Objects such as Rectangle add vectors of lines to the window to draw Stroustrup/Programming 4 Code organization Code FLTK headers Point.h: struct Point { }; FLTK code Window.h: Graph.h: // Graphing interface: struct Point { }; Gui.h // window interface: class Window {}; Graph.cpp: // GUI interface: struct In_box { }; Window.cpp: Graph code Window code chapter12.cpp: #include "Graph.h" #include "Window.h" int main() { } Stroustrup/Programming GUI.cpp: GUI code 5 Header File that contains code implementing interfaces defined in headers File and/or uses such interfaces and/or #includes headers Read the Graph.h header Graph.h Read File that contains interface information (declarations) #include in user and implementer .cpp (code file / implementation file) Source files Source And later the graph.cpp implementation file And graph.cpp Dont read the Window.h header or the window.cpp Window.h window.cpp Dont implementation file implementation Naturally, some of you will take a peek Beware: heavy use of yet unexplained C++ features Stroustrup/Programming 6 Design note Design The ideal of program design is to represent concepts The directly in code directly We take this ideal very seriously For example: Window a window as we see it on the screen Line a line as you see it in a window on the screen Point a coordinate point Shape whats common to shapes Will look different on different operating systems (not our business) (imperfectly explained for now; all details in Chapter 14) Color as you see it on the screen Stroustrup/Programming 7 Point Point namespace Graph_lib // our graphics interface is in Graph_lib namespace our { struct Point // a Point is simply a pair of ints (the coordinates) struct Point { int x, y; int Point(int xx, int yy) : x(xx), y(yy) { } }; // Note the ';' // ';' } Stroustrup/Programming 8 Line Line struct Shape { // hold lines represented as pairs of points hold // knows how to display lines // knows }; struct Line : Shape // a Line is a Shape defined by just two Points struct is defined { Line(Point p1, Point p2); }; Line::Line(Point p1, Point p2) // construct a line from p1 to p2 // construct { add(p1); // add p1 to this shape (add() is provided by Shape) // add add(p2); // add p2 to this shape // add } Stroustrup/Programming 9 Line example Line // draw two lines: // draw using namespace Graph_lib; Simple_window win(Point(100,100),600,400,"Canvas"); Simple_window Line horizontal(Point(100,100),Point(200,100)); Line Line vertical(Point(150,50),Point(150,150)); // make a window make window // make a horizontal line make // make a vertical line // make win.attach(horizontal); // attach the lines to the window // attach win.attach(vertical); win.wait_for_button(); // Display! // Display! Stroustrup/Programming 10 Line example Line Stroustrup/Programming 11 Line example Line Individual lines are independent horizontal.set_color(Color::red); vertical.set_color(Color::green); Stroustrup/Programming 12 Lines Lines struct Lines : Shape { // a Lines object is a set lines // object // We use Lines when we want to manipulate We // all the lines as one shape, e.g. move them all void add(Point p1, Point p2); // add line from p1 to p2 // add void draw_lines() const; // to be called by Window to draw Lines // to to }; Terminology: Lines is derived from Shape Lines inherit from Shape Lines is a kind of Shape Shape is the base of Lines This is the key to what is called object-oriented programming Well get back to this in Chapter 14 Stroustrup/Programming 13 Lines Example Lines Lines x; x.add(Point(100,100), Point(200,100)); x.add(Point(150,50), Point(150,150)); win.attach(x); win.wait_for_button(); // horizontal line // horizontal // vertical line // vertical // attach Lines x to Window win // attach // Draw! // Draw! Stroustrup/Programming 14 Lines example Lines Looks exactly like the two Lines example Looks Line Stroustrup/Programming 15 Implementation: Lines Implementation: void Lines::add(Point p1, Point p2) { Shape::add(p1); Shape::add(p2); } // use Shapes add() // use void Lines::draw_lines() const // to somehow be called from Shape // to { 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); } Note fl_line is a basic line drawing function from FLTK FLTK is used in the implementation, not in the interface our to classes FLTK implementation not interface We could replace FLTK with another graphics library Stroustrup/Programming 16 Draw Grid Draw (Why bother with Lines when we have Line?) (Why Line // A Lines object may hold many related lines // object // Here we construct a grid: int x_size = win.x_max(); int y_size = win.y_max(); int int x_grid = 80; int int y_grid = 40; Lines grid; for (int x=x_grid; x<x_size; x+=x_grid) // veritcal lines grid.add(Point(x,0),Point(x,y_size)); for (int y = y_grid; y<y_size; y+=y_grid) // horizontal lines // horizontal grid.add(Point(0,y),Point(x_size,y)); win.attach(grid); // attach our grid to our window (note grid is one object win.attach(grid); attach Stroustrup/Programming 17 Grid Grid Stroustrup/Programming 18 Color Color struct Color { // Map FLTK colors and scope them; Map // deal with visibility/transparency enum Color_type { red=FL_RED, blue=FL_BLUE, /* */ }; enum enum Transparency { visible=0, invisible=255 }; Color(Color_type cc) :c(Fl_Color(cc)), v(visible) { } Color(int cc) :c(Fl_Color(cc)), v(visible) { } Color(Color_type cc, Transparency t) :c(Fl_Color(cc)), v(t) { } int as_int() const { return c; } Transparency visibility() { return v; } void set_visibility(Transparency t) { v = t; } private: Fl_Color c; Transparancy v; // visibility (transparency not yet implemented) // visibility }; Stroustrup/Programming 19 Draw red grid Draw grid.set_color(Color::red); Stroustrup/Programming 20 Line_style Line_style struct Line_style { enum Line_style_type { solid=FL_SOLID, dash=FL_DASH, dot=FL_DOT, dashdot=FL_DASHDOT, dashdot=FL_DASHDOT, dashdotdot=FL_DASHDOTDOT, dashdotdot=FL_DASHDOTDOT, }; // ------// ------// - - - // // ....... // // - . - . // // -..-.. // -..-.. Line_style(Line_style_type ss) :s(ss), w(0) { } Line_style(Line_style_type lst, int ww) :s(lst), w(ww) { } Line_style(int ss) :s(ss), w(0) { } int width() const { return w; } int style() const { return s; } private: int s; int w; }; Stroustrup/Programming 21 Example: colored fat dash grid Example: grid.set_style(Line_style(Line_style::dash,2)); Stroustrup/Programming 22 Polylines Polylines struct Open_polyline : Shape { // open sequence of lines // open void add(Point p) { Shape::add(p); } }; struct Closed_polyline : Open_polyline { // closed sequence of lines // closed void draw_lines() const { Open_polyline::draw_lines(); // draw lines (except the closing one) Open_polyline::draw_lines(); draw // draw the closing line: // draw fl_line(point(number_of_points()-1).x, point(number_of_points()-1).y, point(0).x,point(0).y ); } void add(Point p) { Shape::add(p); } }; Stroustrup/Programming 23 Open_polyline Open_polyline Open_polyline opl; opl.add(Point(100,100)); opl.add(Point(150,200)); opl.add(Point(250,250)); opl.add(Point(300,200)); opl.add(Point(300,200)); Stroustrup/Programming 24 24 Closed_polyline Closed_polyline Closed_polyline cpl; cpl.add(Point(100,100)); cpl.add(Point(150,200)); cpl.add(Point(250,250)); cpl.add(Point(300,200)); cpl.add(Point(300,200)); Stroustrup/Programming 25 25 Closed_polyline Closed_polyline cpl.add(Point(100,250)); A Closed_polyline is not a polygon Closed_polyline some closed_polylines look like polygons A Polygon is a Closed_polyline where no lines cross Polygon Closed_polyline A Polygon has a stronger invariant than a Closed_polyline Polygon Closed_polyline Stroustrup/Programming 26 Text Text struct Text : Shape { Text(Point x, const string& s) // x is the bottom left of the first letter Text(Point : lab(s), fnt(fl_font()), // default character font // default fnt_sz(fl_size()) // default character size // default { add(x); } // store x in the Shape part of the Text // store void draw_lines() const; // the usual getter and setter member functions // the private: string lab; // label // label Font fnt; // character font of label // character int fnt_sz; // size of characters // size }; Stroustrup/Programming 27 Add text Add Text t(Point(200,200), "A closed polyline that isnt a polygon"); t.set_color(Color::blue); Stroustrup/Programming 28 Implementation: Text Implementation: void Text::draw_lines() const { fl_draw(lab.c_str(), point(0).x, point(0).y); } // fl_draw() is a basic text drawing function from FLTK // fl_draw() Stroustrup/Programming 29 Color matrix Color Lets draw a color matrix To see some of the colors we have to work with To see how messy two-dimensional addressing can be See Chapter 24 for real matrices To see how to avoid inventing names for hundreds of objects Stroustrup/Programming 30 Color Matrix (16*16) Color Simple_window win20(pt,600,400,"16*16 color matrix"); Vector_ref<Rectangle> vr; // use like vector Vector_ref<Rectangle> use // but imagine that it holds references to objects but for (int i = 0; i<16; ++i) { // i is the horizontal coordinate // is for (int j = 0; j<16; ++j) { // j is the vertical coordinate // is vr.push_back(new Rectangle(Point(i*20,j*20),20,20)); vr[vr.size()-1].set_fill_color(i*16+j); win20.attach(vr[vr.size()-1]); } // new makes an object that you can give to a Vector_ref to hold // to // Vector_ref is built using std::vector, but is not in the standard library Vector_ref std::vector Stroustrup/Programming 31 Color matrix (16*16) Color More examples and graphics classes in the book (chapter 13) Stroustrup/Programming 32 Next lecture Next What is class Shape? Introduction to object-oriented programming Stroustrup/Programming 33
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 14ChapterGraph class designBjarne Stroustrupwww.stroustrup.com/ProgrammingAbstractAbstractWe have discussed classes in previous lecturesHere, we discuss design of classesLibrary design considerationsClass hierarchies (object-oriented pro
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,