×
Log in to StudySoup
Get Full Access to Chemistry: The Central Science - 13 Edition - Chapter 16 - Problem 6e
Join StudySoup for FREE
Get Full Access to Chemistry: The Central Science - 13 Edition - Chapter 16 - Problem 6e

Already have an account? Login here
×
Reset your password

Visualizing ConceptsThe graph given below shows [H+] vs.

Chemistry: The Central Science | 13th Edition | ISBN: 9780321910417 | Authors: Theodore E. Brown; H. Eugene LeMay; Bruce E. Bursten; Catherine Murphy; Patrick Woodward; Matthew E. Stoltzfus ISBN: 9780321910417 77

Solution for problem 6E Chapter 16

Chemistry: The Central Science | 13th Edition

  • Textbook Solutions
  • 2901 Step-by-step solutions solved by professors and subject experts
  • Get 24/7 help from StudySoup virtual teaching assistants
Chemistry: The Central Science | 13th Edition | ISBN: 9780321910417 | Authors: Theodore E. Brown; H. Eugene LeMay; Bruce E. Bursten; Catherine Murphy; Patrick Woodward; Matthew E. Stoltzfus

Chemistry: The Central Science | 13th Edition

4 5 1 392 Reviews
10
1
Problem 6E

Visualizing Concepts

The graph given below shows [H+] vs. concentration for an aqueous solution of an unknown substance.(a) Is the substance a strong acid, a weak acid, a strong base, or a weak base? (b) Based on your answer to (a), can you determine the value of the pH of the solution when the concentration is 0.18 M? (c) Would the line go exactly through the origin of the plot?[Sections]

Step-by-Step Solution:
Step 1 of 3

