SlideShare a Scribd company logo
CS 107 – Introduction to Computing and Programming – Spring
2013
Homework Assignment 7 ( Draft 3.0 - Hopefully Final )
Fun with Linked Lists
Due: Monday 29 April at 8:00 A.M. Optional hard copy may be
turned in to TA during lab.
Overall Assignment
For this assignment, you are to write a program that reads in
sentences character-by-character,
creates a linked list out of the character stream, and then
performs various operations on the
resulting list(s).
Node Structure
The linked list node that you create for this assignment shall be
named “node”, and shall have at a
minimum the following fields:
struct node {
char c;
int sequence, totalSequence;
struct node * next;
};
where:
ad in from the keyboard.
sentence, starting from 1. I.e. the
first character in the sentence will have sequence 1, the second
2, etc.
e numbers
are since the program started. So
for example, if the first sentence read contains 20 characters, (
not counting the newline
character ), then the first character of the second sentence
would have a sequence number of 1,
but a totalSequence number of 21.
Program Operation
After reporting your name and explaining to the user what the
program does, your program should do
the following:
1. Ask the user to enter a sentence.
2. Read the characters one-by-one, until the newline character (
‘n’ ) is read in.
For each character read in:
A. Create a new node, using dynamic allocation ( malloc ), and
fill in the node fields.
B. Add the node to the beginning of a linked list for this
sentence.
3. Once the sentence is stored in a linked list, give the user a
list of operations supported, ( see
below ) and allow them to choose which one(s) to perform.
Based upon their choice, use a
switch to perform the operation requested and print out the
results.
4. Two choices on the list must be to quit the program and to
read in the next sentence. In the
latter case the current sentence must be either deleted or added
to a linked list of past sentences.
5. Repeat from step 1 until the user enters "done". Note that
this test should be case-insensitive.
6. Print overall summary statistics, such as number of characters
and sentences processed.
Required Functions
o This function prints out the characters of the linked list, in the
order of the list.
o Note: Printing the sentence as the linked list is originally
created will print backwards from
what the user entered, because of the way that the linked list is
created.
o Alternate: For all functions, if you use typedef to create a
type “node”, then you can use
that defined type instead of “struct node”.
o Skills: Traversing a linked list. Also, printing is always
needed.
o This function prints out the characters of the linked list, in the
reverse order of the list.
o This function must work recursively, by first calling itself to
recursively print the
remainder of the list ( i.e. the following nodes ),and then print
the character in the current
node.
o Alternate: Instead of writing a separate function, the print
function listed above can be
modified to accept a second argument indicating whether to
print the list forwards or
backwards.
o Skills: Recursion.
o This function deletes the node pointed to by head, and all
nodes after it in the list.
o The required algorithm is to remove nodes one-by-one from
the beginning of the list,
deleting each one as it is removed from the list.
o This function will be needed to delete the old linked list
whenever a user asks to enter a
new sentence. ( It may also be needed for other tasks. )
o Skills: Removing nodes from the beginning of a list. Deleting
( freeing ) a node.
o This function searches the list pointed to by head, and returns
a pointer to the first node
found that contains the character c.
o The function returns NULL if the character is not found.
o When the user chooses this option from the switch menu, the
program should report ALL
the information in the node found, including sequence and
totalSequence.
o Skills: Searching a list for a key value. ( Map lookup. )
o This function removes all duplicate characters from the list,
retaining only the first
occurrence of each letter. For example, "I really like apples"
would become "I realyikps".
o Note that the test for duplicates is case sensitive, and non-
alphabetic characters are treated
the same as any other character.
o Skills: Removing arbitrary nodes from the list, but never the
first node.
o This function removes all nodes from the list having the value
of target.
o Skills: remove nodes from arbitrary positions, either the
beginning or elsewhere.
o This function creates a copy of a linked list, allocating new
nodes to make the copy. The
copy should be in the same order as the original list.
o Skills: Copying nodes. ( Don't forget sequence and
totalSequence. )
Optional Enhancements
o This function reverses the order of the linked list, and changes
the pointer to the head of the
list to point to the new head of the reversed list.
o The reversal must be done by manipulating the next pointers,
not by changing the data in
the nodes. More specifically, the algorithm is to remove nodes
from the original list one-
by-one, from the beginning of the list, and add them to a new
list, also at the beginning.
o This function does not create or destroy any nodes. It merely
rearranges the existing nodes.
o Note that the source variable is a pointer to a pointer, i.e. a
pointer passed by reference.
This allows the function to change source, so that it points to
the new head of the list when
the function is completed.
o Skills: Pointers to pointers.
o This function creates a sorted copy of a list, by copying nodes
from the list one by one and
inserting the copies into a new sorted list.
o This function uses findPrevious( ) and insertAfter( ) – See
below.
o Skills: Needed to create a sorted list.
o This function searches the list pointed to by head, and returns
a pointer to the node that
would precede c if the list were sorted by character value.
o The function returns NULL if c belongs at the beginning of
the list.
o Skills: Dealing with a sorted list.
o This function adds a new node following the node pointed to
by previous.
o Skills: Needed to create a sorted list.
;
o Applies the function pointed to by fp to each of the
characters in the list, and stores the return value in place
of the original character value.
o The function pointed to by fp must take a char argument and
return a char.
o Typical functions might change the case or do a substitution.
o Skills: Function pointers
o Suggested functions to use with the function pointer:
- If the input is in the range
from 'a' to 'z', then add 'A' - 'a' to convert it from
lower to upper case. Otherwise just return the input.
- Convert from upper to lower case.
- Change case of all alphabetic
characters.
- A very simple substitution cipher
that "rotates" all alphabetic characters 13 positions
through the alphabet. If the input is in the range from
'a' to 'm' or 'A' to 'M' inclusive, add 13. Otherwise
if the input is in the range 'n' to 'z' or 'N' to 'Z',
subtract 13. Applying this operation twice should
return the original string.
o This function creates a new list containing copies of only
those nodes from the original list that satisfy a given
criterion, as determined by the Boolean function pointed to
by the function pointer.
o e.g. bool isAlphabetic( char );, bool isLowerCase( char );,
etc.
o Note that the bool data type requires C99 and #include
stdbool.h ( The former can be set in Dev C++ by selecting
Project->Project Options from the menu bar, then selecting
Parameters and entering "-std=c99" in the Compiler section. )
Otherwise replace all references to "bool" with "int", and
use 0 for false and 1 for true.
o Skills: Function pointers, selectively copying part of a
list.
bool isPurePalindrome( struct node *head );
o If you choose to implement these functions, they should be
done with doubly linked lists. Alternatively you can create
a reversed copy and compare them, but it won't be as
impressive or worth as much credit.
Incremental Development
For any large programming task, it is best to develop and test
the code in small incremental
steps, rather than trying to do it all at once. For this
assignment, it is recommended that you
develop your program by developing and testing functions one-
by-one, ( not necessarily in the
order listed here ), making sure each function works before
continuing on to the next function.
Main( ) can grow as functions are added, by adding new options
to the switch.
What to Hand In:
1. Your code, including a readme file and a project file if
requested by the TA, should be
handed in electronically using Blackboard.
2. The purpose of the readme file is to make it as easy as
possible for the grader to understand
your program. If the readme file is too terse, then (s)he can't
understand your code; If it is
overly verbose, then it is extra work to read the readme file. It
is up to you to provide the most
effective level of documentation.
3. If there are problems that you know your program cannot
handle, it is best to document them in
the readme file, rather than have the TA wonder what is wrong
with your program. In
particular, if your program does not complete all of the steps
outlined above, then you should
document just exactly which portions of the project your
program does accomplish.
4. A printed copy of your program, along with your readme file
and any supporting documents
you wish to provide, ( such as hand-drawn sketches or diagrams
) may be handed in in lab.
5. Make sure that your name and your CS account name appear
at the beginning of each of your
files. Your program should also print this information when it
runs.
Optional Enhancements:
It is course policy that students may go above and beyond what
is called for in the base
assignment if they wish. These optional enhancements will not
raise any student’s score above
100 for any given assignment, but they may make up for points
lost due to other reasons.
think of others.
– Check with TA for
acceptability.
Heat Relationships in Physical and Chemical Processes
Activity B.5
Lab Report
Date: Section #:
Instructor:
Name:
Collective Analysis
The energy change, ΔHdissolution, that occurs while dissolving
an ionic compound in water can be
exothermic or endothermic. Qualitatively illustrate the expected
relationship between mass of
compound and temperature change of solution in a Styrofoam
cup calorimeter filled with water.
Use different lines (solid, dashed) to represent the different
ΔHdissolution (exothermic or
endothermic)
Mass of compound (g)
Te
m
pe
ra
tu
re
c
ha
ng
e
(C
)
How would the graph above change if the volume of water in
the calorimeter was increased?
Explain.
1
In a simplified two-step process, dissolving an ionic solid
consists first of breaking the ionic
bonds that hold the solid together (lattice energy, ΔHlattice)
followed by hydration of the resultant
ions by water molecules (hydration energy, ΔHhydration),
where the dissolution energy, ΔHdissolution
= ΔHlattice + ΔHhydration.
Use the data in the group file to describe the periodic
relationship between the heat of dissolution
(i.e., the energy change upon dissolving, ΔHdissolution) for M-
Cl compounds (M=Li, Na, K).
Consider the two following models that can be used to explain
the periodic trend in ΔHdissolution.
MODEL #1: The periodic trend in ΔHdissolution is determined
by ΔHlattice.
MODEL #2: The periodic trend in ΔHdissolution is determined
ΔHhydration.
Which model predicts the correct trend in ΔHdissolution for M-
Cl compounds (M=Li, Na, K)?
Explain. [Hint: the strength of an ionic bond is proportional to
the force of attraction between the ions, F = q1q2/r2
where q1 and q2 are the charges on each ion, and r is the
distance between the ions]
2
Use data from the group file to plot the mass of magnesium and
temperature change for heat of
reaction experiment using magnesium and hydrochloric acid.
Use the x-axis for the mass of
sample (m), and the y-axis for the temperature change (ΔT). Use
different markers to label the
data collected using the different calorimeters (Styrofoam cup
and glass beaker).
44
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
Draw a best-fit line through the data and determine the
algebraic equation of the line for each
calorimeter. Show your work.
How would the above graph change if each sample of
magnesium was reacted 3.0 M
hydrochloric acid (instead of the 2.0 M acid used during the
lab)? Explain.
3
Use data in the group file to determine the average specific heat
capacity, c, of copper. Use the
equation for the total heat flow, qmetal + qwater = 0 (show your
work for one sample, provide
values for four other samples). Compare your experimental
values to the published value for
copper.
Mass of copper
(g)
Specific heat capacity
(J/gºC)
Use data in the group file to determine the average specific heat
capacity, c, of each unknown
metal using the equation for the total heat flow, qmetal + qwater
= 0 (show your work for one
sample, provide values for four other samples). Identify each
metal from the following list (Al, c
= 0.897 J/gºC; Ni, c = 0.54 J/gºC; Zn, c = 0.388 J/gºC; Sn, c=
0.228 J/gºC; Pb, c = 0.129 J/gºC).
Mass of Metal A
(g)
Specific heat capacity
(J/gºC)
Mass of Metal B
(g)
Specific heat capacity
(J/gºC)
4
Expand Your Thinking
Consider the process of dissolving ionic compound which has a
negative ΔHdissolution
(exothermic). Draw a particulate level model to illustrate the
two steps of this process: breaking
ionic bonds in the solid and hydrating the ions with water
molecules. Illustrate the relative
magnitude of energy flow during these two steps using arrows
(longer arrows = higher energy).
Carefully consider the direction of energy flow and specifically
identify the source (where the
energy comes from) and the sink (where the energy goes to)
during each step.
Step 1: breaking ionic bonds
Energy source:
Energy sink:
Explain your reasoning:
Explain your reasoning:
Step 2: hydrating ions with H2O
Energy source:
Energy sink:
How would the above models change if the process of
dissolving the ionic compound was
endothermic (positive ΔHdissolution)? Explain.
5
Activity B.5 Lab Report

