Questions
6.23 LAB: Python insert/update sqlite3 datafiles Given is a Python program that connects to a sqlite...

6.23 LAB: Python insert/update sqlite3 datafiles

Given is a Python program that connects to a sqlite database and has one table called writers with two columnns:

  • name - the name of a writer
  • num - the number of works the writer has written

The writers table originally has the following data:

name, num
Jane Austen,6
Charles Dickens,20
Ernest Hemingway,9
Jack Kerouac,22
F. Scott Fitzgerald,8
Mary Shelley,7
Charlotte Bronte,5
Mark Twain,11
Agatha Christie,73
Ian Flemming,14
J.K. Rowling,14
Stephen King,54
Oscar Wilde,1

Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writer's name and number of works. The following TODO sections must be completed.

  • Check if a writer exists in the writers table
  • If the writer exists in the table, locate an entry to be updated by writer's name and update the writer's value for num
  • If the writer does not exist in the table, add a new entry in the writers table and provide the value for name and num

Ex: If the input is:

y
J.K. Rowling
30
y
Elton John
y
62
n

The output is:

(ID, Name, Num)
(1, 'Jane Austen', 6)
(2, 'Charles Dickens', 20)
(3, 'Ernest Hemingway', 9)
(4, 'Jack Kerouac', 22)
(5, 'F. Scott Fitzgerald', 8)
(6, 'Mary Shelley', 7)
(7, 'Charlotte Bronte', 5)
(8, 'Mark Twain', 11)
(9, 'Agatha Christie', 73)
(10, 'Ian Flemming', 14)
(11, 'J.K. Rowling', 30)
(12, 'Stephen King', 54)
(13, 'Oscar Wilde', 1)
(14, 'Elton John', 62)

In: Computer Science

6.23 LAB: Python insert/update sqlite3 datafiles Given is a Python program that connects to a sqlite...

6.23 LAB: Python insert/update sqlite3 datafiles

Given is a Python program that connects to a sqlite database and has one table called writers with two columnns:

  • name - the name of a writer
  • num - the number of works the writer has written

The writers table originally has the following data:

name, num
Jane Austen,6
Charles Dickens,20
Ernest Hemingway,9
Jack Kerouac,22
F. Scott Fitzgerald,8
Mary Shelley,7
Charlotte Bronte,5
Mark Twain,11
Agatha Christie,73
Ian Flemming,14
J.K. Rowling,14
Stephen King,54
Oscar Wilde,1

Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writer's name and number of works. The following TODO sections must be completed.

  • Check if a writer exists in the writers table
  • If the writer exists in the table, locate an entry to be updated by writer's name and update the writer's value for num
  • If the writer does not exist in the table, add a new entry in the writers table and provide the value for name and num

Ex: If the input is:

y
J.K. Rowling
30
y
Elton John
y
62
n

The output is:

(ID, Name, Num)
(1, 'Jane Austen', 6)
(2, 'Charles Dickens', 20)
(3, 'Ernest Hemingway', 9)
(4, 'Jack Kerouac', 22)
(5, 'F. Scott Fitzgerald', 8)
(6, 'Mary Shelley', 7)
(7, 'Charlotte Bronte', 5)
(8, 'Mark Twain', 11)
(9, 'Agatha Christie', 73)
(10, 'Ian Flemming', 14)
(11, 'J.K. Rowling', 30)
(12, 'Stephen King', 54)
(13, 'Oscar Wilde', 1)
(14, 'Elton John', 62)

In: Computer Science

An article in the Journal of the American Medical Assocation described an experiment to investigate the...

An article in the Journal of the American Medical Assocation described an experiment to investigate the effect of four treatments on various body characteristics. In this double-blind experiment, each of 59 female subjects age 65 or older was assigned at random to one of the following four treatments:

1) P + P: placebo "growth hormone" and placebo "steroid"
2) P + S: placebo "growth hormone" and the steroid estradiol
3) G + P: growth hormone and placebo "steroid"
4) G + S: growth hormone and the steroid estradiol

The change in body fat mass was measured over the 26-week period following the treatments. Using the information provided above and in the partial table below, complete the ANOVA table (use 2 decimals for your answers).

Source of Variation df Sum of Squares Mean Square F
Treatment
Error 1.4 X
Total 226.37 X X

In: Statistics and Probability

1. the starting mass of your aspirin tablet(mg) 2. the amount of ASA recovered 3. the...

1. the starting mass of your aspirin tablet(mg)

2. the amount of ASA recovered

3. the calculated mass of excipients/binders that were not recovered

4. the melting point('c) of your isolated ASA

5. What is the percent isolation of the active ingredient, ASA? Provide your % isolation calculation ( Note: percent isolation is mg of ASA recovered/ manufacturer mg stipulated*100)

6. Describe some observations you found fascinating. Discuss the purpose of acquiring a melting point and what it means to a budding scientist, like you! Discuss how we might have lost material in the experiment

This experiment is Isolation of ASA from an Aspirin Tablet

Aspirin = 325mg

mass of tablet= 376mg

1grain=64.8, contain 5grains

tare weight of Aluminum weighing= 411mg

154 ASA isolated, % isolation= actual/theoretical=154/325*100=47%

In: Nursing

In 1954, an experiment was conducted to test the effectiveness of the Salk Vaccine as protection...

In 1954, an experiment was conducted to test the effectiveness of the Salk Vaccine as protection against the devastating effects of polio. Approximately 200,000 children were injected with an ineffective salt solution, and 200,000 other children were injected with the vaccine. The experiment was "double blind". Only 30 of the 200,000 vaccinated children later developed paralytic polio, whereas 120 of the 200,000 injected with the salt solution later developed paralytic polio.

a) Estimate the 95% confidence interval for the relative risk of the children in two groups.

