Questions
1.            Unknown bacteria #1 Gram-positive cocci Smooth, yellow colonies Growth, but not clearing or change on...

1.            Unknown bacteria #1

Gram-positive cocci

Smooth, yellow colonies

Growth, but not clearing or change on blood agar

Positive for urease production

Positive for gelatinase production

Bubbling produced when exposed to H2O2

Name: ___________________________________

2.            Unknown bacteria #2

Gram-positive cocci (mainly diplococci and chains)

Encapsulated

Produces green halo around growth on blood agar

No color change with oxidase reagent

No color change in urea broth

Produces a yellow color in glucose, lactose, and sucrose phenol red tubes

Name: ___________________________________

3.            Unknown bacteria #3

              

Gram-positive cocci

Encapsulated

No bubbling upon exposure to H2O2

VP negative

Produces a clearing around growth on blood agar

Facultative anaerobe

              

Name: __________________________________

   

4.          Unknown bacteria #4

              

Gram-negative bacillus

Abundant white growth

Encapsulated

Positive for nitrate reduction

Simmons citrate agar turns blue

Bubbling produced when exposed to H2O2

Name:__________________________________

5.            Unknown bacteria #5

Gram-negative bacillus

Creamy, mucoid, round colonies

Produces a green halo around growth on blood agar

Negative for all tests using SIM agar

No color change in nitrate test after adding reagents A and B plus zinc

TSI slant turns completely yellow

Name: ___________________________________

6.            Unknown bacteria #6

              

Gram-positive bacillus

Abundant white, waxy growth

Clearing around growth on blood agar

Ferments mannitol with acid production

Green oval structures visible using endospore stain

VP negative

Name: __________________________________

In: Nursing

Create a report that lists all the customers in alphabetical order by last name. The report...

Create a report that lists all the customers in alphabetical order by last name. The report should include first name, last name, and email address of all customers. This report involves getting data from one table.

The three items should be lined up in columns. Use one of the formatting functions available through Python (the % operator or the format function). Don’t use tabs to line up columns, this does not reliably work and is inflexible.1 Even though we won’t need formatting to line up columns in web pages, there are other aspects of formatting that we may still need. It is best to become familiar with one method now.

not sure how to print out the list alphabetically by last name

pizza_service.py

import sqlite3

class PizzaServices:

    def __init__(self):
        self.connection = sqlite3.connect("pizza-190807A.sqlite")

    def __enter__(self):
        return self

    def __exit__(self, exe_type, exc_val, exl_tb):
        crs = self.connection.cursor()

    def do_query(self, query, parameters=None):
        crs = self.connection.cursor()
        if parameters:
            crs.execute(query, parameters)
        else:
            crs.execute(query)

        return crs.fetchall()

    def customer(self):
        return self.do_query("select * from customer")

part1.py

from pizza_services import PizzaServices

with PizzaServices() as cs:
    cust = cs.customer()
    cmd1 = "select FirstName, LastName, Email from customer"
    resultSet= cs.do_query(cmd1)

templateH = "{:15}  {:15}  {:15}"
line = templateH.format("Last Name", "First Name", "email")
print(line)

for customer_row in resultSet:
    print('{:15} {:15} {:15}'.format(customer_row[0], customer_row[1], customer_row[2]))

In: Computer Science

Build and present a menu to a user like the following and enclose it into a...

  1. Build and present a menu to a user like the following and enclose it into a loop that ends when the Quit option is chosen. Scan the user's selection into an integer variable.
    1.  Enter user name.
    2.  Enter test scores.
    3.  Display average.
    4.  Display summary.
    5.  Quit.
    Selection:
  2. If the user selects Option #1, scan the user's name, and store it to a char array. Assume the user's name is under 20 characters.
  3. If the user selects Option #2, use a for-loop to scan 3 exam scores into a float array. Calculate the average and store the result in a float variable. Assume all scores are out of 100 points.  
  4. If the user selects Option #3, Display the average of the test scores. If the user has not yet entered test scores, display an error message similar to: "Please use the menu to enter test scores first"

    Hint: Use boolean values to keep track of the options that have been selected.
  5. If the user selects Option #4, display the average, the letter grade of the average, and the user's name. If the user has not yet entered their name or test scores, display an error message.

    Example: "Hello Charley, your test scores were 80, 90, and 100. Your average is 90.0 with letter grade: A."
    Example: "Please use the menu to enter your name first."

    Example: "Please use the menu to enter your test scores first."
  6. When the Quit option is chosen, end the primary loop that contains the menu.