More Related Content

Similar to CS 107 – Introduction to Computing and Programming – Spring 20.docx

Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
C language 3
C language 3C language 3
C language 3
Arafat Bin Reza
 
Python Objects
Python ObjectsPython Objects
Python Objects
MuhammadBakri13
 
Please write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdfPlease write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdf
fazilfootsteps
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
Jabs6
 
Doppl development iteration #7
Doppl development   iteration #7Doppl development   iteration #7
Doppl development iteration #7
Diego Perini
 
Functions-.pdf
Functions-.pdfFunctions-.pdf
Functions-.pdf
arvdexamsection
 
Introduction to R for beginners
Introduction to R for beginnersIntroduction to R for beginners
Introduction to R for beginners
Abishek Purushothaman
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
dunhamadell
 
Excel Tutorials - Random Value Selection from a List
Excel Tutorials - Random Value Selection from a ListExcel Tutorials - Random Value Selection from a List
Excel Tutorials - Random Value Selection from a List
Merve Nur Taş
 
Doppl development iteration #1
Doppl development   iteration #1Doppl development   iteration #1
Doppl development iteration #1
Diego Perini
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
Asst.prof M.Gokilavani
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
Akhil Kaushik
 
Project lexical analyser compiler _1.pdf
Project lexical analyser compiler _1.pdfProject lexical analyser compiler _1.pdf
Project lexical analyser compiler _1.pdf
abhimanyukumar28203
 
