C++ program
Dairy Farm decided to ship milk in containers in the form of cubes rather than cylinders.
Write a program that prompts the user to input:
The program then outputs:
You may assume that the value of π = 3.141593.
In: Computer Science
in the documentary Trapped, what are the restrictions placed on the right to abortion? (including the TRAP laws). Why might those restrictions exist?
In: Psychology
Cross City Tunnel (CCT) Ltd currently has 5 million shares on issue each with a market price of $2.50. CCT also has $7 million of debt. The Chief Financial Offer is considering changing the capital structure by repaying $3 million of debt using funds raised from an equity issue. The interest rate on debt is 10% p.a. and the company tax rate is 30%.
Calculate EPS for both the current and the proposed capital structures at a projected EBIT level of $3.7 million. Which capital structure is preferable if this is the expected level of EBIT?
In: Finance
Data Structures and Algorithms CMPS 2720
PLEASE ANSWER CLEARLY
10. Suppose a dataset has N items. On average, how many comparisons and how many saves (not swaps) are needed to sort the dataset using the bubble sort?
11. Suppose a dataset has N items. On average, how many comparisons and how many saves (not swaps) are needed to sort the dataset using the select sort?
12. Suppose a dataset has N items. On average, how many comparisons and how many saves (not swaps) are needed to sort the dataset using the insertion sort?
13. Suppose that an array contains the eight number listed below. How many saves (not swaps) are needed to perform the first pass of the bubble sort? 18 20 12 14 10 16 32 26
14. Suppose that an array contains the eight number listed below. How many saves are needed to perform the first pass of the select sort? 18 20 12 14 10 16 32 26
5. What effect, if any, does the consideration of duplicates in an array have in searching for all records with a specific key?
In: Computer Science
Define the Central Limit Theorem. How are confidence intervals related to public opinion polling?
In: Economics
Task Description Task No. Must Follow Expected time(days)
Reserve the meeting room A None 1
Order the marketing material B A 9
Brief the managers C A 2
Send put the customer emails D C 3
Burn sample DVDs E C 3
Load the new software F D, E 2
Do a class rehearsal. G B, F 1
Now you do:
(A) Using the data from the table above, draw a Gantt chart to help Flow Associates organize the meeting. Chart should be neat and labeled.
(B) Using the data from the table above, draw a PERT diagram. Then identify the critical path. The diagram should be neat and labeled.
Note: you can create these charts using MS Project. If you do not wish to use MS Project, you can use MS Excel to create Gantt chart and MS Word to create PERT Diagram.
In: Computer Science
This is a Python project and I´m wondering if anyone has a simple solution for this?
Write a program, move.py, which asks the user for the position of a virtual character on the x-axis in a coordinate system and then allows the user to move the virtual character to the right or left, indicated by the characters 'r' or 'l'. The user should be able to move the virtual character as often as he/she wishes, but if the input is neither 'r' nor 'l' the program quits. Instructions for the user are written out at the beginning, but the position of the virtual character (denoted by 'o') is shown in each iteration.
The valid range on the x-axis, which the virtual character can traverse, is from 1 to 10 and you can assume that at the beginning the user inputs a number in this range. If the virtual character is positioned at either end of the range it will not move when the user tries to move it out of the range.
In your solution, you should only use methods/material discussed in the first five chapters in the textbook. This means, for example, that you are not allowed to use lists.
Make sure that your code is very readable (see, for example, this thread).
Note the following:
Example input/output:
Input a position between 1 and 10: 7 xxxxxxoxxx l - for moving left r - for moving right Any other letter for quitting Input your choice: r xxxxxxxoxx Input your choice: r xxxxxxxxox Input your choice: r xxxxxxxxxo Input your choice: r xxxxxxxxxo Input your choice: l xxxxxxxxox Input your choice: l xxxxxxxoxx Input your choice: l xxxxxxoxxx Input your choice: l xxxxxoxxxx Input your choice: q xxxxxoxxxx
In: Computer Science
Please answer in C++! Let me know if you have any questions about these.
Program 1:
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 Y 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
Program 2:
Buh-RING IT! For this assignment, you’re going to simulate a text-based Role-Playing Game (RPG). Design (pseudocode) and implement (source) for a program that reads in 1) the hero’s Hit Points (HP – or health), 2) the maximum damage the hero does per attack, 3) the monster’s HP and 4) the maximum monster’s damage per attack. When the player attacks, it will pick a random number between 0 and up to the maximum damage the player does, and then subtract that from the monster. The same thing happens when the monster attacks the hero, but damage is to the hero. The program should display rounds and the HP of the hero and monster each round. If the hero or monster dies, it should print that this happened and should NOT continue (i.e. no extra text). To learn how to create random numbers, see the appendix.
Sample run 1:
Enter the hero's starting hit points: 50
Enter the damage the hero’s weapon does per strike: 20
Enter the monster's starting hit points: 40
Enter the monster's damage per strike: 15
====== ROUND 1 ======
Hero attacks for: 10
Monster has 30 HP left
Monster attacks you for: 1
You have 49 HP left
====== ROUND 2 ======
Hero attacks for: 18
Monster has 12 HP left
Monster attacks you for: 7
You have 42 HP left
====== ROUND 3 ======
Hero attacks for: 0
Monster has 12 HP left
Monster attacks you for: 14
You have 28 HP left
====== ROUND 4 ======
Hero attacks for: 18
Monster has -6 HP left
The monster dies and you earn 5 XP
Battle ends...
Program 3:
Did you know that, over the last century, the stock market has returned an average of 10%? You may not care, but you’d better pay attention to this one. If you were to give a newborn baby $5000, put that money in the stock market and NOT add any additional money per year, that money would grow to over $2.9 million by the time that baby is ready for retirement (67 years)! Don’t believe us? Check out the compound interest calculator from MoneyChimp and plug in the numbers! To keep things simple, we’ll calculate interest in a simple way. You take the original amount (called the principle) and add back in a percentage rate of growth (called the interest rate) at the end of the year. For example, if we had $1,000 as our principle and had a 10% rate of growth, the next year we would have $1,100. The year after that, we would have $1,210 (or $1,100 plus 10% of $1,100). However, we usually add in additional money each year which, for simplicity, is included before calculating the interest. Your task is to design (pseudocode) and implement (source) for a program that 1) reads in the principle, additional annual money, years to grow, and interest rate from the user, and 2) print out how much money they have each year. Task 3: think about when you earn the most money! Lesson learned: whether it’s your code or your money, save early and save often…
Sample run 1:
Enter the principle: 2000
Enter the annual addition: 300
Enter the number of years to grow: 10
Enter the interest rate as a percentage: 10
Year 0: $2000
Year 1: $2530
Year 2: $3113
Year 3: $3754.3
Year 4: $4459.73
Year 5: $5235.7
Year 6: $6089.27
Year 7: $7028.2
Year 8: $8061.02
Year 9: $9197.12
Year 10: $10446.8
In: Computer Science
Sports Stuff, Inc. (SSI) is a manufacturing firm that produces sporting goods. They have started operating a factory in the U.S. and have opened a company owned store adjacent to the factory. The production manager at the factory is trying to ascertain the optimal number of footballs to produce with each production run. After careful analysis, she believes that the following data are correct:
Answer the following questions for SSI.
a) What is the optimal lot size for football production? (round to 2 decimals) footballs
b) What is the minimum inventory level of
footballs? footballs
c) What is the maximum inventory level of footballs? (round
to 2 decimals) footballs
d) What is the average inventory level of footballs? (round
to 2 decimals) footballs
e) What is the reorder point in
units? footballs
f) What is the annual setup cost for football production?
(round to 2 decimals) $
g) What is the annual holding cost for the football inventory?
(round to 2 decimals) $
In: Operations Management
A loan company wants to design a database to track student loans. Each student attending school is eligible for a loan. A student may have more than one loan. A student may be registered, possibly at different times, in more than one school. Each loan should belong to only one bank. Each bank can approve as many loans as it desires. For each loan, the loan company will track: the student’s SSN, name, address, amount of loan, date of the loan, interest rate ( which may be different for each loan as determined by the bank), duration of the loan, monthly payment, remaining balance, school ID, school name and address, number of years the student has been at the school, bank name, bank branch, and bank ID. Draw an ER diagram. State any assumptions you make in the diagram. Note: You must use one of the automated database design tools such as: ER STUDIO ER Assistant Vision Enterprise or draw.io website.
In: Computer Science
Now suppose Thermata officers want to ascertain employee satisfaction with the company. They randomly sample nine employees and ask them to complete a satisfaction survey under the supervision of an independent testing organisation. As part of this survey, employees are asked to respond to questions on a 5-point scale where 1 is low satisfaction and 5 is high satisfaction. The questions and the results of the survey are shown in the next column. Analyse the data by finding a confidence interval (with =0.05) to estimate the population response to each of these questions. Provide your interpretation and discussions of the results.
Question |
Mean |
Standard Deviation |
1. Are you treated fairly as an employee? |
3.79 |
0.86 |
2. Has the company given you the training you need to do the job adequately? |
2.74 |
1.27 |
3. Does management seriously consider your input in making decisions about production? |
4.18 |
0.63 |
4. Is your physical work environment acceptable? |
3.34 |
0.81 |
5. Is the compensation for your work adequate and fair? |
3.95 |
0.21 |
In: Math
A 3.61 kg particle has the xy coordinates (-1.06 m, 0.516 m), and a 3.39 kg particle has the xy coordinates (0.820 m, -0.0640 m). Both lie on a horizontal plane. At what (a) x and (b) y coordinates must you place a 2.60 kg particle such that the center of mass of the three-particle system has the coordinates (-0.672 m, -0.106 m)?
In: Physics
A column in your data is missing a value in one row. Which command fills this missing data point with the value before it?
Select an answer:
df.fillna(method='bfill')
df.fillna(0)
df.fillna(method='linear')
df.fillna(method='ffill')
In: Computer Science
Do you know of any cases, other than what was covered in the lecture, in which reward systems are inconsistent with the desired behavior? What is the impact of this misalignment?
In: Operations Management