c++ please

for while do while


could you write a c program please?

In: Computer Science

Linux Question: you will practice on creating and editing a text file by VI. How to:...

Linux Question: you will practice on creating and editing a text file by VI.

How to:

  1. Install JDK 1.8 by the following command:

$ sudo yum    –y    install    java-1.8.0-openjdk-devel.x86_64

  1. Use VI to create a file “YourFirstNameHomework.java” (e.g., “MollyHomework.java”) and add the following contents into it. (grading details: file name format:10 pts, a screenshot of the file content in the VI environment: 10pts, paragraphs: 10pts, empty lines and indentations: 10, text: 10pts)

Here's the code

import java.util.Scanner; // Import the Scanner class

class MollyHomework {

public static void main(String[] args) {

    Scanner myObj = new Scanner(System.in); // Create a Scanner object

    System.out.println("Enter your first name");

    String fName = myObj.nextLine(); // Read user input of the first name

    System.out.println("Enter your last name");

    String lName = myObj.nextLine(); // Read user input of the last name

    System.out.println("Hello " + fName + “ “ + lName); // Output user input   }

}

3.To compile the above java code, run the following command (you need to use your java file name):

$ javac MollyHomework.java

4. To execute the java program, run the following command

$ java MollyHomework

Question:

Describe how you created above file and its contents in VI.

  1. Bash/VI commands: 20pts;
  2. Non-brute-force solution: 10pts).

Note: Brute-force solution means that entering characters one by one.

*Show how the code looks or how you got it to work in your linux machine

In: Computer Science

Code needed in Java The purpose of the application is to generate some reports about the...

Code needed in Java
The purpose of the application is to generate some reports about the people of the university. So a user of the application should be able to view information about the people in the university and generate summaries. As in implementation these are separated into two major categories, employee and students, we will be implementing these classes.  


The system should have three classes: Person, Employee and Student.Employees and students are subclasses of persons and therefore, they inherit some fields and methods from the superclass Person. What Employee class has as an extra is a field called job which is a String value that indicates the position of the employee at the university. The possible values are ‘Faculty’ and ‘Staff’ and the rest of the input should be rejected. Another significant field is UIN (you may assume it to be an integer).Students also have a similar structure. A field called level, gives information regarding the student. Possible values are ‘Undergraduate’ and ‘Graduate’ and the rest of the input should be rejected. Also A number should be implemented (you may assume A number to be a string).  
Once you create these classes write your test class with main method.  


The output of such an application would look like:  

Person’s first name is Triss, last name is Merigold. She is 25 years old.
Person’s first name is Sigismund, last name is Dijkstra. He is 37 years old. His UIN is 793942 and serves the university as a staff.
Person’s first name is Keira, last name is Metz. She is 19 years old. Her A-number is A021318 and she is an undergraduate student

In: Computer Science

This should be written in C++. Create a class with the name "Student". private data members...

This should be written in C++.

Create a class with the name "Student".

private data members of the Student class should include:

int - rollno (roll number or id number of student)

string - name (name of student)

int - alg, datastruct, architect, proglang (hold scores out of 100 for these 4 classes)

float - per (average score of 4 classes above)

char - grade (letter grade based on per.. example 90 is an A)

public member functions of the Student class should include:

getdata() (function to accept data from user

showdata() (function to show data on screen

Create a constructor that initializes all int to 0, float to 0.0, char to ' ', name = "NoName".

Prompt the user for a valid class size.

Prompt the user for student data.

Store students in a vector.

Display student data including students average score and letter grade.

The following is an example:

Enter size of class: 0
Invalid class size

Enter size of class: 1

Enter the roll number of student: 45
Enter The Name of student: Trish Duce
Enter the grade in Algorithms out of 100: 88
Enter the grade in Data Structures out of 100: 94
Enter the grade in Architecture out of 100: 98
Enter the grade in Programming Languages out of 100: 92

Roll number of student: 45
Name of student: Trish Duce
Grade in Algorithms: 88
Grade in Data Structures: 94
Grade in Architecture: 98
Grade in Programming Languages: 92
Percentage of student is: 93
Grade of student is: A

In: Computer Science

Q.1 Write a python program that will take in basic information from a student, including student...

Q.1 Write a python program that will take in basic information from a student, including student name, degree name, number of credits taken so far, and the total number of credits required in the degree program. The program will then calculate how many credits are needed to graduate. Display should include the student name, the degree name, and credits left to graduate.

Write two print statements in this program. In the first one, use the .format method with pre-specified order of the displayed outputs.

In the second print, using different % operators to display the output. Make sure to display the output in an aligned format (look into a sample of the output below..).

Student name: xyz xyz

Degree name: comp. engineering

Credit taken so far:                                       13

Total number of credits required: 33

Number of credits needed to graduate: 20

Q.2  Write a python program that will take in the number of call minutes used. Your program will calculate the amount of charge for the first 200 minutes with a rate of $0.25; the remaining minutes with a rate of $0.35. The tax amount is calculated as 13% on top of the total. The customer could have a credit that also has to be considered in the calculation process. Finally, the program displays all these information. Below is a sample run:

Customer account number:                                        12345

Minutes used:                                                                (you provide)

Charge for the first 200 minutes@ 0.25:                (you provide)

Charge for the remaining minutes@ 0.35:             (you provide)     

Taxes:                                                                              (you provide)

Credits:                                                                            (you provide)

Total bill:                                                                         (you provide)

please provide .py program file screenshot and output.

In: Computer Science

Examine the following code, which contains six common bugs. In a separate Microsoft Word (or other...

Examine the following code, which contains six common bugs. In a separate Microsoft Word (or other word processing or text file), identify the line number of at least three (3) bugs as well as a brief description of each bug. 1. 2.

1. <!DOCTYPE html>

2. </html>

3. <head> <link rel="stylesheet" href="MyStyle.css"> </head>

4. <body>

5. <nav>

6. <a href="GroceryHome.html">Home</a> |

7. <a href="Products.html">Products</a> |

8. <a href="AboutUs.html">About Us</a> |

9. <a href="Contact.html">Contact</a>

10. </nav>

11. <header>

12. <h1> My Contact Page</h1>

13. </header>

14. <article>

15. Thank you for your interest in our grocery store. We offer delivery or call-ahead pickup services.

Please provide your contact information, and indicate your family's food preferences.

16. </article> <p>

17. <form action="#" method="post" id="form1">

18. <div class="div1">

19. <label for="fname1" >First Name:</label><br>

20. <input type="text" name="firstname1" id="fname1"><br>

21. <label for="lname1" >Last Name:</label><br>

22. <input type="text" name="lastname1" id="lname1"><br>

23. <label for="phone1" >Phone (i.e. 123-456-7890):</label><br>

24. <input type="text" name="phone1" id="phone1" placeholder="123-456-7890" ><br>

25. <label for="email1" >Email:</label><br>

26. <input type="text" name="email1" id="email1" placeholder="abc@xyz"><br>

27. <label for="contactpreference1" >Prefered contact method?</label><br>

28. <input type="radio" name="contactpreference1" value="phone" checked> Phone

29. <input type="radio" name="contactpreference1" value="email"> Email

30. <br><br>

31. <input type="submit" id="Submit1" value="Submit" onclick=" validateMyPage()" />

32. </div>

33. </form>

34. <form action="#" method="post" id="form2" >

35. <div class="div2">

36. <label for="fname2" >First Name:</label><br>

37. <input type="text" name="firstname2 id="fname2" required><br>

38. <label for="lname2" >Last Name:</label><br>

39. <input type="text" name="lastname2" id="lname2" required><br>

40. <label for="phone2" >Phone (i.e. 123-456-7890):</label><br>

41. <input type="tel" name="phone2" id="phone2" placeholder="123-456-7890" pattern='\d{3}[\-

]\d{3}[\-]\d{4}' required><br>

42. <label for="email2" >Email:</label><br>

43. <input type="email" name="email2" id="email2" placeholder="[email protected]" required><br>

44. <label for="contactpreference2" >Prefered contact method?</label><br>

45. <input type="radio" name="contactpreference2" value="phone" checked> Phone

46. <input type="radio" name="contactpreference2" value="email"> Email

47. <br><br>

48. <input type="submit" id="Submit2" value="Submit" />

49. </div>

50. <br><br>

51. <div class="myColumns ">

52. <select id="mySiteColor" onChange="changeColor(this.value)">

53. <option value="">-- Select a color --</option>

54. <option value="blue">Blue</option>

55. <option value="yellow">Yellow</option>

56. <option value="red">Red</option>

57. </select>

58. </div>

59. </form>

60. <script>

61. function validateMyPage() {

62. var firstname1 = document.getElementById("fname1").value;

63. if (firstname1 != "") {

64. alert("Please enter a first name.");

65. }

66. else {

67. alert(firstname1);

68. }

69. var phone1 = document.getElementById("phone1").value;

70. if (phone1 == "") {

71. alert("Please enter a phone number.");

72. return false;

73. }

74. else

75. {

76. var rePhone = new RegExp(/\d{3}[\-]\d{3}[\-]\d{4}/);

77. var reResult = rePhone.test(phone1);

78. if (reResult == false)

79. {

80. alert("Please provide a valid phone number in the format of: 222-222-2222.");

81. return false;

82. }

83. else

84. {

85. alert(phone1);

86. }

87. }

88. var email1 = document.getElementById("email1")!value;

89. if (email1 == "") {

90. alert("Please enter an email address.");

91. return false;

92. }

93. else

94. {

95. var reEmail = new RegExp(/[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$/);

96. var reResult == reEmail.test(email1);

97. if (reResult == false)

98. {

99. alert("Please provide a valid email address.");

100. return false;

101. }

102. else

103. {

104. alert(“email1”);

105. }

106. }

107. alert("Form data validated by JavaScript successfully!");

108. }

109. function changeColor(value) {

a. var myColor = document.getElementById("mySiteColor").value;

b. document.body.style.color = value;

110. }

111. </script>

112. </body>

113. </html>

In: Computer Science

Complete the three empty methods (remove(), find(), and contains()) in the ShoppingListArrayList.java file. These methods are...

  1. Complete the three empty methods (remove(), find(), and contains()) in the ShoppingListArrayList.java file. These methods are already implemented in the ShoppingListArray class.
  2. Complete the ShoppingListArrayListTest.java (For many tests, we now just throw a false statement which will cause the test cases to fail. You need to complete them.)

ShoppingListArrayList

package Shopping;

import DataStructures.*;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

/**
* @version Spring 2019
* @author Paul Franklin, Kyle Kiefer
*/
public class ShoppingListArrayList implements ShoppingListADT {

private ArrayList<Grocery> shoppingList;

/**
* Default constructor of ShoppingArray object.
*/
public ShoppingListArrayList() {
this.shoppingList = new ArrayList<>();
}

/**
* Constructor of ShoppingArray object that parses from a file.
*
* @param filename the name of the file to parse
* @throws FileNotFoundException if an error occurs when parsing the file
*/
public ShoppingListArrayList(String filename) throws FileNotFoundException {
this.shoppingList = new ArrayList<>();
scanFile(filename);
}

/**
* Method to add a new entry. Only new entries can be added. Combines
* quantities if entry already exists.
*
* @param entry the entry to be added
*/
@Override
public void add(Grocery entry) {

// Check if this item already exists
if (this.contains(entry)) {
//Merge the quantity of new entry into existing entry
combineQuantity(entry);
return;
}

shoppingList.add(entry);
}

/**
* Method to remove an entry.
*
* @param ent to be removed
* @return true when entry was removed
* @throws DataStructures.ElementNotFoundException
*/
@Override
public boolean remove(Grocery ent) {
  
// the boolean found describes whether or not we find the
// entry to remove
  
boolean found = false;

// search in the shoppingList, if find ent in the
// list remove it, set the value of `found'

// Return false if not found
return found;
}

/**
* Method to find an entry.
*
* @param index to find
* @return the entry if found
* @throws Exceptions.EmptyCollectionException
*/
@Override
public Grocery find(int index) throws IndexOutOfBoundsException,
EmptyCollectionException {
if (this.isEmpty()) {
throw new EmptyCollectionException("ECE - find");
}
  
throw new IndexOutOfBoundsException("ArrayList - find");
  
// check whether or not the input index number is legal
// for example, < 0 or falls outside of the size
  
// return the corresponding entry in the shoppingList
// need to change the return value
// return null;
}

/**
* Method to locate the index of an entry.
*
* @param ent to find the index
* @return the index of the entry
* @throws ElementNotFoundException if no entry was found
*/
@Override
public int indexOf(Grocery ent) throws ElementNotFoundException {
for (int i = 0; i < shoppingList.size(); i++) {
if (shoppingList.get(i).compareTo(ent) == 0) {
return i;
}
}

throw new ElementNotFoundException("indexOf");
}

/**
* Method to determine whether the object contains an entry.
*
* @param ent to find
* @return true if and only if the entry is found
*/
@Override
public boolean contains(Grocery ent) {
boolean hasItem = false;

// go through the shoppingList and try to find the
// item in the list. If found, return true.

return hasItem;
}

/**
* Gets the size of the collection.
*
* @return the size of the collection
*/
@Override
public int size() {
return shoppingList.size();
}

/**
* Gets whether the collection is empty.
*
* @return true if and only if the collection is empty
*/
@Override
public boolean isEmpty() {
return shoppingList.isEmpty();
}

/**
* Returns a string representing this object.
*
* @return a string representation of this object
*/
@Override
public String toString() {
StringBuilder s = new StringBuilder();
s.append(String.format("%-25s", "NAME"));
s.append(String.format("%-18s", "CATEGORY"));
s.append(String.format("%-10s", "AISLE"));
s.append(String.format("%-10s", "QUANTITY"));
s.append(String.format("%-10s", "PRICE"));
s.append('\n');
s.append("------------------------------------------------------------"
+ "-------------");
s.append('\n');
for (int i = 0; i < shoppingList.size(); i++) {
s.append(String.format("%-25s", shoppingList.get(i).getName()));
s.append(String.format("%-18s", shoppingList.get(i).getCategory()));
s.append(String.format("%-10s", shoppingList.get(i).getAisle()));
s.append(String.format("%-10s", shoppingList.get(i).getQuantity()));
s.append(String.format("%-10s", shoppingList.get(i).getPrice()));
s.append('\n');
s.append("--------------------------------------------------------"
+ "-----------------");
s.append('\n');
}

return s.toString();
}

/**
* Add the quantity of a duplicate entry into the existing
*
* @param entry duplicate
*/
private void combineQuantity(Grocery entry) {
try {
int index = this.indexOf(entry);
shoppingList.get(index).setQuantity(
shoppingList.get(index).getQuantity()
+ entry.getQuantity());
} catch (ElementNotFoundException e) {
System.out.println("combineQuantity - ECE");
}

}

/**
* Scans the specified file to add items to the collection.
*
* @param filename the name of the file to scan
* @throws FileNotFoundException if the file is not found
*/
private void scanFile(String filename) throws FileNotFoundException {
Scanner scanner = new Scanner(getClass().getResourceAsStream(filename))
.useDelimiter("(,|\r\n)");

while (scanner.hasNext()) {
Grocery temp = new Grocery(scanner.next(), scanner.next(),
Integer.parseInt(scanner.next()),
Float.parseFloat(scanner.next()),
Integer.parseInt(scanner.next()));
  
add(temp);
}
}

}

ShoppingListArrayListTest

package Shopping;

import DataStructures.*;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;

/**
* @version Spring 2019
* @author Paul Franklin, Kyle Kiefer
*/
public class ShoppingListArrayListTest {

private ShoppingListArrayList instance;

/**
* Initialize instance and entries
*/
@Before
public void setupTestCases() {
instance = new ShoppingListArrayList();
}

/**
* Test of add method, of class ShoppingArray.
*/
@Test
public void testAdd() {
  
assertTrue(0==1);
}

/**
* Test of remove method, of class ShoppingArrayList.
*/
@Test
public void testRemove() {
assertTrue(0==1);
}

/**
* Test of find method, of class ShoppingArrayList.
*/
@Test
public void testFind() {
assertTrue(0==1);
}

/**
* Test of indexOf method, of class ShoppingArrayList.
*/
@Test
public void testIndexOf() {
assertTrue(0==1);
}

/**
* Test of contains method, of class ShoppingArrayList.
*/
@Test
public void testContains() {
assertTrue(0==1);
}

/**
* Test of size method, of class ShoppingArrayList.
*/
@Test
public void testSize() {
Grocery entry1 = new Grocery("Mayo", "Dressing / Mayo", 1, 2.99f, 1);

assertEquals(0, instance.size());

instance.add(entry1);

// Test increment
assertEquals(1, instance.size());

assertTrue(instance.remove(entry1));

// Test decrement
assertEquals(0, instance.size());
}

/**
* Test of isEmpty method, of class ShoppingArrayList.
*/
@Test
public void testIsEmpty() {
Grocery entry1 = new Grocery("Mayo", "Dressing / Mayo", 1, 2.99f, 1);

// Test empty
assertTrue(instance.isEmpty());

instance.add(entry1);

// Test not empty
assertFalse(instance.isEmpty());
}

}

package Shopping;

import DataStructures.*;

/**
* @version Spring 2019
* @author Paul Franklin, Kyle Kiefer
*/
public interface ShoppingListADT {
  
/**
* Method to add a new entry. Only new entries can be added. Combines
* quantities if entry already exists.
*
* @param entry the entry to be added
*/
public void add(Grocery entry);
  
/**
* Method to remove an entry.
*
* @param ent to be removed
* @return true when entry was removed
*/
public boolean remove(Grocery ent);
  
/**
* Method to find an entry.
*
* @param index to find
* @return the entry if found
* @throws Exceptions.EmptyCollectionException
*/
public Grocery find(int index) throws IndexOutOfBoundsException,
EmptyCollectionException;
  
/**
* Method to locate the index of an entry.
*
* @param ent to find the index
* @return the index of the entry
* @throws ElementNotFoundException if no entry was found
*/
public int indexOf(Grocery ent) throws ElementNotFoundException;
  
/**
* Method to determine whether the object contains an entry.
*
* @param ent to find
* @return true if and only if the entry is found
*/
public boolean contains(Grocery ent);
  
/**
* Gets the size of the collection.
*
* @return the size of the collection
*/
public int size();
  
/**
* Gets whether the collection is empty.
*
* @return true if and only if the collection is empty
*/
public boolean isEmpty();
  
/**
* Returns a string representing this object.
*
* @return a string representation of this object
*/
@Override
public String toString();
}

In: Computer Science

Cl2 + 10CO2 + 6H2O 5H2C2O4 + 2ClO3- + 2H+ For the above redox reaction, assign...

Cl2 + 10CO2 + 6H2O 5H2C2O4 + 2ClO3- + 2H+ For the above redox reaction, assign oxidation numbers and use them to identify the element oxidized, the element reduced, the oxidizing agent and the reducing agent. name of the element oxidized: name of the element reduced: formula of the oxidizing agent: formula of the reducing agent:

In: Chemistry