Explain network application architectures and protocols which are developed based on those architectures.
In: Computer Science
Please do in Java!!
Stay on the Screen! Animation in video games is just like animation in movies – it’s drawn image by image (called “frames”). Before the game can draw a frame, it needs to update the position of the objects based on their velocities (among other things). To do that is relatively simple: add the velocity to the position of the object each frame. For this program, imagine we want to track an object and detect if it goes off the left or right side of the screen (that is, it’s X position is less than 0 and greater than the width of the screen, say, 100).
Write a program that asks the user for the starting X and Y position of the object as well as the starting X and Y velocity, then prints out its position each frame until the object moves off of the screen. Design (pseudocode) and implement (source code) for this program.
Sample run 1: Enter the starting X position: 50
Enter the starting X velocity: 4.7
Enter the starting Y velocity: 2
X:50 Y:50
X:54.7 Y:52
X :59.4 Y:54
X:64.1 Y:56
X:68.8 Y:58
X:73.5 Y:60
X:78.2 Y:62
X:82.9 Y:64
X:87.6 Y:66
X:92.3 Y:68
X:97 Y:70
X:101.7 Y:72
In: Computer Science
1 (10 pts) Give a big-θ bound for the solutions of the following recurrence relations. Show work.
(a) T(n) = 8T(n/2) + n^3 + 100n
(b) T(n) = 5T(n/4) + 3n
(c) T(n) = 7T(n/3) + 100n^2
(d) T(n) = 3T(n/3) + 1000√ n
(e) T(n) = T(n − 1) + n^2
In: Computer Science
Exercise 5.5
PART A
Copy or cut and paste program P5_2.cpp (located below) to a new program called ex55.cpp. Make PI a constant value. Compile and run the program for the following values:
r = 2 cm, h = 10 cm
The correct answer should be:
The cross-section area of the
cylinder is 3.89556 inch-sq
The side area of the cylinder is
19.4778 inch-sqr
Did you get the correct answer? You didn't! Explain the reason for this logic error in your report. Now add the instruction that fixes the problem (yes, you need just one instruction) and save your file in ex55.cpp file. HINT: r=r*0.3937; //converting r to inch
PART B
Modify the ex55.cpp to include a new function called total_area that computes the total surface area of a cylinder. The total surface area is the sum of the side area and cross-section area. Call your new program ex56.cpp.
For r=2 and h=10, the total area must be: 23.373383 inch-sqr.
Program P5_2.cpp:
// P 5_2.cpp This program illustrates the local and global
variables and call-by-value.
// This program computes the side area and the cross section area
of a cylinder
#include
#include
using namespace std;
//Let’s declare first any global constant, if any required
// This variable is defined globally, i.e. it is known to all functions in this program as PI
// To declare a global constant you must write it outside the main() function
const double PI = 3.14159;
//Now we declare any programmer defined function
double cross_area(double
r); //
Function prototype for function cross_area
double side_area(double r, double
h); //
Function prototype for function Side_area
// Start defining the main function
int main(void)
{
double h, r; //variables local to the main
function
cout << "Enter the radius
and the height of the cylinder in Cm ";
cin >> r >> h;
cout << endl;
cout << "Before I do any
computation or call any function, I want to let you know that
\n";
cout << "you have entered r =
" << r << " and h = " << h << "." <<
endl;
cout << "I am planning to use
inch, thus in the first function, I will convert r, and " <<
endl;
cout << "in the second one I
will convert h \n";
cout << "The cross section
area of the cylinder is " << cross_area(r) << "
inch-sqr" << endl;
cout << "The side area of the
cylinder is " << side_area(r,h) << " inch-sqr
\n\n";
return 0;
}
// Definition of all programmer defined functions
double cross_area(double r)
{
//Cross section area includes the disks at
the bottom and the top
r = r * 0.3937; // converting r
to inch
return 2*PI*pow(r,2);
}
double side_area(double r, double h)
{
double area; //variable local to
side_area function
h = h * 0.3937; // converting h to
inch
area = 2*PI*r*h;
return area;
}
In: Computer Science
In: Psychology
Write a program that computes the product of two fractions. The user provides 4 input which represent the numerator and the denominator of two fractions and prints the result of the operation. The program uses two functions. One called MultiplyNumerator(…) which calculates the product of the numerators of the fractions, and a second one called MultiplyDenom(…) which calculates the product of the denominator of the fractions. Call your program MultiplyFrac.cpp
In: Computer Science
Deposit function.
Calculate the Balance - Deposit
If the action is Deposit 'D’, use a deposit function to add funds to the account
Deposit Input
userchoice = input ("What would you like to do?\n") userchoice = 'B' deposit_amount = 200
Deposit Output
What would you like to do? How much would you like to deposit today? Deposit was $200, current balance is $700.25
#import sys #no need for this module
#account balance
account_balance = float(500.25)
#<--------functions go here-------------------->
#printbalance function
def printbalance():
print("Account balance: $%.2f" % account_balance)
#deposit function
def deposit():
#accessing account_balance variable which is outside the function
global account_balance
deposit_amount=float(input('How much would you like to deposit today?'))
account_balance+=deposit_amount
print('Deposit was $%.2f, current balance is $%.2f' % (deposit_amount,account_balance))
#withdraw function
def withdraw():
#accessing account_balance variable which is outside the function
global account_balance
withdrawal_amount=float(input('How much would you like to withdraw?'))
#withdrawing only if there is enough balance
if account_balance
print('withdrawal_amount is greater that your account balance of $%.2f' % account_balance)
else:
account_balance-=withdrawal_amount
print('Withdrawal amount was $%.2f, current balance is $%.2f' % (withdrawal_amount,account_balance))
userchoice=''
#looping until user enters Q or q
while userchoice.upper()!='Q':
userchoice = input ("What would you like to do? (D/W/B or Q)\n")
#converting to upper case to reduce comparisons
userchoice=userchoice.upper()
#performing operations based on choice
if userchoice=='D':
deposit()
elif userchoice=='W':
withdraw()
elif userchoice=='B':
printbalance()
elif userchoice=='Q':
print('Thank you for banking with us.')
else:
print('Not a valid choice')
In: Computer Science
What is the predominant intermolecular force in the liquid state of each of these compounds: ammonia (NH3), carbon tetrachloride (CCl4), and hydrogen sulfide (H2S)? Drag the appropriate items to their respective bins.
In: Chemistry
Java Programming
In this assignment we are going to create our own programming language, and process it Java.
programming language has 6 commands
enter, add, subtract, multiply, divide all take 1 parameter (a double value).
return takes no parameters.
In: Computer Science
In the following code, what values could be read into a number to terminate the while loop? PRINT "Enter a number: READ user input number ← user input WHILE (number < 1 or number > 10) PRINT "Enter another number: " READ user input number ← user input END WHILE
A) Numbers in the range 0 - 9
B) Numbers in the range 1 - 10
C) Numbers greater than 10
D) Numbers less than 1
In: Computer Science
1. It is January 1 2020 and you have recently started a new company, GreenDrone, that produces flying drones for garden maintenance. You are still at the product development stage but would like to evaluate the financial feasibility of the project. Here are some information about the company: - R&D expenditures. In order to develop the drones, you need to hire an engineer for 5 years at an annual salary of $96,000. The salary is paid monthly at the end of the month in equal amounts, i.e. 96,000/12 per month for the first year. To stay competitive, you expect you will have to grow the annual salary at a rate of 3%, starting the next year. The engineer contract starts today, i.e., on January 1 2020. - Production cost. Once the product is developed in 5 years (January 1 2025), you will start the production of your drones. Each product is expected to cost $265 to produce. The cost is to be paid to the supplier at the beginning of a month. - Pricing and sales. You plan to sell the drones for $325 a unit over the next three years, i.e., until January 1 2028. All sales for products produced in a month are collected at the end of the month. The appropriate discount rate r is 5%, annually compounded. Denoting the quantity of drones sold in a month by Q. How many drones do you need to sell per month to make this project profitable (i.e., generate a positive NPV)?
In: Finance
Burlington has tracked daily sales of coats for the three locations below:
Date |
Chicago |
Seasonal Relatives for Chicago Sales |
California |
New York |
1/4/18 |
152 |
0.3 |
640 |
456 |
1/5/18 |
195 |
0.4 |
586 |
650 |
1/6/18 |
653 |
1.5 |
420 |
543 |
1/7/18 |
187 |
0.5 |
645 |
632 |
1/8/18 |
240 |
0.6 |
507 |
546 |
1/9/18 |
207 |
0.8 |
623 |
531 |
1/10/18 |
311 |
0.9 |
511 |
544 |
1/11/18 |
373 |
1.2 |
500 |
639 |
1/12/18 |
225 |
0.5 |
576 |
570 |
1/13/18 |
276 |
0.3 |
540 |
544 |
1/14/18 |
475 |
0.7 |
475 |
674 |
1/15/18 |
755 |
1.1 |
645 |
711 |
1/16/18 |
732 |
1.4 |
534 |
594 |
1/17/18 |
975 |
2.2 |
511 |
564 |
1/18/18 |
170 |
0.3 |
650 |
693 |
1/19/18 |
203 |
0.7 |
699 |
645 |
1/20/18 |
288 |
0.8 |
580 |
570 |
1/21/18 |
378 |
0.9 |
520 |
456 |
1/22/18 |
400 |
1.3 |
546 |
609 |
1/23/18 |
798 |
1.6 |
576 |
585 |
1/24/18 |
1111 |
1.9 |
649 |
609 |
1/25/18 |
176 |
0.5 |
657 |
480 |
1/26/18 |
213 |
0.6 |
600 |
544 |
1/27/18 |
240 |
0.9 |
703 |
560 |
1/28/18 |
311 |
0.7 |
657 |
476 |
1/29/18 |
456 |
1 |
546 |
656 |
1/30/18 |
Question Set 1. Using only the Chicago sales data, generate the following sales forecasts:
1. Naïve forecasts (using the deseasonalized sales data) for January 5th through January 30th. You will need to adjust the sales data to remove the seasonality effects. (6pts)
2. Four-day moving average forecasts for January 8th through January 30th. (3pts)
3. Twelve-day moving average forecasts for January 16th through January 30th. (3pts)
Note that, for example, you will not be able to make a four-day moving average forecast for January 7th since four previous sales figures are required.
In: Finance
Description:
Digital and Direct Marketing has obviously grown exponentially over the past few years, due in main part to the explosion of mobile technology. Reflect on your own purchasing habits and describe the marketing efforts of a company you believe to be successful in this modality. Why is the effort so successful? |
In: Operations Management
12. A manager reported that 50 employees were working in the operation at the beginning of an accounting period, and 70 employees at the end of the period. During the accounting period 20 employees voluntarily left their employment and 4 employees were terminated. What was this manager's overall employee turnover rate in the accounting period?
50%
400%
500%
40%
[Questions 16-18] Use the following labor expense information for answering the next 3 questions.
Day |
Sales |
Guest Served |
Labor hours used |
Cost of labor |
Thursday |
$ 1,700 |
110 |
30 |
$ 380 |
Friday |
$ 1,500 |
120 |
30 |
$ 380 |
Saturday |
$ 2,400 |
210 |
50 |
$ 600 |
Sunday |
$ 1,900 |
175 |
50 |
$ 600 |
16. Comparing the labor cost percentage, which day is the least productive day?
Friday
Saturday
Thursday
Sunday
17. What was the manager’s sales per labor hour on Friday?
$ 52.00
$ 42.00
$ 48.00
$ 50.00
18. Comparing the number of guests served per labor hour, which day is the most productive day?
Sunday
Friday
Thursday
Saturday
Question 20-21] Ice bear operates a fine dining restaurant called the “The Egloo.” His labor productivity ratio of choice is guests served per labor hour. His standards are as follows:
Use the Guest Forecast chart below to answer the following questions 20 & 21.
Time |
Forecasted Number of Guests Served |
Server Hours Needed |
Busperson Hours Needed |
12:00 - 1:00 |
170 |
||
3:00 - 4:00 |
25 |
||
6:00 - 7:00 |
125 |
||
8:00 - 9:00 |
150 |
20. How many busperson labor hours should Ice Bear schedule for the time period from 8:00 to 9:00?
8
5
7
6
21. How many server labor hours should Ice Bear schedule for the time period from 12:00 to 1:00?
18
20
21
17
[Question 23-24] Use the following chart for the next two questions.
The Egloo – Compiled data from 2019
Yearly Sales (300 days/year) |
$275,000 |
Food Expense |
$82,500 |
Labor Expense |
$104,500 |
Other Expense |
$68,500 |
Days in operation for year |
300 |
Average number of labor hours per day |
35 |
Average number of guests served per day |
140 |
23.Calculate the sales per labor hour using the above chart.
$ 24.23
$ 26.19
$ 21.53
$ 11.75
24. Calculate the labor expense percent using the above chart in question 23.
65.5%
38%
25%
30%
In: Operations Management
choose one type of knowledge conversion and explain it ?
In: Operations Management