Functions and modular programming.pptx
Functions and modular programming.pptxFunctions and modular programming.pptx
Functions and modular programming.pptx
zueZ3
 
computer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfixcomputer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfix
ecomputernotes
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
nmahi96
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
Rhishav Poudyal
 
05 c++-strings
05 c++-strings05 c++-strings
05 c++-strings
Kelly Swanson
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 

Similar to CS 107 – Introduction to Computing and Programming – Spring 20.docx (20)

Functions in C++
Functions in C++Functions in C++
Functions in C++
 
C language 3
C language 3C language 3
C language 3
 
Python Objects
Python ObjectsPython Objects
Python Objects
 
Please write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdfPlease write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdf
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
 
Doppl development iteration #7
Doppl development   iteration #7Doppl development   iteration #7
Doppl development iteration #7
 
Functions-.pdf
Functions-.pdfFunctions-.pdf
Functions-.pdf
 
Introduction to R for beginners
Introduction to R for beginnersIntroduction to R for beginners
Introduction to R for beginners
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
 
Excel Tutorials - Random Value Selection from a List
Excel Tutorials - Random Value Selection from a ListExcel Tutorials - Random Value Selection from a List
Excel Tutorials - Random Value Selection from a List
 
Doppl development iteration #1
Doppl development   iteration #1Doppl development   iteration #1
Doppl development iteration #1
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Project lexical analyser compiler _1.pdf
Project lexical analyser compiler _1.pdfProject lexical analyser compiler _1.pdf
Project lexical analyser compiler _1.pdf
 
