Using the following data reactions: ?H

Using the following data reactions:

?H

In: Chemistry

JAVA PLEASE Creating Classes Create a class that will keep track of a yes/no survey. You...

JAVA PLEASE

Creating Classes

Create a class that will keep track of a yes/no survey. You will have to store the text (question) of the survey plus the number of yes/no votes. The constructor requires a description of the survey to be passed int (the question). The vote method will simply increment the correct vote count. The toString method will format all of the instance data to be displayed on the screen

In: Computer Science

How many moles of KMnO4 are equivalent to 1.000 mole of Fe2+?

How many moles of KMnO4 are equivalent to 1.000 mole of Fe2+?

In: Chemistry

How can the corporate culture coordinate with the company to enhance its competitiveness?(450 words and 1...

How can the corporate culture coordinate with the company to enhance its competitiveness?(450 words and 1 paragraph)

In: Operations Management

In this exercise, weighed samples of a solid unknown containing NaCl and NaHCO3react with hydrochloric acid....

In this exercise, weighed samples of a solid unknown containing NaCl and NaHCO3react with hydrochloric acid. The volume of the CO2 liberated by the reaction in the gas phase is measured with a gas collection syringe. From the volume we can calculate the number of moles of CO2 in the gas phase using the ideal gas approximation.

Since the CO2 is generated in an aqueous environment (aqueous HCl), some CO2will dissolve in the liquid phase. The amount of CO2 dissolved in the liquid phase is computed using Henry's Law which requires knowing the partial pressure of CO2. As described in the exercise, this requires knowing the entire system gas volume in addition to the initial and final syringe readings.   

The entire system gas volume is the sum of the quantities labeled Vtube and Vsyr in the diagram below, corrected for the liquid volume (the aqueous HCl).

Value Units
Gas Constant 0.0821 L-atm/mol K
Absolute Zero (0 K) -273.15 oC
Atmosphere 760.0 Torr
Molar Mass of NaHCO3 84.01 g/mol
Henry's Law Constant for CO2in water 3.2 X 10-2 mol/L-atm

The table below contains the data collected in one run of the reaction between an unknown and hydrochloric acid:

Value Units

Initial Weight of container and unknown

18.4395 g
Final Weight of container and unknown 18.6185 g
Volume of hydrochloric acid 10.0 mL
Volume of tube, Vtube (see Figure above) 92.3 mL
Initial volume of syringe 5.0 mL
Final volume of syringe 50.7 mL
Temperature 26.5 oC
Pressure 764.4 Torr
Vapor Pressure of Water at 26.5 oC 25.8

Torr

The following questions deal with the above data. The appropriate units are specified in the questions. Pay close attention to the number of significant figures in your answers.

1). What is the volume of CO2 captured in the gas phase (in mL)?

2).What is the number of mmols of CO2 captured in the gas phase? (Remember to account for the vapor pressure of water.)

3). What is the weight of the sample in grams?

In: Chemistry

strlen(): strlen() counts the number of characters in a cstring. The algorithm works by looking at...

strlen():

strlen() counts the number of characters in a cstring. The algorithm works by looking at each character in the cstring, counting as it goes. It stops looking at characters when it encounters a null terminator ‘\0’.

Here is my implementation of the strlen() function. You will need to write and test my solution and your own solution.

int profStrLen( char *str ) {
  char *endOfStr = str;
  while( *endOfStr != '\0' ) {
     endOfStr++;
  }
  return (int)(endOfStr - str);
}

Make sure you understand how my implementation is working before creating your own. Then, you can write your own implementation. For your implementation, do not use pointer arithmetic to solve it - use array notation and a counter instead. Here is the prototype for your function.

int stuStrLen( char * );

strcpy():

strcpy() copies the contents of the second char* into the memory of the first char*. The algorithm works by looking at each character in the second char* and copies that into the first char*. Because we are dealing with cstrings, the copying process will stop when the ‘\0’ is reached in the second char*.

Here’s my implementation. Again, you will need to write and test my solution and your own.

char *profStrCpy( char *str1, char *str2 ) {
  char *dest = str1;
  while( *str2 != '\0' ) {
    *str1 = *str2;
    str1++;
    str2++;
  }
  *str1 = ‘\0’;
  return dest;
}

Make sure you understand how my implementation is working before creating your own. Then, you can write your own implementation. For your implementation, do not use pointer arithmetic to solve it - use array notation and a counter instead. Here is the prototype for your function.

char *stuStrCpy( char *, char * );

strcat():

