python- please finish the three programs, where one flips an image horizonally, then vertically, and one that rotates an image by 90 degrees. please don't use the functions .mirror() .flip() or .rotate() if possible. thanks
def horizontal(image):
"""Flip the specified image left to right and return the modified
image"""
return img
def vertical(image):
"""Flip the specified image upside down and return the modified
image"""
return image
def rotate_90(image):
"""Rotate the specified image 90 degrees to the right and return
the modified image"""
return image
In: Computer Science
A cat rides a merry go round turning with uniform circular motion. At time t1=2.00s, the cat's velocity is gives by Vx = 3.00 m/s and Vy = 4.00 m/s. At t2 = 5.00 s,the cat's velocity is give by Vx = -3.00 m/s and Vy = -4.00 m/s. Take the coordinate system of the merry go round to have its origin at the center.
(a) What is the magnitude of the cat's centripetal acceleration?
(b) What is the magnitude of the cat's average acceleration during the time interval t2-t1?
(c) Assuming uniform circular motion before t1, what would have been the x-y coordinate location of the cat at t0= 0.00 s?
(d) What angle relative to the positive y-axis does the centripetal acceleration vector point at t= 3.00 s?
In: Physics
Think about the television programs and films you have seen recently that depicted business in some way. How were businesses and business people portrayed? Is there anything business could or should do to improve its media image? Some businesses try to stay out of the limelight. Why might that be? What do you think of that strategy? Do you believe that employees are more attracted and committed to ethical organizations? Are you? Why or why not?
In: Economics
A body moves along a straight line, its distance from the origin at any instant being given by the equation x = 8t − 3t^2, where x is in centimeters and t is in seconds.
(a) Find the average velocity of the body in the interval from t = 0 to t = 1 sec, and in the interval from t = 0 to t = 4 sec.
(b) Find the expression for the average velocity in the interval from t to t + Δt.
(c) What is the limiting value of this expression as Δt approaches zero?
(d) Find the time or times at which the body is at rest. (e) Find the expression for the acceleration at any time.Type or paste question here
In: Physics
In: Economics
Create a new program, called stars.py, for (eventually) drawing a 500x500 pixel picture of the night sky. The stars.py file will define several custom functions. You should write each function and then test it to verify it is working correctly. Make sure you match each function name precisely. Once complete submit it to D2L.
getStarPixelX()
Below are some example function calls and return values. You should test them by having your program call the function and print out the return value. (You can erase your test code later.)
getStarPixelY()
Below are some example function calls and return values. You should test them by having your program call the function and print out the return value. (You can erase your test code later.)
getStarSize()
Below are some example function calls and return values. You should test them by having your program call the function and print out the return value. (You can erase your test code later.)
getStarName()
Below are some example function calls and return values. You should test them by having your program call the function and print out the return value. (You can erase your test code later.)
In: Computer Science
Sources: linkedlist.cpp
#include <iostream>
#include "linkedlist.h"
using namespace std;
LinkedList* NewLinkedList()
{
LinkedList* llp = new LinkedList;
llp->head = new node;
llp->head->next = 0;
return llp;
}
void InsertFirst(LinkedList* llp, int val)
{
node* p = new node;
p->data = val;
p->next = llp->head->next;
llp->head->next = p;
}
void Print(LinkedList* llp)
{
for (node* p = llp->head->next; p != 0; p = p->next)
{
cout << p->data << " ";
}
}
void InsertLast(LinkedList* llp, int val)
{
node* p;
for (p = llp->head; p->next != 0; p = p->next)
{
}
// p now points to the last node in the list
// For you to do: Create a new node, store val in that node, and link the new node after p.
}
Sources: hw1.cpp
#include <iostream>
#include "linkedlist.h"
using namespace std;
int main()
{
LinkedList* llp = NewLinkedList();
InsertFirst(llp, 10);
InsertFirst(llp, 20);
InsertFirst(llp, 30);
cout << endl;
Print(llp);
cout << endl;
InsertLast(llp, 50);
InsertLast(llp, 60);
InsertLast(llp, 70);
cout << endl;
Print(llp);
cout << endl;
return 0;
}
Header: linkedlist.h
#ifndef LINKEDLIST_H_INCLUDED
#define LINKEDLIST_H_INCLUDED
struct node {
int data;
node* next;
};
struct LinkedList {
node* head;
};
LinkedList* NewLinkedList();
void InsertFirst(LinkedList* llp, int val);
void Print(LinkedList* llp);
void InsertLast(LinkedList* llp, int val);
#endif // LINKEDLIST_H_INCLUDED
-----------------------------
Your assignment is to complete the function InsertLast in linkedlist.cpp, compile, and run. The correct output should be:
30 20 10
30 20 10 50 60 70
In: Computer Science
Tobacco smoke, containing at least 50 known carcinogens, is often considered the most harmful and widespread contaminant of indoor air. Many airports have a designated smoking area to prevent these contaminants from spreading to the rest of the airport. Consider one such smoking area with a volume of 15 m×15 m×4 m that has 35 persons smoking two cigarettes every hour. One of the gases coming out of a cigarette is formaldehyde and each cigarette may be assumed to emit 1.35 mg of formaldehyde. Conversion of formaldehyde to carbon dioxide can be assumed to be first order and the rate of reaction is 0.40 per hour. Outside (fresh) air enters the enclosed space at the rate of 800 m3 per hour. Assume the smoke becomes completely mixed with air and this smoke-mixed air leaves the enclosed space at the same rate that the fresh air enters. Initially the formaldehyde value is zero. (a) What is the concentration of formaldehyde in the room air at steady state? (b) If the threshold for eye irritation due to formaldehyde is 0.05 ppm (parts per million), what minimum flow rate of fresh air needs to be maintained for the enclosed space? [At the assumed temperature of 25°C and pressure of 1 atm for the enclosed space, convert the formaldehyde concentration to ppm using the formula ppm =mg/m3×24.45/M, where M is 30, the molecular weight of formaldehyde]
In: Chemistry
Question about Hard Disks
1. For Redundant Arrays of Inexpensive Disks, which of the following two has more reliability? The Level 0 + 1 (Striping + Mirroring) or Level 1 + 0 (Mirroring + Striping)? Why?
2. Why does the Elevator have better performance than Shortest Seek Time First algorithm for a heavy load? (Elevator is also called the SCAN or C-SCAN)
3. Do accesses to sectors in outer tracks require less time compared to accesses sectors to inner tracks? Why or why not?
In: Computer Science
The big prediction here is how the masses, the radius, the period, and the angle interrelate. Please predict the angle that the string makes below the horizontal (the angle of declination) for the following combinations of masses, radii, and periods:
m (whirling mass) = 0.010 kg
m (hanging weight) = 0.100 kg
radius = 1 meter period =
1 second per revolution
In: Physics
A particle is represented by the following wave function:
| ψ(x) =0 | x<−1/2 | |
| ψ(x) =C(2x + 1) | −1/2 < x < 0 | |
| ψ(x) =C(−2x + 1) | 0 < x < +1/2 | |
| ψ(x) =0 | x > +1/2 |
(a) Use the normalization condition to find C ?
(b) Evaluate the probability to find the particle in an interval of
width 0.01 at x = 0.1 (that is, between x = 0.095 and x =
0.105.)(No integral is necessary for this calculation.)
(c)Evaluate the probability to find the particle between x=0.19 and
x=0.35.
(d) Find the average values of x and x2, and the
uncertainty of x:
Δx=√(x2)av-(xav)2
| xav= | |
| (x2)av= | |
| Δx = |
In: Physics
Create the program using C#
A business records its daily sales totals. Enter the following weekly sales information into an array.
1245.67
1189.55
1089.72
1456.88
2109.34
1987.55
1872.36
Once, the information has been entered into the array. Access the items in the array to find and display the following:
In: Computer Science
In: Computer Science
You have been asked to prepare a December cash budget for Ashton Company, a distributor of exercise equipment. The following information is available about the company’s operations:
The cash balance on December 1 is $45,000.
Actual sales for October and November and expected sales for December are as follows:
| October | November | December | ||||
| Cash sales | $ | 80,800 | $ | 74,000 | $ | 98,200 |
| Sales on account | $ | 525,000 | $ | 559,000 | $ | 643,000 |
Sales on account are collected over a three-month period as follows: 20% collected in the month of sale, 60% collected in the month following sale, and 18% collected in the second month following sale. The remaining 2% is uncollectible.
Purchases of inventory will total $371,000 for December. Thirty percent of a month’s inventory purchases are paid during the month of purchase. The accounts payable remaining from November’s inventory purchases total $201,500, all of which will be paid in December.
Selling and administrative expenses are budgeted at $506,000 for December. Of this amount, $89,100 is for depreciation.
A new web server for the Marketing Department costing $95,000 will be purchased for cash during December, and dividends totaling $13,500 will be paid during the month.
The company maintains a minimum cash balance of $20,000. An open line of credit is available from the company’s bank to increase its cash balance as needed.
Required:
1. Calculate the expected cash collections for December.
2. Calculate the expected cash disbursements for merchandise purchases for December.
3. Prepare a cash budget for December. Indicate in the financing section any borrowing that will be needed during the month. Assume that any interest will not be paid until the following month.
In: Accounting
|
A 0.149 kg glider is moving to the right on a frictionless, horizontal air track with a speed of 0.790 m/s . It has a head-on collision with a 0.310kg glider that is moving to the left with a speed of 2.10 m/s . Suppose the collision is elastic. |
Part A Find the magnitude of the final velocity of the 0.149 kg glider.
SubmitMy AnswersGive Up Part B Find the direction of the final velocity of the 0.149 kg glider. Find the direction of the final velocity of the 0.149 glider.
SubmitMy AnswersGive Up Part C Find the magnitude of the final velocity of the 0.310 kg glider.
SubmitMy AnswersGive Up Part D Find the direction of the final velocity of the 0.310 kg glider. Find the direction of the final velocity of the 0.310 glider.
|
In: Physics