Consider a class Movie that information about a movie. The class has the following attributes:
• The movie name
• The MPAA rating (for example, G, PG, PG-13, R)
• The number of people that have rated this movie as a 1 (Terrible)
• The number of people that have rated this movie as a 2 (Bad)
• The number of people that have rated this movie as a 3 (OK)
• The number of people that have rated this movie as a 4 (Good)
• The number of people that have rated this movie as a 5 (Great)
Implement the C ++ class with accessor (getter) and mutator (setter) functions for the movie name and MPAA rating. Write a function addRating that takes an integer as input parameter. The function should verify that the parameter is number between 1 and 5, and if so, increment the number of people rating the movie that match the input parameter. For example, if 3 is the input parameter, then the number of people that rated the movie as a 3 should be incremented by 1. Write another function, getAverage, that returns the average value for all of the movie ratings. Finally, add a constructor that allows the programmer to create the object with a specific name and MPAA rating. The number of people rating the movie should be set to 0 in the constructor. Test the class by writing a main function that creates at least two movie objects, add at least five ratings for each movie, and outputs the movie name, MPAA rating, and average rating for each movie object.
In: Other
Café Michigan's manager, Gary Stark, suspects that demand for mocha latte coffees depends on the price being charged. Based on historical observations, Gary has gathered the following data, which show the numbers of these coffees sold over six different price values:
Price Number Sold
$2.70 765
$3.60 510
$2.00 975
$4.10 245
$3.10 325
$4.05 475
Using these data, how many mocha latte coffees would be forecast to
be sold according to simple linear regression if the price per cup
were $1.80? round to one decimal
In: Other
Problem 11-16
Wally’s Widget Warehouse takes orders from 7 A.M. to 7 P.M. The
manager wants to analyze the process and has provided the process
flow diagram shown below. There are three steps required to ship a
customer order. The first step is to take the order from a
customer. The second step is to pick the order for the customer,
and then they have to pack the order ready for shipping. Wally
promises that every order placed today gets shipped tomorrow. That
means that the picking and packing operations must finish all
orders before they go home. |
Wally wants to figure out the following. |
a. | What is the current maximum daily output of the process assuming that no one works overtime? (i.e., meaning all three operations work a 12-hour shift) |
Current maximum output | units per day |
b. | How long (in hours) will the picking and packing operations have to work to finish all the orders that were taken if we have a day where the order taker works at his maximum capacity? |
Pick orders | hours |
Pack orders | hours |
c. | Givenb, what is the maximum number of orders waiting to be picked? |
Maximum number of orders | units |
d. | Givenb, what is the maximum number of orders waiting to be packed? |
Maximum number of orders | units |
Management is considering doubling the packing capacity (from 60 to 120 orders per hour). Please answer the following based on that change. |
e. | How long will the picking and packing operations have to work if we have a day where the order taker works at his maximum capacity? |
Pick orders | hours |
Pack orders | hours |
f. | Givene, what is the maximum number of orders waiting to be picked? |
Maximum number of orders | units |
g. | Givene, what is the maximum number of orders waiting to be packed? |
Maximum number of orders | units |
In: Other
Roger Ginde is developing a program in supply chain management certification for managers. Ginde has listed a number of activities that must be completed before a training program of this nature could be conducted. The activities, immediate predecessors, and times appear in the accompanying table:
Activity | Immediate Predecessor(s) | Time (days) |
---|---|---|
A | - | 4 |
B | - | 6 |
C | - | 2 |
D | B | 10 |
E | A, D | 3 |
F | C | 5 |
G | E, F | 10 |
This exercise contains only parts b, c, and d.
b) The critical activities for the leadership training program development project are B-D-E-G
c) The project length for the leadership training program development project = 29 days.
d) Slack time for each of the activities is:
Activity | Slack Time |
---|---|
A | 12 |
B | 0 |
C |
In: Other
A 6-pole, 50 Hz, 3-phase induction motor running on full load develops a useful torque of 160 Nm when the rotor emf makes 120 complete cycles per minute. The windage and friction loss is 1005.30 Watt. It is assumed; the core loss is lumped together with the windage and friction loss. The total stator loss is given to be 800 Watt. Compute:
a) Shaft power output,
b) The copper loss in the rotor winding,
c) The input power to the motor, and
d) The efficiency.
In: Other
1-For the following state table
Present | Next state | Output | ||
---|---|---|---|---|
state | 0 | 1 | 0 | 1 |
a | f | b | 0 | 0 |
b | d | a | 0 | 0 |
d | g | a | 1 | 0 |
f | f | b | 1 | 1 |
g | g | d | 0 | 1 |
Note: Equivalent states: b=e, a=c, h=d
(a) Draw the corresponding state diagram.
(b) Tabulate the reduced state table.
(c) Draw the state diagram corresponding to the reduced state table.
2- A sequential circuit has two JK flip-flops A and B and one input X. The circuit is described by the following flip-flop input equations:
JA = X'
KA = A
JB = B'
KB = X
(a) Drive the state equations A (t1 and B (t +1) by substituting the input equations for the J and K variables.
(b) Draw the state diagram of the circuit.
In: Other
If the gap between C and the rigid wall at D is initially 0.1 mm, determine the support reactions at A and D when the force P = 200 kN is applied. The assembly is made of solid A-36 steel cylinders with E = 200 GPa. Also, what is the normal stress developed in the segment AB and the segment BC?
In: Other
The J-shaped member shown in the
figure is supported by a cable DE and a single journal bearing with
a square shaft at A. Determine the reaction forces A_y and A_z at
support A required to keep the system in equilibrium. The cylinder
has a weight W_B = 5.30 lb, and F = 1.20 lb is a vertical force
applied to the member at C. The dimensions of the member are w =
1.50 ft, l = 6.00 ft, and h = 2.00 ft. Find Ay and Az. (I have
found Ay=0 and Az=6.5 lb).
Now, for the same J-shaped member, determine M_A_x, M_A_y, and
M_A_z, the couple moments at the support about the x, y, and z
axes, respectively, required to keep the system in equilibrium. The
cylinder weighs W_B = 5.30 lb; a vertical force F = 1.20 lb acts at
C; and the member's dimensions are w = 1.50 ft, l = 6.00 ft, and h
= 2.00 ft. Find M_A_x, M_A_y and M_A_z.
In: Other
The beam is supported by a pin at A and a short link BC.
If P = 10kN, determine the average shear stress developed in the pins atA, B, and C . All pins are in double shear as shown, and each has a diameter of 17mm
In: Other
Design a sequential circuit with 2 JK flip-flops A and B, and 2 inputs, E and x. the design must adhere to the following requirements:
If E = 0, the circuit remains in the same state regardless of the value of x.
When E = 1 and x = 1, the circuit goes through the state transitions from 00 to 01 to 10 to 11 back to 00 and repeats.
When E = 1 and x = 0, the circuit goes through the state transitions from 00 to 11 to 10 to 01 back to 00 and repeats.
In: Other
Choose a drug of particular interest to you that you would like to research. The drug may be either an OTC or prescribed medication. It can be of any classification and administered by any route. Ensure that you have sufficient resources (3 sources required) to complete your assignment.
In your assignment, present the following information in your own words:
1. Name and classification of the drug. (2)
2. What are 3 common indications for this drug? (3)
3. How often is it taken? (1)
4. By which route(s) is it taken? (1)
5. Are there any special instructions for administration? (2)
6. Are there possible side effects? (2)
7. Are there any contraindications? (2)
8. Name the 3 sources you used for your assignment. (3)
9. Why did you choose this drug to research? (2)
10. What was the most interesting fact you learned about this medication? (2)
In: Other
6.7 LAB: Palindrome
A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and that outputs whether the input is a palindrome.
Ex: If the input is:
bob
the output is:
bob is a palindrome
Ex: If the input is:
bobby
the output is:
bobby is not a palindrome
Hint: Start by removing spaces. Then check if a string is equivalent to it's reverse.
This is my code:
s = input()
low = 0
high = len(s)-1
flag = False
while(low<high):
if(s[low]!=s[high]):
flag = True
break
low+=1
high-=1
if(flag):
print(s,"is a palindrome")
else:
print(s, "is not a palindrome")
This is what i needs to be solved:
In: Other
A company database needs to store information about employees (identified by ssn, with salary and phone as attributes), departments (identified by dno, with dname and budget as attributes), and children of employees (with name, age, and relationship to the employee as attributes). Employees work in departments; each department is managed by an employee; a child must be identified uniquely by name when the parent (who is an employee; assume that only one parent works for the company) is known. We are not interested in information about a child once the parent leaves the company.
Please provide me SQL statements to create the corresponding relations and capture as many of the constraints as possible.
In: Other
Problem 6.26
The maximum allowable tensile force in the members of the truss is (Ft) max = 5 kN, and the maximum allowable compressive force is (Fc)max = 3.4 kN. (Figure 1)
Part A
Determine the maximum magnitude P of the two loads that can be applied to the truss. Express your answer to three significant figures and include the appropriate units.
In: Other
Part A
Determine the force in members CD of the truss, and state if the member is in tension or compression. Take P = 1675 lb (Figure 1)
Express your answer to three significant figures and include the appropriate units. Assume positive scalars for members in tension and negative scalar for members in compression
Part B
Determine the force in members HI of the truss, and state if the member is in tension or compression. Take P = 1675 lb
Part C
Determine the force in members CJ of the truss, and state if the member is in tension or compression. Take P = 1675 lb.
In: Other