strcat() copies the contents of the second char* into the memory of the first char* like strcpy(), but it copies the values in the second char* to the end of the first char*. The algorithm works by looking at each character in the first char* until the ‘\0’ is found. Then, it looks at each character in the second char* and copies that into the first char*’s current location. As it does this, it increments the position in each char* until the ‘\0’ is found in the second char*.

Here’s my implementation. Again, you will need to write and test my solution and your own.

char *profStrCat( char *str1, char *str2 ) {
  char *dest = str1;
  while( *str1 != '\0' ) {
    str1++;
  }
  while( *str2 != '\0' ) {
    *str1 = *str2;
    str1++;
    str2++;
  }
  *str1 = ‘\0’;
  return dest;
}

Make sure you understand how my implementation is working before creating your own. Then, you can write your own implementation. For your implementation, do not use pointer arithmetic to solve it - use array notation and a counter instead. Here is the prototype for your function.

char *stuStrCat( char *, char * );

Intermediate cstring function

Now that you have worked through many of the cstring functions. I want you to implement the following functions on your own. I will provide an overview of the algorithm, but I will not provide you with an implementation from me. You will need to write and test this function.

strcmp():

strcmp() compares strings lexicographically. It returns a negative value if the first string occurs lexicographically before the second string. It returns a positive value if the first string occurs lexicographically after the second string. And, it returns zero if the two strings are equivalent. Make sure you call attention to the return of strcmp(). The return of zero instead of a non-zero is a common source for errors involved with cstring processing.

The algorithm for strcmp() works by subtracting each character as it iterates through each cstring stopping when the result of the subtraction is nonzero or a ‘\0’ is found in one of the strings. We will return the difference between the two characters.

You will need to write and test your solution. Here is your prototype.

int stuStrCmp( char *, char * );

Everybody likes a mystery

Here is a function of code that is labeled mystery. Type in the code and describe in the comments what the function does algorithmically and tell me what you think the function is named.

int mystery( char *str ) {
  char *str2 = str;
  long pos;
  int result = 0;

  while( *str2 != '\0' ) {
    str2++;
  }
  pos = str2 - str - 1;

  for( int count = 1; pos >= 0; pos --, count *= 10 ) {
    if( str[pos] == ‘-') {
      result *= -1;
    } else {
      result += (str[pos] - '0') * count;
    }
  }
  return result;
}

main.cpp

#include <iostream>

using namespace std;

int profStrLen( char * );
int stuStrLen( char * );
char *profStrCpy( char *, char * );
char *stuStrCpy( char *, char * );
char *profStrCat( char *, char * );
char *stuStrCat( char *, char * );
int stuStrCmp( char *, char * );
int mystery( char * );

int main() {
// type all testing code here
return 0;
}

// implement the functions here

In: Computer Science

give short description of each phase of the cardicac cycle where is blood going to and...

give short description of each phase of the cardicac cycle
where is blood going to and from?
b. does a valve open or close at the beginning or end of the phase?
c. what does volume in the ventricles look like? (eg: getting higher, same, getting lower)
d. Are the ventricles contracting or relaxing?

In: Biology

Management Science Bank is the only bank in the small town of Sto Thomas. On a...

Management Science Bank is the only bank in the small town of Sto Thomas. On a typical Friday, an average of 10 customers per hour arrive at the bank to transact business. There is one teller at the bank, and the average time required to transact business is 4 minutes. It is assumed that service times may be described by the exponential distribution. A single line would be used, and the customer at the front of the line would go to the first available bank teller. If a single teller is used, find:
a.) The average time in the line.
b.) The average number in the line.
c.) The average time in the system.
d.) The average number in the system.
e.) The probability that the bank is empty.
f.) Management Science Bank is considering adding a second teller (who would work at the same rate as the first) to reduce the waiting time for customers. She assumes that this will cut the waiting time in half. If a second teller is added, find the new answers to parts (a) to (e).

In: Operations Management

What is the ultimate fate of the digested chicken and rice? What was the initial biological...

What is the ultimate fate of the digested chicken and rice? What was the initial biological structure of the nutritional components first consumed (example proteins breaking down to their simpler components) and what are the resulting products resulting from digestion that are now ready and available for use by the body for energy and homeostasis?

In: Chemistry

how do corporations benefit from government regulation? *refer to Dean Baker's THE CONSERVATIVE NANNY STATE*

how do corporations benefit from government regulation?

*refer to Dean Baker's THE CONSERVATIVE NANNY STATE*

In: Economics

##Notice: write in HLA code . . Create an HLA Assembly language program that prompts for...

##Notice: write in HLA code

.

.

Create an HLA Assembly language program that prompts for a single integer value from the user and prints an boxy pattern like the one shown below. If the number is negative, don't print anything at all.

.

Here are some example program dialogues to guide your efforts:

.