b) Summarize the conclusion in one or two sentences. Use level of significance at 0.05 to make your conclusion by stating whether p-value is greater or less than cut off. Report the point estimate and 95% confidence interval of relative risk but describe it in plain words how much risk of one group is different than other group.

In: Statistics and Probability

Elementary statistics – Final assignment – Part two NOTE : Don’t use p-value for your decision...

Elementary statistics – Final assignment – Part two
NOTE : Don’t use p-value for your decision in hypothesis testing problem

Q2: a) You are interested in the average emergency room (ER) wait time at your local hospital. You
take a random sample of 50 patients who visit the ER over the past week. From this sample, the
mean wait time was 30 minutes and the standard deviation was 20 minutes. Find a 95%
confidence interval for the average ER wait time for the hospital. Interpret your result.
b) An experiment was carried out in which the result can either be a “positive” reaction or a
“negative” reaction. If the probability of a positive reaction is 0.4 and the experiment is repeated 6
times,
i) what is the probability that the number of positive reactions will be 2 times
ii) what is the probability that the number of positive reactions will be At least 1 times

In: Statistics and Probability

1. (1) There are similarities and differences between the Photoelectric Effect and Compton Scattering. Complete each...


1.










(1)
There are similarities and differences between the Photoelectric Effect and Compton Scattering. Complete each of the six partial statements below using the following guide; all you need to provide for an answer is PE, CS, BOTH, or NEITHER.

• PE if the statement only applies to the Photoelectric Effect
• CS if the statement only applies to Compton Scattering
• BOTH if the statement only applies to both the Photoelectric Effect and Compton Scattering
• NEITHER if the statement applies to Neither the Photoelectric Effect or Compton Scattering

a. Energy is conserved in _____.
Answer:
  

(1)
b. Photons are observed before and after the interaction in _____.
Answer:

(1)
c. Electrons are observed as the result of the experiment in _____.
Answer:

(1)
d. Angles are measured in the experiment in _____.
Answer:

(1)
e. Photons with very low energies such as 5.0 to 10.0 eV is observed in _____.
Answer:

(1)
f. Ionization occurs in _____.
Answer:

In: Physics

16. The following data are from an experiment comparing two treatments: Treatment 1 Treatment 2 10...

16. The following data are from an experiment comparing two treatments:

Treatment 1

Treatment 2

10

11

2

5

1

2

15

18

7

9

M = 7

M = 9

SS = 134

SS = 150

Assume that the data are from a repeated-measures experiment using the same sample of n = 5 subjects in both treatments. Calculate the difference score (D) for each subject and use the sample of difference scores to determine whether there is a significant difference between the two treatments. Again, use a two-tailed test with a = .05.

For the repeated measures analysis you did, which of the following is TRUE:

a.       the t you look up is on 8 degrees of freedom

b.      the t you compute is LESS than 2.776

c.       the treatment's effect is significant

d.      the treatment's effect is non-significant

In: Statistics and Probability

Post-lab: Neutralization Power of an Antacid 1) This experiment used the technique of back titration. Describe...

Post-lab: Neutralization Power of an Antacid

1) This experiment used the technique of back titration. Describe the process of back titration in 2-3 sentences. Why is back titration used instead of directly titrating a solution of antacid with 0.15 M HCl?

2) Phenolphthalein is an indicator which turns a pink color at a pH of 8.3. In this experiment, phenolphthalein is added to the antacid solution to indicate the equivalence point of the back titration. Phenolphthalein solution by itself is weakly acidic. If instead of adding one drop, a student adds several milliliters of the phenolphthalein solution, will this cause the student to under-estimate or over-estimate the neutralizing power of the antacid?

3) The active ingredient in Philips Milk of Magnesia is Mg(OH)2, in Amphojel it is Al(OH)3, and in Alka-Seltzer it is NaHCO3. Write balanced equations showing how each neutralizes stomach acid.

In: Chemistry

1. A) The freezing point of benzene, C6H6, is 5.500 °C at 1 atmosphere. Kf(benzene) =...

1. A)
The freezing point of benzene, C6H6, is 5.500 °C at 1 atmosphere. Kf(benzene) = 5.12 °C/m

In a laboratory experiment, students synthesized a new compound and found that when 11.43 grams of the compound were dissolved in 267.0 grams of benzene, the solution began to freeze at 4.740 °C. The compound was also found to be nonvolatile and a non-electrolyte.

What is the molecular weight they determined for this compound?

____g/mol

B) The boiling point of benzene, C6H6, is 80.100 °C at 1 atmosphere. Kb(benzene) = 2.53 °C/m

In a laboratory experiment, students synthesized a new compound and found that when 10.44 grams of the compound were dissolved in294.0 grams of benzene, the solution began to boil at 80.412 °C. The compound was also found to be nonvolatile and a non-electrolyte.


What is the molecular weight they determined for this compound ?

____g/mol

In: Chemistry