Functions and modular programming.pptx
Functions and modular programming.pptxFunctions and modular programming.pptx
Functions and modular programming.pptx
 
computer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfixcomputer notes - Conversion from infix to postfix
computer notes - Conversion from infix to postfix
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
 
05 c++-strings
05 c++-strings05 c++-strings
05 c++-strings
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 

More from faithxdunce63732

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docx
faithxdunce63732
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docx
faithxdunce63732
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docx
faithxdunce63732
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docx
faithxdunce63732
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
faithxdunce63732
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
faithxdunce63732
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docx
faithxdunce63732
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docx
faithxdunce63732
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docx
faithxdunce63732
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docx
faithxdunce63732
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docx
faithxdunce63732
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docx
faithxdunce63732
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docx
faithxdunce63732
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docx
faithxdunce63732
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docx
faithxdunce63732
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docx
faithxdunce63732
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docx
faithxdunce63732
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docx
faithxdunce63732
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docx
faithxdunce63732
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docx
faithxdunce63732
 

More from faithxdunce63732 (20)

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docx
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docx
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docx
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docx
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docx
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docx
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docx
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docx
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docx
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docx
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docx
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docx
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docx
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docx
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docx
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docx
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docx
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docx
 

Recently uploaded

Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
danielkiash986
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
Celine George
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 