Feed Me: 5
55555
5 5
5 5
5 5
55555

Feed Me: -6

Feed Me: 3
333
3 3
333

.

In an effort to help you focus on building an Assembly program, I’d like to offer you the following C statements matches the program specifications stated above. If you like, use them as the basis for building your Assembly program.

.

SAMPLE C CODE:
------------------------

int i, n, j;
printf( "Feed Me:" );
scanf( "%d", &n );

for (i=1; i<=n; i++) {
if (i == 1 || i == n) { // first or last row
for (j = 1; j <= n; j++) {
printf( "%d", n );
}
printf( "\n" );
}
else { // internal rows of the box
printf( "%d", n );
for (j = 1; j <= n-2; j++) {
printf( " " );
}
printf( "%d", n );
printf( "\n" );
}

}

.

##Answer the questinon in HLA Assembly language program.

In: Computer Science

The water used in this experiment is sparged with nitrogen to remove any dissolved oxygen. The...

The water used in this experiment is sparged with nitrogen to remove any dissolved oxygen. The proton-coupled reduction of oxygen is shown in the following half reaction:

O2 + 4H+ +4e- --> 2H2O

1) Explain why sparging a solution with N2 to remove dissolved oxygen is an equilibrium process.

2) Using the half reaction above, write the balanced equation for the reaction of ascorbic acid with oxygen. Show your work.

3) If you didn’t know whether or not O2 is capable of oxidizing ascorbic acid, how would you determine this by consulting data? What data would you consult and what would you look for?

In: Chemistry

Topic: Schizophrenia 1. Review the readings on schizophrenia, DSM-V criteria and briefly describe schizophrenia, and current...

Topic: Schizophrenia

1. Review the readings on schizophrenia, DSM-V criteria and briefly describe schizophrenia, and current understanding of the disorder.

2. Conduct a literature search and address one of the following questions in a brief essay:

a) What is the relationship (if any) between violence and schizophrenia?

b) What role, if any, does stigma play in help seeking, treatment, and recovery?

In: Psychology

Calculate the frequency in Hz of a typical green photon emitted by the Sun. What is...

  1. Calculate the frequency in Hz of a typical green photon emitted by the Sun. What is the physical interpretation of this (very high) frequency? (That is, what is oscillating?)

In: Physics

In the previous question, you designed a simple algorithm to create a class list application. In...

In the previous question, you designed a simple algorithm to create a class list application. In this question, you
will implement the same application in Java. To do this, you will need a working version of a Student ADT, a List
ADT, and the List Iterator. You may start with your own Student ADT, or you can start from the solutions to
Assignment 2. You will be given a working version of a List ADT.
Recall that your application does the following:
• Create a class list of students
• Display every Student record in the class list to the console.
• Give every student a bonus mark on the final exam. It does not matter how much of a bonus you give.
• Display every Student record in the class list to the console, to show the changes to the records.
You must store Student objects in a List, using the given List ADT.
You are to use the List Iterator for any task that requires looking at every element in a list (the last two items
above).
Here’s a guide for you to help you manage this task.
1. Download the BasicLinkedList.java and List.java files from Moodle.
2. Obtain the StudentADT.java and Student.java files from either your solution or the model solution of assignment
3. Create a new application class called ClassListApp.java, that contains a main method. Make sure that you
include import java.util.*; on the top of the file.
4. Take your design for Exercise 1, and copy it into ClassListApp.java, as comments. Implement the design in
steps (not all at once). Every time you have a step implemented, compile and test.

Here are the java source file already given

List.java

import java.util.Iterator;