Continuing chapter 6, GUI Other GUI Components:  Text field – allows user to enter typed input o from the JTextField class o JTextField constructor takes an int parameter for size of the field, based on the # of characters it will fit  Example: field = new JTextField(5); o access the text in the text field field with this method:  field.getText() o text fields call the actionPerformed method from the EventListener class when the user presses the enter key  adding an action listener to field:  field.addActionListener(new FieldListener());  the FieldListener class has to implement ActionListener  the actionPerformed method retrieves the String value of the text in field with field.getText(); o If your String is a number, you can convert the String to an Integer with this method:  Integer.parseInt(StringName);  Check box – a button that can be toggled on or off, which sets or unsets a boolean condition o from the JCheckBox class o the JCheckBox constructor takes a String which labels the check box  Example: JCheckBox box = new JCheckBox(“Checkbox 1”); o multiple check boxes may be used together – they are independent o when a check box changes state, it generates an item event o the ItemListener interface contains 1 method:  itemStateChanged(ItemEvent event) o item listeners listen to the state (checked or unchecked) of check boxes o to find whether a checkbox is selected use this method:  checkboxName.isSelected()  Font class – font objects are defined by name, style (plain, bold or italic) & size o Example setting the font of a label: label.setFont(“Helvetica, Font.PLAIN, 36); where Helvetica is the font name, the font style is plain, and the font size is 36 o styles are represented by integers  text being bold & italic is represented by the integer sum of bold and italic  Radio buttons – used together to create a set of mutually exclusive options (you can only select one) o from the JRadioButton class o unlike check boxes (which are independent), only 1 button may be selected at a time o when another button is pushed, the one that was currently on is toggled off o Creating a new radio button: JRadioButton button1=new JRadioButton(“Option 1”); o to put radio buttons together in the same group, make a button group, then add each button to it:  ButtonGroup group = new ButtonGroup();  group.add(button1);  group.add(button2); o clicking radio buttons produces action events  uses the actionPerformed() method from the ActionListener class o actionPerformed() retrieves the source of the event (which button generated the event)  retrieving the source: Object source=event.getSource();  Sliders – allow user to specify a numeric value within a bounded range o can be horizontal or vertical w/ optional tick marks or labels o from the JSlider class o creating a new JSlider takes 4 parameters:  Example: slider1=new JSlider(JSlider.HORIZONTAL, 0, 250, 10); where horizontal is the orientation, 0 is the minimum slider value, 250 is the maximum & 10 is the initial value o set major tick marks with:  slider1.setMajorTickMarks(int # btw tick marks) o set minor tick marks with  slider1.setMinorTickMarks(int # btw ticks) o to display the tick marks, this method must be called:  slider1.setPaintTicks(true) o to label the tick marks by number, this method must be called:  slider1.setPaintLabels(true); o sliders produce change events, indicating that their value has changed  listeners use the stateChanged() method from the ChangeListener interface  Combo box – allows the user to select one of several options from a drop- down menu o from the JComboBox class o by default, combo boxes are uneditable – the value can only be changed by selecting an option from the dropdown menu  editable combo boxes can be changed by selecting an option from the dropdown menu OR by typing a value in the combo box area o creating a new combo box:  Example: JComboBox combo1=new JComboBox(); o 2 ways to add options to the combo box:  create an array of Strings; pass it to the JComboBox constructor  JComboBox combo1=new JComboBox(ArrayName);  use the addItem method to add items to a combo box that already exists  combo1.addItem(StringName); o combo boxes can contain text or ImgaeIcon objects as options  Timer – manages an activity over time o from the Timer class o has no visual representation on screen o generates an action event at regular intervals o Methods from the Timer class: Timer (int delay, ActionListener listener) Constructor. Creates a timer which generates an action event at regular intervals, specified by the delay (in milliseconds). The event will be handled by the specified action listener void addActionListener(ActionListener Adds action listener to the timer listener) boolean isRunning() returns true if timer is running void setDelay(int delay) sets the timer’s delay void start() starts the timer, causing it to generate action events void stop() stops the timer, causing it to stop generating action events  Tabbed pane – a container that allows users to choose which of several panes is currently visible by clicking on its tab o from the JTabbedPane class o creating a tabbed pane:  Example: JTabbedPane pane=new JTabbedPane(); o Adding a new tab to a tabbed pane:  pane.addTab(“Tab 1”, new JPanel); Layout Managers:  Layout manager – an object that manages every container & determines how the container’s components are arranged visually o determines size & position of every component o manages the size & position when a container is resized or a component is added  Every container has a default layout manager but can be changed o Setting a new layout manager: o containerName.setLayout(new LayoutType());  Flow layout – puts as many components as possible on a row from left to right at their preferred size; moves to the next row as needed o the default layout for JPanels o components are aligned to the center of the container  Border layout – has 5 areas where components can be added: North (top), South (bottom), East (right), West (left), Center o each area may only contain 1 component  unless you add a container such as a JPanel to an area, in which case you can add multiple components to that container o the 4 outer areas are as large as needed to accommodate their components o if no component is added to one of the outer areas, that area does not appear o the center area expands to fill any available space o adding components to a box layout:  add(componentName, BorderLayout.AREA_NAME);  Grid layout – arranges components in a rectangular grid of equally sized cells o one component per cell o creating a new grid layout:  new GridLayout(# of rows, # of columns) o components are added from left to right, top to bottom o size of cells changes to match overall container’s size  Box layout – organizes components in 1 row or in 1 column o setting a box layout:  setLayout (new BoxLayout(this, BoxLayout.Y_AXIS)); //or X-AXIS o creating space between components:  rigid areas – have a fixed area between components which stays constant no matter what the size of the container  add(Box.createRigidArea(new Dimension(xSize, ySize);  vertical glue – where excess space in the container should be organized  add(Box.createVerticalGlue()); //or HorizontalGlue  Containment hierarchies – the way components are grouped into containers, & containers are grouped into other containers o usually 1 primary or top-level container, like a frame or applet  which usually contains other containers, like panels  panels may contain other panels to organize their components o each container can have its own distinct layout manager  design of the containment hierarchy & the layout manager of each container determines the final appearance of a GUI Mouse Events:  Events generated by the user interacting with the mouse  Mouse events – generated by pressing or releasing the mouse button: o mouse pressed – button is pushed down o mouse released – button is released o mouse clicked – button is pushed down & released in the same location o mouse entered – mouse pointer is moved onto a component o mouse exited – mouse pointer is moved off of a component o the listener for mouse events implements the MouseListener interface  which contains void methods for mousePressed, mouseReleased, mousePressed, mouseEntered & mouseExited  when implementing an interface, you have to define all of these methods  but if you’re not using some of them, you can define them as empty methods  Example: public void mouseReleased(MouseEvent event) {}  Mouse motion events – generated by moving the mouse: o mouse moved – the mouse is moved o mouse dragged – mouse is moved while the mouse button is pressed down o the listener for mouse motion events should implement the MouseMotionListener interface, which contains void methods for mouseMoved & mouseDragged  Java coordinate system – origin is in the upper-left corner of a panel o x-coordinates increase to the right o y-coordinates increase downward Continuing chapter 6, GUI Other GUI Components:  Text field – allows user to enter typed input o from the JTextField class o JTextField constructor takes an int parameter for size of the field, based on the # of characters it will fit  Example: field = new JTextField(5); o access the text in the text field field with this method:  field.getText() o text fields call the actionPerformed method from the EventListener class when the user presses the enter key  adding an action listener to field:  field.addActionListener(new FieldListener());  the FieldListener class has to implement ActionListener  the actionPerformed method retrieves the String value of the text in field with field.getText(); o If your String is a number, you can convert the String to an Integer with this method:  Integer.parseInt(StringName);  Check box – a button that can be toggled on or off, which sets or unsets a boolean condition o from the JCheckBox class o the JCheckBox constructor takes a String which labels the check box  Example: JCheckBox box = new JCheckBox(“Checkbox 1”); o multiple check boxes may be used together – they are independent o when a check box changes state, it generates an item event o the ItemListener interface contains 1 method:  itemStateChanged(ItemEvent event) o item listeners listen to the state (checked or unchecked) of check boxes o to find whether a checkbox is selected use this method:  checkboxName.isSelected()  Font class – font objects are defined by name, style (plain, bold or italic) & size o Example setting the font of a label: label.setFont(“Helvetica, Font.PLAIN, 36); where Helvetica is the font name, the font style is plain, and the font size is 36 o styles are represented by integers  text being bold & italic is represented by the integer sum of bold and italic  Radio buttons – used together to create a set of mutually exclusive options (you can only select one) o from the JRadioButton class o unlike check boxes (which are independent), only 1 button may be selected at a time o when another button is pushed, the one that was currently on is toggled off o Creating a new radio button: JRadioButton button1=new JRadioButton(“Option 1”); o to put radio buttons together in the same group, make a button group, then add each button to it:  ButtonGroup group = new ButtonGroup();  group.add(button1);  group.add(button2); o clicking radio buttons produces action events  uses the actionPerformed() method from the ActionListener class o actionPerformed() retrieves the source of the event (which button generated the event)  retrieving the source: Object source=event.getSource();  Sliders – allow user to specify a numeric value within a bounded range o can be horizontal or vertical w/ optional tick marks or labels o from the JSlider class o creating a new JSlider takes 4 parameters:  Example: slider1=new JSlider(JSlider.HORIZONTAL, 0, 250, 10); where horizontal is the orientation, 0 is the minimum slider value, 250 is the maximum & 10 is the initial value o set major tick marks with:  slider1.setMajorTickMarks(int # btw tick marks) o set minor tick marks with  slider1.setMinorTickMarks(int # btw ticks) o to display the tick marks, this method must be called:  slider1.setPaintTicks(true) o to label the tick marks by number, this method must be called:  slider1.setPaintLabels(true); o sliders produce change events, indicating that their value has changed  listeners use the stateChanged() method from the ChangeListener interface  Combo box – allows the user to select one of several options from a drop- down menu o from the JComboBox class o by default, combo boxes are uneditable – the value can only be changed by selecting an option from the dropdown menu  editable combo boxes can be changed by selecting an option from the dropdown menu OR by typing a value in the combo box area o creating a new combo box:  Example: JComboBox combo1=new JComboBox(); o 2 ways to add options to the combo box:  create an array of Strings; pass it to the JComboBox constructor  JComboBox combo1=new JComboBox(ArrayName);  use the addItem method to add items to a combo box that already exists  combo1.addItem(StringName); o combo boxes can contain text or ImgaeIcon objects as options  Timer – manages an activity over time o from the Timer class o has no visual representation on screen o generates an action event at regular intervals o Methods from the Timer class: Timer (int delay, ActionListener listener) Constructor. Creates a timer which generates an action event at regular intervals, specified by the delay (in milliseconds). The event will be handled by the specified action listener void addActionListener(ActionListener Adds action listener to the timer listener) boolean isRunning() returns true if timer is running void setDelay(int delay) sets the timer’s delay void start() starts the timer, causing it to generate action events void stop() stops the timer, causing it to stop generating action events  Tabbed pane – a container that allows users to choose which of several panes is currently visible by clicking on its tab o from the JTabbedPane class o creating a tabbed pane:  Example: JTabbedPane pane=new JTabbedPane(); o Adding a new tab to a tabbed pane:  pane.addTab(“Tab 1”, new JPanel); Layout Managers:  Layout manager – an object that manages every container & determines how the container’s components are arranged visually o determines size & position of every component o manages the size & position when a container is resized or a component is added  Every container has a default layout manager but can be changed o Setting a new layout manager: o containerName.setLayout(new LayoutType());  Flow layout – puts as many components as possible on a row from left to right at their preferred size; moves to the next row as needed o the default layout for JPanels o components are aligned to the center of the container  Border layout – has 5 areas where components can be added: North (top), South (bottom), East (right), West (left), Center o each area may only contain 1 component  unless you add a container such as a JPanel to an area, in which case you can add multiple components to that container o the 4 outer areas are as large as needed to accommodate their components o if no component is added to one of the outer areas, that area does not appear o the center area expands to fill any available space o adding components to a box layout:  add(componentName, BorderLayout.AREA_NAME);  Grid layout – arranges components in a rectangular grid of equally sized cells o one component per cell o creating a new grid layout:  new GridLayout(# of rows, # of columns) o components are added from left to right, top to bottom o size of cells changes to match overall container’s size  Box layout – organizes components in 1 row or in 1 column o setting a box layout:  setLayout (new BoxLayout(this, BoxLayout.Y_AXIS)); //or X-AXIS o creating space between components:  rigid areas – have a fixed area between components which stays constant no matter what the size of the container  add(Box.createRigidArea(new Dimension(xSize, ySize);  vertical glue – where excess space in the container should be organized  add(Box.createVerticalGlue()); //or HorizontalGlue  Containment hierarchies – the way components are grouped into containers, & containers are grouped into other containers o usually 1 primary or top-level container, like a frame or applet  which usually contains other containers, like panels  panels may contain other panels to organize their components o each container can have its own distinct layout manager  design of the containment hierarchy & the layout manager of each container determines the final appearance of a GUI Mouse Events:  Events generated by the user interacting with the mouse  Mouse events – generated by pressing or releasing the mouse button: o mouse pressed – button is pushed down o mouse released – button is released o mouse clicked – button is pushed down & released in the same location o mouse entered – mouse pointer is moved onto a component o mouse exited – mouse pointer is moved off of a component o the listener for mouse events implements the MouseListener interface  which contains void methods for mousePressed, mouseReleased, mousePressed, mouseEntered & mouseExited  when implementing an interface, you have to define all of these methods  but if you’re not using some of them, you can define them as empty methods  Example: public void mouseReleased(MouseEvent event) {}  Mouse motion events – generated by moving the mouse: o mouse moved – the mouse is moved o mouse dragged – mouse is moved while the mouse button is pressed down o the listener for mouse motion events should implement the MouseMotionListener interface, which contains void methods for mouseMoved & mouseDragged  Java coordinate system – origin is in the upper-left corner of a panel o x-coordinates increase to the right o y-coordinates increase downward

Step 2 of 3

Chapter 16, Problem 6E is Solved
Step 3 of 3

Textbook: Chemistry: The Central Science
Edition: 13
Author: Theodore E. Brown; H. Eugene LeMay; Bruce E. Bursten; Catherine Murphy; Patrick Woodward; Matthew E. Stoltzfus
ISBN: 9780321910417

Other solutions

People also purchased

Related chapters

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

Visualizing ConceptsThe graph given below shows [H+] vs.