Recently uploaded (20)

Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Pharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brubPharmaceutics Pharmaceuticals best of brub
Pharmaceutics Pharmaceuticals best of brub
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17How Barcodes Can Be Leveraged Within Odoo 17
How Barcodes Can Be Leveraged Within Odoo 17
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 

CS 107 – Introduction to Computing and Programming – Spring 20.docx

  • 1. CS 107 – Introduction to Computing and Programming – Spring 2013 Homework Assignment 7 ( Draft 3.0 - Hopefully Final ) Fun with Linked Lists Due: Monday 29 April at 8:00 A.M. Optional hard copy may be turned in to TA during lab. Overall Assignment For this assignment, you are to write a program that reads in sentences character-by-character, creates a linked list out of the character stream, and then performs various operations on the resulting list(s). Node Structure The linked list node that you create for this assignment shall be named “node”, and shall have at a minimum the following fields: struct node { char c; int sequence, totalSequence; struct node * next; };
  • 2. where: ad in from the keyboard. sentence, starting from 1. I.e. the first character in the sentence will have sequence 1, the second 2, etc. e numbers are since the program started. So for example, if the first sentence read contains 20 characters, ( not counting the newline character ), then the first character of the second sentence would have a sequence number of 1, but a totalSequence number of 21. Program Operation After reporting your name and explaining to the user what the program does, your program should do the following: 1. Ask the user to enter a sentence. 2. Read the characters one-by-one, until the newline character ( ‘n’ ) is read in. For each character read in: A. Create a new node, using dynamic allocation ( malloc ), and fill in the node fields. B. Add the node to the beginning of a linked list for this sentence. 3. Once the sentence is stored in a linked list, give the user a list of operations supported, ( see
  • 3. below ) and allow them to choose which one(s) to perform. Based upon their choice, use a switch to perform the operation requested and print out the results. 4. Two choices on the list must be to quit the program and to read in the next sentence. In the latter case the current sentence must be either deleted or added to a linked list of past sentences. 5. Repeat from step 1 until the user enters "done". Note that this test should be case-insensitive. 6. Print overall summary statistics, such as number of characters and sentences processed. Required Functions o This function prints out the characters of the linked list, in the order of the list. o Note: Printing the sentence as the linked list is originally created will print backwards from what the user entered, because of the way that the linked list is created. o Alternate: For all functions, if you use typedef to create a type “node”, then you can use that defined type instead of “struct node”. o Skills: Traversing a linked list. Also, printing is always needed.
  • 4. o This function prints out the characters of the linked list, in the reverse order of the list. o This function must work recursively, by first calling itself to recursively print the remainder of the list ( i.e. the following nodes ),and then print the character in the current node. o Alternate: Instead of writing a separate function, the print function listed above can be modified to accept a second argument indicating whether to print the list forwards or backwards. o Skills: Recursion. o This function deletes the node pointed to by head, and all nodes after it in the list. o The required algorithm is to remove nodes one-by-one from the beginning of the list, deleting each one as it is removed from the list. o This function will be needed to delete the old linked list whenever a user asks to enter a new sentence. ( It may also be needed for other tasks. ) o Skills: Removing nodes from the beginning of a list. Deleting ( freeing ) a node.
  • 5. o This function searches the list pointed to by head, and returns a pointer to the first node found that contains the character c. o The function returns NULL if the character is not found. o When the user chooses this option from the switch menu, the program should report ALL the information in the node found, including sequence and totalSequence. o Skills: Searching a list for a key value. ( Map lookup. ) o This function removes all duplicate characters from the list, retaining only the first occurrence of each letter. For example, "I really like apples" would become "I realyikps". o Note that the test for duplicates is case sensitive, and non- alphabetic characters are treated the same as any other character. o Skills: Removing arbitrary nodes from the list, but never the first node. o This function removes all nodes from the list having the value of target. o Skills: remove nodes from arbitrary positions, either the
  • 6. beginning or elsewhere. o This function creates a copy of a linked list, allocating new nodes to make the copy. The copy should be in the same order as the original list. o Skills: Copying nodes. ( Don't forget sequence and totalSequence. ) Optional Enhancements o This function reverses the order of the linked list, and changes the pointer to the head of the list to point to the new head of the reversed list. o The reversal must be done by manipulating the next pointers, not by changing the data in the nodes. More specifically, the algorithm is to remove nodes from the original list one- by-one, from the beginning of the list, and add them to a new list, also at the beginning. o This function does not create or destroy any nodes. It merely rearranges the existing nodes. o Note that the source variable is a pointer to a pointer, i.e. a pointer passed by reference. This allows the function to change source, so that it points to the new head of the list when the function is completed. o Skills: Pointers to pointers.
  • 7. o This function creates a sorted copy of a list, by copying nodes from the list one by one and inserting the copies into a new sorted list. o This function uses findPrevious( ) and insertAfter( ) – See below. o Skills: Needed to create a sorted list. o This function searches the list pointed to by head, and returns a pointer to the node that would precede c if the list were sorted by character value. o The function returns NULL if c belongs at the beginning of the list. o Skills: Dealing with a sorted list. o This function adds a new node following the node pointed to by previous. o Skills: Needed to create a sorted list. ; o Applies the function pointed to by fp to each of the characters in the list, and stores the return value in place
  • 8. of the original character value. o The function pointed to by fp must take a char argument and return a char. o Typical functions might change the case or do a substitution. o Skills: Function pointers o Suggested functions to use with the function pointer: - If the input is in the range from 'a' to 'z', then add 'A' - 'a' to convert it from lower to upper case. Otherwise just return the input. - Convert from upper to lower case. - Change case of all alphabetic characters. - A very simple substitution cipher that "rotates" all alphabetic characters 13 positions through the alphabet. If the input is in the range from 'a' to 'm' or 'A' to 'M' inclusive, add 13. Otherwise if the input is in the range 'n' to 'z' or 'N' to 'Z', subtract 13. Applying this operation twice should return the original string. o This function creates a new list containing copies of only those nodes from the original list that satisfy a given criterion, as determined by the Boolean function pointed to by the function pointer. o e.g. bool isAlphabetic( char );, bool isLowerCase( char );,
  • 9. etc. o Note that the bool data type requires C99 and #include stdbool.h ( The former can be set in Dev C++ by selecting Project->Project Options from the menu bar, then selecting Parameters and entering "-std=c99" in the Compiler section. ) Otherwise replace all references to "bool" with "int", and use 0 for false and 1 for true. o Skills: Function pointers, selectively copying part of a list. bool isPurePalindrome( struct node *head ); o If you choose to implement these functions, they should be done with doubly linked lists. Alternatively you can create a reversed copy and compare them, but it won't be as impressive or worth as much credit. Incremental Development For any large programming task, it is best to develop and test the code in small incremental steps, rather than trying to do it all at once. For this assignment, it is recommended that you develop your program by developing and testing functions one- by-one, ( not necessarily in the order listed here ), making sure each function works before continuing on to the next function. Main( ) can grow as functions are added, by adding new options to the switch.
  • 10. What to Hand In: 1. Your code, including a readme file and a project file if requested by the TA, should be handed in electronically using Blackboard. 2. The purpose of the readme file is to make it as easy as possible for the grader to understand your program. If the readme file is too terse, then (s)he can't understand your code; If it is overly verbose, then it is extra work to read the readme file. It is up to you to provide the most effective level of documentation. 3. If there are problems that you know your program cannot handle, it is best to document them in the readme file, rather than have the TA wonder what is wrong with your program. In particular, if your program does not complete all of the steps outlined above, then you should document just exactly which portions of the project your program does accomplish. 4. A printed copy of your program, along with your readme file and any supporting documents you wish to provide, ( such as hand-drawn sketches or diagrams ) may be handed in in lab. 5. Make sure that your name and your CS account name appear at the beginning of each of your files. Your program should also print this information when it runs. Optional Enhancements:
  • 11. It is course policy that students may go above and beyond what is called for in the base assignment if they wish. These optional enhancements will not raise any student’s score above 100 for any given assignment, but they may make up for points lost due to other reasons. think of others. – Check with TA for acceptability. Heat Relationships in Physical and Chemical Processes Activity B.5 Lab Report Date: Section #: Instructor: Name: Collective Analysis The energy change, ΔHdissolution, that occurs while dissolving an ionic compound in water can be exothermic or endothermic. Qualitatively illustrate the expected relationship between mass of compound and temperature change of solution in a Styrofoam cup calorimeter filled with water. Use different lines (solid, dashed) to represent the different
  • 12. ΔHdissolution (exothermic or endothermic) Mass of compound (g) Te m pe ra tu re c ha ng e (C )
  • 13. How would the graph above change if the volume of water in the calorimeter was increased? Explain. 1 In a simplified two-step process, dissolving an ionic solid consists first of breaking the ionic bonds that hold the solid together (lattice energy, ΔHlattice) followed by hydration of the resultant ions by water molecules (hydration energy, ΔHhydration), where the dissolution energy, ΔHdissolution = ΔHlattice + ΔHhydration. Use the data in the group file to describe the periodic relationship between the heat of dissolution (i.e., the energy change upon dissolving, ΔHdissolution) for M- Cl compounds (M=Li, Na, K). Consider the two following models that can be used to explain the periodic trend in ΔHdissolution.
  • 14. MODEL #1: The periodic trend in ΔHdissolution is determined by ΔHlattice. MODEL #2: The periodic trend in ΔHdissolution is determined ΔHhydration. Which model predicts the correct trend in ΔHdissolution for M- Cl compounds (M=Li, Na, K)? Explain. [Hint: the strength of an ionic bond is proportional to the force of attraction between the ions, F = q1q2/r2 where q1 and q2 are the charges on each ion, and r is the distance between the ions] 2 Use data from the group file to plot the mass of magnesium and temperature change for heat of reaction experiment using magnesium and hydrochloric acid. Use the x-axis for the mass of sample (m), and the y-axis for the temperature change (ΔT). Use different markers to label the data collected using the different calorimeters (Styrofoam cup and glass beaker).
  • 15. 44 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 Draw a best-fit line through the data and determine the algebraic equation of the line for each calorimeter. Show your work. How would the above graph change if each sample of magnesium was reacted 3.0 M hydrochloric acid (instead of the 2.0 M acid used during the lab)? Explain. 3 Use data in the group file to determine the average specific heat capacity, c, of copper. Use the
  • 16. equation for the total heat flow, qmetal + qwater = 0 (show your work for one sample, provide values for four other samples). Compare your experimental values to the published value for copper. Mass of copper (g) Specific heat capacity (J/gºC) Use data in the group file to determine the average specific heat capacity, c, of each unknown metal using the equation for the total heat flow, qmetal + qwater = 0 (show your work for one sample, provide values for four other samples). Identify each metal from the following list (Al, c = 0.897 J/gºC; Ni, c = 0.54 J/gºC; Zn, c = 0.388 J/gºC; Sn, c= 0.228 J/gºC; Pb, c = 0.129 J/gºC). Mass of Metal A (g) Specific heat capacity
  • 17. (J/gºC) Mass of Metal B (g) Specific heat capacity (J/gºC) 4 Expand Your Thinking Consider the process of dissolving ionic compound which has a negative ΔHdissolution (exothermic). Draw a particulate level model to illustrate the two steps of this process: breaking ionic bonds in the solid and hydrating the ions with water molecules. Illustrate the relative magnitude of energy flow during these two steps using arrows (longer arrows = higher energy).
  • 18. Carefully consider the direction of energy flow and specifically identify the source (where the energy comes from) and the sink (where the energy goes to) during each step. Step 1: breaking ionic bonds Energy source: Energy sink: Explain your reasoning: Explain your reasoning: Step 2: hydrating ions with H2O Energy source: Energy sink:
  • 19. How would the above models change if the process of dissolving the ionic compound was endothermic (positive ΔHdissolution)? Explain. 5 Activity B.5 Lab Report