/**
* Defines the interface to a list collection.
* The implementation of the list is hidden.
*
*/
public interface List<E> extends Iterable<E>
{
  
/**
Pre:
Post: the list is unchanged.
* Return: true if this list contains no elements; false otherwise
*/
public boolean isEmpty();
  
  
/**
Pre:
Post: the list is unchanged.
* Return: the number of elements in this list.
*/
public int size();
  
  
/**
* Check if an element exists in the list
Pre:
Post: the list is unchanged.
Return: true if the specified element is found in this list and
false otherwise. Throws an EmptyCollectionException if the list
is empty.
*/
public boolean contains (E targetElement);
  
/**
Deletes the first element in this list and returns a reference
to it. Throws an EmptyCollectionException if the list is empty.
Pre:
Post: the first element is removed from the list
Return: a reference to the removed element
*/
public E deleteHead();
  
/**
Removes the last element in this list and returns a reference
to it. Throws an EmptyCollectionException if the list is empty.
Pre:
Post: the last element is removed from the list
Return: a reference to the removed element
*/
public E deleteTail();
  
/**
Removes the first instance of the specified element from this
list and returns a reference to it. Throws an EmptyCollectionException
if the list is empty. Throws a ElementNotFoundException if the
specified element is not found in the list.
Pre: targetElement :: E, the target element to be removed
Post: the element is removed from the list
Return: a reference to the removed element
*/
public E deleteElement(E targetElement);


/**
Insert a new node to the head of the list.
Pre: item :: E, content in the new node
Post: new node is inserted to the head of the list
Return: nothing
*/
public void insertHead(E item);
  
/**
Insert a new node to the end of the list.
Pre: item :: E, content in the new node
Post: new node is inserted to the end of the list
Return: nothing
*/
public void insertTail(E item);
  
  
/**
Insert a new node at a specific position in the list.
Pre: item :: E, content in the new node
position :: the position of the new node
Post: new node is inserted at position in the list
Return: nothing
*/
public void insertAtPosition (E item, int position);
  
  
/**
Retrive the element at a specific position in the list.
Pre: position :: Integer, a position in the list
Post: the list is unchanged
Return: the element at the position
*/
public E get(int position);
  
  
  
/**
* Useful method for pretty print for atomic data
Pre:
Post: the list is unchanged.
Return: Returns a string representation of this list.
*/
public String toString();
  
  
/**
* Returns an iterator for the elements in this list.
*
* @return an iterator over the elements in this list
*/
public Iterator<E> iterator();
  
  }

Student.java

/**
* Defines the interface to the student ADT.
*
*/
public interface Student {

/**
displayStudentRecord()
Pre:
Post: displays Student info
Return: nothing
*/
public void displayStudentRecord();
  
  
/**
Algorithm changeAssignmentGradeForStudent(asnNum,grade)
Pre: asnNum :: Integer, the index of the assignment to grade
grade :: double, the amount to change the grade
Post: If the index is sensible, the appropriate grade is changed
(this method allows grades to be changed arbitrarily)
Return: true if the change was made, false otherwise
*/
public boolean changeAssignmentGradeForStudent (int asnNum, double grade);

/**
Algorithm changeExamGradeForStudent(grade)
Pre: grade :: double, the amount to change the grade
Post: the exam grade is changed
(this method allows grades to be changed arbitrarily)
Return: nothing
*/
public void changeExamGradeForStudent(double grade);
  
}

StudentADT.java

public class StudentADT implements Student {
  
private String firstName;
private String lastName;
private int stNum;
private double [] agrades;
private double egrade;

  
/**
Algorithm StudentADT(firstNm, lastNm, stNo, asn1Grade, asn2Grade, asn3Grade, examGrade)
Constructor to create a student object
Pre: firstNm, lastNm :: String
stNo :: integer
asn1Grade, asn2Grade, asn3Grade :: double
examGrade :: double
Post: allocates memory on the heap for a new Student object
Return: a new Student object, with all fields filled in
*/
  
public StudentADT(String firstNm, String lastNm, int stNo, double asn1Grade, double asn2Grade, double asn3Grade, double examGrade){   
this.firstName = firstNm;
this.lastName = lastNm;
this.stNum = stNo;
this.agrades = (double[]) new double[3];
this.agrades[0] = asn1Grade;
this.agrades[1] = asn2Grade;
this.agrades[2] = asn3Grade;
this.egrade = examGrade;
}

/**
Algorithm displayStudentRecord()
Pre:
Post: displays Student info
Return: nothing

*/
public void displayStudentRecord() {
System.out.println("Record for " + this.lastName + ", " + this.firstName + " (" + this.stNum + ") ");
System.out.println("Assignment grades");
for (int i = 0 ; i <= 2; i ++)
System.out.println(this.agrades[i]);
System.out.println("Exam grade: " + this.egrade);
}
  
/**
Algorithm changeAssignmentGradeForStudent(asnNum,grade)
Pre: asnNum :: Integer, the index of the assignment to grade
grade :: double, the amount to change the grade
Post: If the index is sensible, the appropriate grade is changed
(this method allows grades to be changed arbitrarily)
Return: true if the change was made, false otherwise
*/
public boolean changeAssignmentGradeForStudent (int asnNum, double grade) {
  
if (asnNum < 0 || asnNum > 2)
return false;
else {
this.agrades[asnNum] = this.agrades[asnNum] + grade;
return true;
}
}
  
  
/**
Algorithm changeExamGradeForStudent(grade)
Pre: grade :: double, the amount to change the grade
Post: the exam grade is changed
(this method allows grades to be changed arbitrarily)
Return: nothing
*/

public void changeExamGradeForStudent(double grade) {
this.egrade = this.egrade + grade;
}

  
}

In: Computer Science