python
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<center> <h1>CpE 4040 Midterm-2 Exam</h1>
</center>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1- Write a Python code which asks two numbers from the user,
calculates the sum and print the result. Create a function to
calculate the summation and return the result
value.<br>\n",
"i.e. <br>\n",
"First Number:12 <br>\n",
"Second Number:23 <br>\n",
"12 + 23 = 35"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"2- Create 20 random integers in an array which has the numbers
between 10 and 100 (includes 10 and 100). Sort and print the
numbers in descending order."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"3- Write a Python code that asks a string from the user and prints
only the lower case letters in that string."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"4- Create an evenly spaced 21-element array between 2.2 and 12.4.
Find the median of the array. Print both the array and median
value. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"5- Write a simple number guessing game Python program. In this
code, generate a random integer between 1-10 (both included) and
ask the user to guess the number in three attempts. \n",
"Print appropriate responses to the user such as \"You won!\" or
\"You failed\" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"6- Generate an array of numbers from 1 to 15. Reshape it to make
3x5 matrix. Convert the matrix into data frame and print the even
number of columns. "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
In: Computer Science
Discuss this statement; “Banking everywhere, but not at the bank”. *
(10 Marks
In: Computer Science
Social Media Marketing.
1. In your own words, please define both "permission marketing" and "interruption marketing." Please provide an example of a time when you have experienced both types of marketing.
2. Two-paragraph (five-sentence per paragraph minimum) answer to the following question. Please feel free to write only your opinion, or to back it up with sources.
In your opinion, why is social media different from other types of marketing?
In: Operations Management
What steps are organizations taking in reducing bureaucracy? Define professionalism.
In: Operations Management
PHP
You will be using the object oriented features of PHP to design a music album processing page.
First you will build a form page called addAlbum.php. This form will contain text fields for album title, artist, publisher (Sony, BMI, etc.) and genre. Add two more fields of your choice. You will post this form to the file process.php.
If all the fields have values, we will create a new Album object and print the details of the object. You will need to create an Album class that has private instance variables for all the fields just described. Your constructor should simply echo to the screen "Album created." If the user missed some of the form, give them a link to go back and fix.
Generate standard getters/setters
You will need to create __get and __set functions (magic functions) to allow us to set the properties of the instance variables from outside the class. You will also create a function (or method) called __toString() in the class. Calling this will return a formatted string of all the details for the album. Store the class in album.class.php.
Include a hyperlink back to add another album.
Sample output could look like this:
Album Created
Album Title: Blaze of Glory
Artist: Jon Bon Jovi
Publisher: ASCAP
Genre: Rock
Custom Field: stuff
Another Custom Field: stuff
Add another album! (This is an hyperlink to add another album)
Requirements
i. Comments on all pages, proper page names (as requested),
aligned code, overall effort
ii. addAlbum.php page is complete - doctype, complete html
structure and some instructions that give the user some indication
of what they are to do
iii. album.class.php - contains code to define album class - as
well as documentation/comments to outline how to use - see
requirements for details (private vars, constructor, magic
methods(__get(),__set() and __toString functions)
iv. Some type of validation used so that user knows about
errors
v. Styles for all pages: Use an external stylesheet for all styles.
All page content should be in a div with an id set to 'container',
650px wide and the content centered.
vi.The container div should also be centered on the screen
(horizontally). The constructor text should be echoed using an
<h3> tag. Please bold all labels as displayed above.
vii. Use the Button class to print the submit button on the form
page addAlbum.php.
In: Computer Science
Nina Stiller is passionate about modern sculpture and works for an art dealer in New York City. In her job, she is responsible for traveling the country to assess sculptures that are being sold by private owners and determining if the art dealer should buy them. She also privately collects sculptures that she thinks are great works of art and will become valuable over time. She will sometimes sell the sculptures she owns privately if she gets an offer that will make her a lot of money. She is saving the money from the sales because she hopes to open up her own art dealership one day. Unfortunately, her boss at the art dealership discovers that she sometimes sells pieces from her private sculpture collection for a profit. Her boss wants to fire her because her private sculpture sales are a conflict of interest with her work at the art dealer.
Nina’s boss is worried that firing Nina would violate the New York law that prohibits employers from discriminating against employees for their participation in legal recreational activities pursued outside of work hours.
Use the language from the New York law that was analyzed in theNew York v. Walmartcase to explain why Nina would not be protected by this law from being fired.
In: Operations Management
In: Psychology
What measures has Thailand taken to fight human trafficking ? What measures does US still needs to take?
In: Psychology
In Multi-Effects Desalination (MED) system composed of
4 effects, and 3 feed
preheaters and down condenser. List the following:
a- The mass balance in the evaporator, feed preheater and down
condenser
b- The energy balance in the evaporator, feed preheater and down
condenser
c- The Material balance in the first effect
d- The temperature profile of the feed if the intake temperature is
25ºC and
temperature of last effect is 40ºC and the temperature of first
effect is 60ºC
e- What will happen to the transfer area of the evaporator if the
motive steam
temperature is increased to 100ºC where the rest is remaining
constants.
In: Mechanical Engineering
Identify your earliest exposure to people who were racially or culturally different from you through movies, television shows, or music.
What was your age?
Who was the person and how was he or she different?
What impressions did you have about these people from these media? From a cultural pluralist’s perspective, do you think this experience was positive or negative for you?
In: Psychology
Select one (1) moral philosophy (teleology, deontology, relativist perspective, virtue ethics, or justice) that has influenced the outcome of an ethical dilemma that you have witnessed. Provide one (1) example of the way in which this moral philosophy influenced the outcome of an ethical dilemma in a past or present organization. Note: Please do not identify workplaces or leaders by name. Examine Kohlberg’s stages of moral development. Determine the stage of Kohlberg’s moral development that your current, or past, organization and coworkers are in. Provide one (1) example of your current, or past, organization and coworkers that illustrates the stage of Kohlberg’s moral development.
In: Operations Management
Discuss the strategic, tactical and operational roles of the procurement.
In: Operations Management
Suppose you are choosing between the following two algorithms:
Algorithm A: solves problems of size n by recursively solving two subproblems each of size (n-1) and then combining the solutions in constant time (take T(0) = 0).
Algorithm B: solves problems of size n by recursively solving one subproblem of size (n-1) and then combining the solution in (log n) time (take T(1) = 0).
In: Computer Science
Research shows that on campus break-ins at CSUN and UCLA during the past 24 months averaged 15 and 12 per month, respectively, with unbiased standard deviations of 4 and 3, respectively. Use the five steps of hypothesis testing to see if there a significant difference between these numbers on the two campuses (Use P<.01, alpha = 2.819)
In: Math
When should you place a planned order for an additional 50,000 basic jeans for the Columbus Day sales (October 14).
Calculate the Vendor's Lead Time Variance from the table below.
NRF 4-5-4 Calendar
Vendor’s
Shipping History
Period |
Planned Receipt Date |
Actual Recept Date |
Variance in Days |
1 |
10-Jan |
21-Jan |
|
2 |
20-Feb |
25-Feb |
|
3 |
20-Mar |
1-Apr |
|
4 |
10-Apr |
30-Apr |
|
5 |
10-May |
10-May |
|
6 |
10-Jun |
5-Jun |
|
7 |
10-Jul |
5-Jul |
|
8 |
30-Jul |
8-Aug |
|
9 |
20-Aug |
20-Aug |
|
10 |
15-Sep |
12-Sep |
|
11 |
10-Oct |
12-Oct |
|
12 |
10-Nov |
15-Nov |
|
13 |
10-Dec |
5-Dec |
Vendor’s Lead Time Forecast 30 Days
Vendor’s Lead Time Variance in Days _____ Days
Vendor’s LTV as a %
Lead Time Range From _______to ________
To ensure on-time delivery, place order ______________
The earliest date to expect receipt ______________
Order Date
Earliest Arrival date
Start Date
In: Operations Management