In the Python:
Note 1: You may not use these python built-in functions:
sorted(), min(), max(), sum(), pow(), zip(), map(), append(), count() and counter().
(7 points) unique.py: A number in a list is unique if it appears only once. Given a list of
random numbers, print the unique numbers and their count. Print the duplicate numbers and
their count.
Sample runs:
Enter the size of the list : 7
[8, 2, 6, 5, 2, 4, 5]
There are 3 unique numbers: 8 6 4
There are 2 duplicate numbers: 2 5
Sample run:
Enter the size of the list : 7
[2, 2, 4, 3, 3, 3, 4]
There are 0 unique numbers:
There are 3 duplicate numbers: 2 3 4
In: Computer Science
Two 50 ?? long, thin parallel straight wires (grey) are connected at their ends by metal springs. The mass of each thin wire is 1.0 ?. The upper wire is connected to the ceiling by (non-conducting) stiff rods. Each spring has an equilibrium length of 5.0 ?? and a spring constant of ? = 0.50 ?/?. A steady current ? runs clockwise through the wire-spring loop as indicated by the arrow. At equilibrium, the lower rod hangs at a level 6.0 ?? below the upper wire. Find the magnitude of the current. You may ignore the magnetic fields generated by the springs, and you may approximate the magnetic fields generated by the wires as those from long, straight wires
In: Physics
Two blocks, of weights 3.5 N and 5.8 N, are connected by a massless string and slide down a 39° inclined plane. The coefficient of kinetic friction between the lighter block and the plane is 0.064; that between the heavier block and the plane is 0.30. Assuming that the lighter block leads, find (a) the magnitude of the acceleration of the blocks and (b) the tension in the string.
In: Physics
In the figure below, the hanging object has a mass of m1 = 0.410 kg; the sliding block has a mass of m2 = 0.765 kg; and the pulley is a hollow cylinder with a mass of M = 0.350 kg, an inner radius of R1 = 0.020 0 m, and an outer radius of R2 = 0.030 0 m. Assume the mass of the spokes is negligible. The coefficient of kinetic friction between the block and the horizontal surface is ?k = 0.250. The pulley turns without friction on its axle. The light cord does not stretch and does not slip on the pulley. The block has a velocity of vi = 0.820 m/s toward the pulley when it passes a reference point on the table.
(a) Use energy methods to predict its speed after it has moved
to a second point, 0.700 m away.
m/s
(b) Find the angular speed of the pulley at the same moment.
rad/s
In: Physics
Q: Why do you want to be a CPO peer educator? CPO stands for Center for Prevention outreach. I would love someone with experience to provide insights to their personal story.
Q: What experience do you have talking about health and wellness with your peers (high school or college)? Again I hope someone with experience provide insights.
Much appreciation, thank you!
In: Psychology
Taking a test on "Inheritance" in C++ tomorrow. So far we have learned about classes, structs and arrays and strings. We will be provided with coding prompts and have to hand write codes that show examples of inheritance (most likely including some of the earlier concepts as well).
I would like some code examples such as this to study and look over with comments please.
In: Computer Science
NOTE THIS QUESTION HAS SIX ANSWERS. BE CLEAR WITH YOUR ANSWERS BY LABELING EACH ANSWER.
|
Output per hour of work |
Output per hour of work |
|
|
Catfish |
Cowboy Boots |
|
|
Arkansas |
6 |
2 |
|
Tennessee |
3 |
2 |
The table above describes the output per hour worker measured as pounds of catfish and pairs of cowboy boots in Arkansas and Tennessee.
A) Who has the absolute advantage in producing Catfish?
B) For Arkansas, the opportunity cost of one more pound of catfish is ________ pair of boots.
C) For Arkansas, the opportunity cost of one more pair of boots is __________ pounds of catfish.
D) For Tennesseee, the opportunity cost of one more pound of catfish is ________ pair of boots.
E) For Tennessee, the opportunity cost of one more pair of boots is __________ pounds of catfish.
F) Who has the comparative advantage in cowboy boots?
In: Economics
1. If you were to have a starch-rich diet, which plants and their parts, would you use? Give 3 examples, and justify each. 2. Name 3 plants belonging to the mustard family [Brassicaceae]. Mention how we use them. 3. Name 3 plants belonging to the carrot family [Apiaceae]. Mention how we use them. 4. Besides peppers, which other important crop comes from the nightshade family [Solanaceae}? Mention 3 facts about it.
In: Biology
At 700 K acetaldehyde decomposes in the gas phase to methane and
carbon monoxide. The reaction
isCH3CHO(g)?CH4(g)+CO(g)
A sample of CH3CHO is heated to 700 K and the pressure is measured
as 0.20 atm before any reaction takes place. The kinetics of the
reaction are then followed by measurements of total pressure and
these data are obtained:
| t(s) | 0 | 1000 | 3000 | 7000 |
| PTotal (atm) | 0.20 | 0.22 | 0.24 | 0.28 |
Rate law --> Rate=??PCH3CHO?t=4.510?4atm?1?s?1PCH3CHO2
Find total pressure after 1.17104s
In: Chemistry
Q1. The crankshaft in a race car goes from rest to 3100rpm in 2.8s.What is the crankshaft's angular acceleration?
Q2. A frictionless pulley, which can be modeled as a 0.83kg solid cylinder with a 0.30m radius, has a rope going over it, The tensions in the rope are 12N and 10N . What is the angular acceleration of the pulley?
Q3. A 1.2g pebble is stuck in a tread of a 0.73m -diameter automobile tire, held in place by static friction that can be at most 3.3N . The car starts from rest and gradually accelerates on a straight road. How fast is the car moving when the pebble flies out of the tire tread?
In: Physics
An unknown pollutant gas has contaminated one of your samples of Ne(g). You test your Ne sample, at constant T and P and find that it effuses through a balloon 3.87 times more rapidly than a pollutant. What is the molar mass of the pollutant gas?
In: Chemistry
Consider two individuals with the same income and probability of experiencing an accident that would cost them $15,000 in medical expenses. The first individual has the utility function U=ln(Y) and the second has the utility function U=ln(Y)+10. How would their willingness to pay for an insurance policy to cover all of their medical expenses differ between the two individuals?
In: Economics
Question 1) What affect would switching from a lipophilic to a hydrophilic solvent have on the overall rate of an SN1 reaction mechanism? Explain your answer.
Question 2) What affect would switching from a hydrophilic to a lipophilic solvent have on the overall rate of an SN2 reaction mechanism? Explain your answer.
3 MARK QUESTIONS EACH
In: Chemistry
Write a shoppingcartmanager.java that contains a main method for this code in java
Itemtopurchase.java
public class ItemToPurchase {
// instance variables
private String itemName;
private String itemDescription;
private int itemPrice;
private int itemQuantity;
// default constructor
public ItemToPurchase() {
this.itemName = "none";
this.itemDescription =
"none";
this.itemPrice = 0;
this.itemQuantity = 0;
}
public ItemToPurchase(String itemName, int itemPrice,
int itemQuantity,String itemDescription) {
this.itemName = itemName;
this.itemDescription =
itemDescription;
this.itemPrice = itemPrice;
this.itemQuantity =
itemQuantity;
}
// method to set name of the item
public void setName(String name) {
itemName = name;
}
// method to set price of the item
public void setPrice(int price) {
itemPrice = price;
}
// method to set quantity of the item
public void setQuantity(int quantity) {
itemQuantity = quantity;
}
public void setDescription(String description) {
itemDescription =
description;
}
// method to get name of the item
public String getName() {
return itemName;
}
// method to get price of the item
public int getPrice() {
return itemPrice;
}
// method to get quantity of the item
public int getQuantity() {
return itemQuantity;
}
public String getDescription() {
return itemDescription;
}
public void printItemPurchase() {
System.out.println(itemName + " " +
itemQuantity + " @ $" + itemPrice + " = $" + (itemPrice *
itemQuantity));
}
public void printItemDescription() {
System.out.println(itemName+":
"+itemDescription);
}
}
*******************
shoppingcart.java
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class ShoppingCart {
private String customerName;
private String currentDate;
private List<ItemToPurchase> cartItems=new
ArrayList<>();
ShoppingCart() {
customerName = "none";
currentDate = "January 1,
2016";
}
ShoppingCart(String customerName, String currentDate)
{
super();
this.customerName =
customerName;
this.currentDate =
currentDate;
}
public String getCustomerName() {
return customerName;
}
public String getDate() {
return currentDate;
}
public void addItem(ItemToPurchase item) {
cartItems.add(item);
}
public void removeItem(String itemName) {
boolean check = false;
for (ItemToPurchase item :
cartItems) {
if(item.getName().equalsIgnoreCase(itemName)) {
cartItems.remove(item);
check=true;
}
}
if(!check)
System.out.println("Item not found in cart. Nothing
removed.");
}
public void modifyItem(ItemToPurchase item) {
boolean check = false;
for (ItemToPurchase itemToPurchase
: cartItems) {
if(itemToPurchase.getName().equalsIgnoreCase(item.getName()))
{
cartItems.remove(itemToPurchase);
cartItems.add(item);
check=true;
}
}
if(!check)
System.out.println("Item not found in cart. Nothing
modified.");
}
public int getNumItemsInCart() {
int total=0;
for (ItemToPurchase item :
cartItems) {
total+=item.getQuantity();
}
return total;
}
public int getCostOfCart() {
int cost=0;
for (ItemToPurchase item :
cartItems) {
cost+=item.getPrice()*item.getQuantity();
}
return cost;
}
public void printTotal() {
System.out.println(customerName+"'s
Shopping Cart - "+currentDate);
System.out.println("Number of
Items: "+getNumItemsInCart());
System.out.println();
for (ItemToPurchase item :
cartItems) {
System.out.println(item.getName()+" "+item.getQuantity()+" @
$"+item.getPrice()+" =
$"+(item.getQuantity()*item.getPrice()));
}
System.out.println();
System.out.println("Total:
$"+getCostOfCart());
}
public void printDesciptions() {
System.out.println(customerName+"'s
Shopping Cart - "+currentDate);
System.out.println();
System.out.println("Item
Descriptions");
for (ItemToPurchase item :
cartItems)
System.out.println(item.getName()+":
"+item.getDescription());
}
public static void main(String[] args) {
Scanner sc=new
Scanner(System.in);
System.out.println("Enter
Customer's Name:");
String name=sc.nextLine();
System.out.println("Enter Today's
Date:");
String date=sc.nextLine();
ShoppingCart cart=new
ShoppingCart(name,date);
System.out.println();
System.out.println();
}
}
In: Computer Science
You are given an unlabelled water sample with the below MPN tube results presented as volume of raw sample followed by number of positive tubes out of 5 total tubes incubated. 1 mL : 2/5 positive, 0.1 mL : 1/5 positive, 0.01 mL : 0/5 positive
Report the estimated titre and 95% confidence interval.
Indicate a potential source based on the magnitude of coliform contamination and
provide your reasoning.
In: Biology