Write a program that generates a vector with 20 random integer elements between-10 and 10, a. Then replaces all the negative integers with random integers between -10 and 10 and repeats this process until all elements are positive b. Count how many times it takes before this is done c. Find out how long it takes

Answers

Answer 1

The program generates a vector with 20 random integer elements between -10 and 10,

a. Then replaces all the negative integers with random integers between -10 and 10 and repeats this process until all elements are positive. It counts how many times it takes before this is done and finds out how long it takes to complete the process.

To write a program that generates a vector with 20 random integer elements between -10 and 10, a.

Then replaces all the negative integers with random integers between -10 and 10 and repeats this process until all elements are positive. We can perform the following steps:

Step 1: Initialize the variables which will be used to count the number of iterations and the time it takes. Also, create a vector with 20 random integer elements between -10 and 10 using the randi() function.

Step 2: Replace all the negative integers with random integers between -10 and 10 using a while loop.

Step 3: Count how many times it takes before all elements are positive using a counter variable that is incremented each time the while loop runs.

Step 4: Find out how long it takes to complete the process using the tic() and toc() functions. Here is the program that performs all these steps:```
% Initialize variables
count = 0;
t = 0;

% Create vector with 20 random integer elements between -10 and 10
a = randi([-10 10], 1, 20);

% Replace negative integers with random integers between -10 and 10
while any(a < 0)
   a(a < 0) = randi([-10 10], 1, sum(a < 0));
   count = count + 1;
end

% Find out how long it takes
t = toc;

% Display results
disp(['It took ', num2str(count), ' iterations to make all elements positive.']);
disp(['It took ', num2str(t), ' seconds to complete the process.']);
```The program generates a vector with 20 random integer elements between -10 and 10,

a. Then replaces all the negative integers with random integers between -10 and 10 and repeats this process until all elements are positive. It counts how many times it takes before this is done and finds out how long it takes to complete the process.

To know more about negative integers visit:

https://brainly.com/question/15024048

#SPJ11


Related Questions

SalePush company has hired you to make the network up and running. Company asked you to configure the network which that allows the employee to share files through the network. Employees must also be able to control resources on their machines. The company wants the most inexpensive solution and only minimal training for employees. The company needs to expand, and its LAN has grown to include several servers and more than 100 workstations. SalePush has recently purchased another building and needs more space and computers. Expansion plans include leasing another floor four stories above. The current offices in the same building and adding 50 workstations and at least one more server immediately, with additional equipment purchases expected. Would you choose a peer-to-peer network or a server-based network? Write a list of supplies you might need to purchase to accomplish this task. What computer configuration tasks might you need to perform? What type of network is called LAN, WAN, MAN, or internetwork? What additional devices might be needed to ensure efficient network communication? [10 marks]

Answers

A LAN (Local Area Network) is a type of network that connects devices within a limited geographical area, such as an office building or a campus. It is a privately-owned network that provides high-speed communication between devices within the network.

Based on the requirements of SalePush, a server-based network would be a better choice as it would provide better control over resources and facilitate efficient sharing of files through the network. A server-based network allows for central management of resources, which makes it easier to control access to files, printers, and other resources on the network. In terms of supplies, you might need to purchase additional servers, network switches, network cables, and network interface cards (NICs) for the new workstations. You might also need to purchase software licenses for the servers and workstations, and possibly backup and recovery software for the servers.

For computer configuration tasks, you would need to configure the servers to provide file sharing and printer sharing services. You would also need to configure user accounts on the servers to control access to resources and configure security settings to ensure that the network is secure. For the new workstations, you would need to install operating systems, configure network settings, and install software applications.

A LAN (Local Area Network) is a type of network that connects devices within a limited geographical area, such as an office building or a campus. It is a privately-owned network that provides high-speed communication between devices within the network. To ensure efficient network communication, additional devices that might be needed include network routers, firewalls, and switches. Routers are used to connect multiple networks together, while firewalls are used to protect the network from unauthorized access. Switches are used to connect devices within the network and provide high-speed communication between them.

To know more about network interface cards visit:

https://brainly.com/question/30772886

#SPJ11

in c++
1. Allow the user to enter information about themselves:
Is this a delivery or a pick?
What is your name and address?
how are you paying for your pizza? Cash or credit?
2. Allow the user to enter their Pizza order?
Is this a thin crust or NY Style pizza?
What topping would you like? There should not be a limit on how many topping the user enters.
Would you like a soda with you order? If so, how many, and what type?
Would you like wing with your order? If so, how many, and what type?
3. Display the users information.
4. Display the order back to the user.
5. Display the amount of the user order.
Within this project you MUST use of the following:
Struct(s), Class(s), Loop(s), a Switch, Data Types, Array(s) or Vector(s), function(s)/method(s), etc

Answers

The  example of the implementation in C++ that fulfills the requirements mentioned above is given in the image attached.

What is the c++ program

In the code given,  one begin by counting the essential header records: iostream for input/output operations, string for string dealing with, and vector for overseeing energetic clusters.

This program permits the client to enter data approximately themselves, their pizza arrange, and after that shows the entered data and the arrange sum. It utilizes structs, classes, circles, a switch, information types, arrays (vectors), and functions/methods to realize the desired usefulness.

Learn more about c++ program from

https://brainly.com/question/28959658

#SPJ4

5b. a = 8
(b) (10 pts.) Consider a linear time-invariant system with H(e) = tude response |H(ejw)|. 1+e-jw (1-ae-jw)2 Determine the magni- 1000/101100²

Answers

The magnitude response of the given linear time-invariant system is 1000/101100².

The given linear time-invariant system is represented by the transfer function H(ejω), where ω represents the frequency. The magnitude response of the system, |H(ejω)|, is determined by the expression 1 + e[tex]^{-jw}[/tex]/ (1 - ae[tex]^{-jw}[/tex])².

To calculate the magnitude response, we substitute ω with the desired frequency and evaluate the expression. In this case, the magnitude response is 1000/101100².

The magnitude response represents the gain or attenuation of the system at different frequencies. A magnitude response of 1 indicates no change in amplitude, while values greater than 1 represent amplification, and values less than 1 indicate attenuation.

Learn more about time-invariant system visit

brainly.com/question/31974972

#SPJ11

Solve the following differential equations by using Laplace transform method. Question2 a) y"+2y+y=4e where y(0)=2 y'(0)=4. b) 2y" +4y' +10y=8(t) Assume zero initial conditions.

Answers

Solving the differential equation using Laplace transform methoda) y"+2y+y=4e where y(0)=2 y'(0)=4.First, apply Laplace transform to both sides of the differential equation to obtain L{y"+2y+y}=L{4e}.L{y"+2y+y} = L{4e}Apply the formula L{y'+f(t)} = s Y(s) - y(0) + F(s) where F(s) is the Laplace transform of f(t).

s² Y(s) - s y(0) - y'(0) + 2s Y(s) + Y(s) = 4/s²Therefore, we can solve for Y(s)Y(s) = 4/s² / (s² + 2s + 1) = 4/s² / (s + 1)²By partial fraction decomposition, we can rewrite Y(s) asY(s) = 2/(s + 1) + 2/(s + 1)²Take the inverse Laplace transform to obtain the solution to the differential equationy(t) = 2e^-t + 2te^-tb) 2y" +4y' +10y=8(t) Assume zero initial conditions.Apply Laplace transform to both sides of the differential equation.

2L{y"} + 4L{y'} + 10L{y} = 8L{t}Applying the formula L{y'} = s Y(s) - y(0) for the second term on the left hand side of the equation and L{y"} = s² Y(s) - s y(0) - y'(0) for the first term, we get:2s² Y(s) - 2s y(0) - 2y'(0) + 4s Y(s) + 10 Y(s) = 8/s³Simplify to get:2s² Y(s) + 4s Y(s) + 10 Y(s) = 8/s³ + 2y'(0) + 2s y(0)By partial fraction decomposition, we can rewrite Y(s) asY(s) = (2s+1)/(s²+2s+5) + (4/5)*(1/s) - (4/5)*(s/(s²+2s+5))Taking the inverse Laplace transform to obtain the solutiony(t) = (1/5)(4-2e^-t*cos(2t)-4e^-t*sin(2t))

To know about transform visit:

https://brainly.com/question/11709244

#SPJ11

Question 7 (tracer) Refer to the code on page six of the Tracers and Coders sheet for this question. You are to write the display carried out by each call to the showArray method (shown on page seven - we use it in two more questions given below). As you can see, when the computer executes the code of showArray in this example, it simply displays the contents of each result array gotten from the different calls to the method countEm
Question 7 Data and Calls int[] array 71 = (3.2, 4, 4, 5); int[] array 72 = {4, 6, 8, 10, 5,5, 3, 2); int array 73 = {1, 1, 3,-1, -2, 4, 5, 6, 7); intarray 74 = {2, 3, 6, 6, 6, 5, 4, 3, 1, 2, 2); int[] result; result = countEm(array71); show Array("Array gotten from array71:", result); result-countEm(array 72); show Array("Array gotten from array 72:", result); result = countEm(array73); show Array("Array gotten from array 73:", result); result = countEm(array74); show Array("Array gotten from array 74:", result); Question 7 Code to Analyze private static int countEm(int[] array) 4 int( result = {0,0,0): int len array.length; int indx: for(indx = 0; indx array[indx+1]) result[0]++; else if (array[indx]

Answers

Based on the above code snippet as well as data,  to be able to examine the calls to the showArray method and the expected display for each call: one can used the code below.

What is the Array?

java

int[] array71 = {3, 2, 4, 4, 5};

int[] array72 = {4, 6, 8, 10, 5, 5, 3, 2};

int[] array73 = {1, 1, 3, -1, -2, 4, 5, 6, 7};

int[] array74 = {2, 3, 6, 6, 6, 5, 4, 3, 1, 2, 2};

int[] result;

result = countEm(array71);

showArray("Array gotten from array71:", result);

result = countEm(array72);

showArray("Array gotten from array72:", result);

result = countEm(array73);

showArray("Array gotten from array73:", result);

result = countEm(array74);

showArray("Array gotten from array74:", result);

Read more about Array here:

https://brainly.com/question/29989214

#SPJ4

Write a Python program to convert the temperature for the below
Fahrenheit to Centigrade and vice versa
Fahrenheit to Kelvin and vice versa
Kelvin to Centigrade and vice versa
You should write functions to do each of these operations. The functions should be present in an external .py file named helper.py
Your main program will do the following
Algorithm
Import your module
Loop till use is done
Ask user to select an option from the 6 available options
Get the input temperature value
Display the converted temperature value

Answers

Please find below the program for converting the temperature from Fahrenheit to Centigrade and vice versa, Fahrenheit to Kelvin and vice versa and Kelvin to Centigrade and vice versa.

The temperature conversion formulae are given below: Fahrenheit to Celsius: C = (F - 32) * 5/9Celsius to Fahrenheit: F = (C * 9/5) + 32Fahrenheit to Kelvin: K = (F - 32) * 5/9 + 273.15Kelvin to Fahrenheit: F = (K - 273.15) * 9/5 + 32Kelvin to Celsius: C = K - 273.15Celsius to Kelvin: K = C + 273.15The code is given below for each of the 6 conversion types in a separate function named as follows convert_fahrenheit_to_celsiusconvert_celsius_to_fahrenheitconvert_fahrenheit _to_

kelvinconvert_kelvin_to_fahrenheitconvert_ kelvin _to_celsiusconvert_celsius_to_kelvin# helper.py filedef convert_fahrenheit_to_celsius(f):    c = (f - 32) * 5/9    return round(c, 2)def convert_celsius_to_fahrenheit(c):    f = (c * 9/5) + 32    return round(f, 2)def convert_fahrenheit_to_kelvin(f):    k = (f - 32) * 5/9 + 273.15    return round(k, 2)def convert_kelvin_to_fahrenheit(k):    f = (k - 273.15) * 9/5 + 32    return round(f, 2)def convert_kelvin_to_celsius(k):    c = k - 273.15    return round(c, 2)def convert_celsius_to_kelvin(c):    k = c + 273.15    return round(k, 2)# main.py fileimport helperwhile True:    print("\nTemperature Conversion Options:")    print("1. Fahrenheit to Celsius")    print("2. Celsius to Fahrenheit")    print("3. Fahrenheit to Kelvin")    print("4. Kelvin to Fahrenheit")    print("5. Kelvin to Celsius")    print("6. Celsius to Kelvin")    print("7. Exit")    option = int(input("Select an option: "))    if option == 1:        f = float(input("Enter the temperature in Fahrenheit: "))        c = helper.

To know more about Fahrenheit  visit:-

https://brainly.com/question/15522116

#SPJ11

Create a class Clock, with the following fields:
Private:
int hour, min, sec – representing the hours, minutes and seconds of a clock, respectively
Public:
A default constructor, to set the values of hour, min and sec to zero
A constructor taking three integer parameters, to set the values of hour, min and sec to the values of the respective parameters
A void info() function, displaying the clock in the format hour:min:sec
A integer milliseconds() function, converting the Clock time into milliseconds, using the formula:
ms = 1000 * (3600 * hour + 60 * min + sec)
A friend Clock operator+, taking two Clock objects as operands, and returning their sum
A friend Clock operator-, taking two Clock objects as operands, and returning their difference
c = a ± b
c.hour = a.hour ± b.hour
c.min = a.min ± b.min
c.sec = a.sec ± b.sec
In the main() function:
Declare three integer variables
Input the three integer variables from the keyboard and from them create Clock a
Input the three integer variables from the keyboard again and from them create Clock b
Display both Clocks using their respective info() functions. Also display their values in milliseconds
Calculate the sum of the two Clocks and display the new clock time using its info() function, as well as its value in milliseconds. Repeat the procedure for the difference of the Clocks.
Additional functionality:
Add a (global) friend void rectify(Clock &) function, which will accept an Clock object and modify it within the function. The Clock time should be modified as follows:
While the seconds of the clock are greater or equal to 60, subtract 60 from the seconds and add one to the minutes of the clock
While the minutes of the clock are greater or equal to 60, subtract 60 from the minutes and add one to the hours of the clock
While the hour of the clock is greater or equal to 12, subtract 12 from the hours of the clock
While the seconds of the clock are less than 0, add 60 to the seconds and subtract one from the minutes of the clock
While the minutes of the clock are less than 0, add 60 to the minutes and subtract one from the hours of the clock
While the hours of the clock are less than 0, add 12 to the hours of the clock

Answers

Additionally, there is a global friend function rectify() that accepts a Clock object and modifies its time according to the given rules. The main() function demonstrates the usage of the Clock class by creating Clock objects, performing operations, displaying information, and applying the rectify() function to rectify the clocks.

Here's an implementation of the Clock class in C++ based on the given requirements:

cpp

Copy code

#include <iostream>

class Clock {

private:

   int hour;

   int min;

   int sec;

public:

   Clock() : hour(0), min(0), sec(0) {}

   Clock(int h, int m, int s) : hour(h), min(m), sec(s) {}

   void info() {

       std::cout << hour << ":" << min << ":" << sec << std::endl;

   }

   int milliseconds() {

       return 1000 * (3600 * hour + 60 * min + sec);

   }

   friend Clock operator+(const Clock& a, const Clock& b) {

       Clock c;

       c.hour = a.hour + b.hour;

       c.min = a.min + b.min;

       c.sec = a.sec + b.sec;

       return c;

   }

   friend Clock operator-(const Clock& a, const Clock& b) {

       Clock c;

       c.hour = a.hour - b.hour;

       c.min = a.min - b.min;

       c.sec = a.sec - b.sec;

       return c;

   }

   friend void rectify(Clock& clock);

};

void rectify(Clock& clock) {

   while (clock.sec >= 60) {

       clock.sec -= 60;

       clock.min += 1;

   }

   while (clock.min >= 60) {

       clock.min -= 60;

       clock.hour += 1;

   }

   while (clock.hour >= 12) {

       clock.hour -= 12;

   }

   while (clock.sec < 0) {

       clock.sec += 60;

       clock.min -= 1;

   }

   while (clock.min < 0) {

       clock.min += 60;

       clock.hour -= 1;

   }

   while (clock.hour < 0) {

       clock.hour += 12;

   }

}

int main() {

   int h1, m1, s1;

   std::cout << "Enter hour, minute, and second for Clock A: ";

   std::cin >> h1 >> m1 >> s1;

   Clock a(h1, m1, s1);

   int h2, m2, s2;

   std::cout << "Enter hour, minute, and second for Clock B: ";

   std::cin >> h2 >> m2 >> s2;

   Clock b(h2, m2, s2);

   std::cout << "Clock A: ";

   a.info();

   std::cout << "Milliseconds: " << a.milliseconds() << std::endl;

   std::cout << "Clock B: ";

   b.info();

   std::cout << "Milliseconds: " << b.milliseconds() << std::endl;

   Clock sum = a + b;

   std::cout << "Sum of Clock A and B: ";

   sum.info();

   std::cout << "Milliseconds: " << sum.milliseconds() << std::endl;

   Clock diff = a - b;

   std::cout << "Difference of Clock A and B: ";

   diff.info();

   std::cout << "Milliseconds: " << diff.milliseconds() << std::endl;

   rectify(a);

   rectify(b);

   rectify(sum);

   rectify(diff);

   std::cout << "Rectified Clock A: ";

   a.info();

   std::cout << "Rectified Clock B: ";

   b.info();

   return 0;

}

In the Clock class, there are private fields for hour, min, and sec. The class provides a default constructor, a parameterized constructor, and member functions to display the clock time (info()) and calculate the time in milliseconds (milliseconds()). Two friend functions operator+ and operator- are defined to perform addition and subtraction on Clock objects.

Know more about C++ here;

https://brainly.com/question/14617927

#SPJ11

Design a decrease-by-one algorithm for generating the power set of a set of n elements. (The power set of a set S is the set of all the subsets of S, including the empty set and S itself.)
just need Pseudo code

Answers

The power_set function produces all the subsets of a set S using a binary counter after receiving a set S as input. This repeats from 0 to [tex]2^n[/tex] - 1 and for each value of i.

It creates a subset by examining the "j" TH bit of "i" and, if the bit is set, adding the "j" TH element of S to the subset. After that, it uses the created subset to invoke the process function.

The process function applies an operation to the subset it receives as input. Any required operation can be applied to each subset using this function.

This algorithm generates the whole set, including the empty set, along with all of its subsets. You can change the power_set function's loop so that it begins at 1 and ends at 0 if you wish to eliminate these subsets.  from 1 and end at [tex]2^n[/tex] - 2 instead of 0 and [tex]2^n[/tex] - 1.

Learn more about on subsets, here:

https://brainly.com/question/28705656

#SPJ4

A liquid-to-gas counterflow heat exchanger is used to cool gas from 32°C to 18°C. Assuming that the liquid enters at 7°C and leaves at 15°C, calculate the log mean temperature difference in °C. (10 pts)
Draw and label the temperature-flow diagram.
Round off your answer to three (3) decimal places.

Answers

The log mean temperature difference is approximately 13.908°C.

The log mean temperature difference (LMTD) for a liquid-to-gas counterflow heat exchanger can be calculated using the formula:

LMTD = (ΔT1 - ΔT2) / ln(ΔT1 / ΔT2)

where ΔT1 is the temperature difference between the hot and cold fluids at one end, and ΔT2 is the temperature difference between the hot and cold fluids at the other end.

In this case, the hot fluid (gas) enters at 32°C and leaves at 18°C, while the cold fluid (liquid) enters at 7°C and leaves at 15°C. Therefore:

ΔT1 = (32°C - 15°C) = 17°C

ΔT2 = (18°C - 7°C) = 11°C

Substituting these values into the LMTD formula:

LMTD = (17°C - 11°C) / ln(17°C / 11°C)

LMTD = 6°C / ln(1.5455)

LMTD ≈ 6°C / 0.4312

LMTD ≈ 13.908°C

Therefore, the log mean temperature difference is approximately 13.908°C.

Learn more about temperature here

https://brainly.com/question/15969718

#SPJ1

Question 1 Needs Grading 108 491 980 a. Generate the matrix below.A1 = 559 382 207 845 657 714 b. Generate A2 = 4 x 4 random matrix. c. Change A2 so that all its elements are in the range of 10 to 50. d. Convert A into a 4 x 4 matrix by inserting a new column of Os into the 4th column of A, and also row 4 of Az into the 2nd row of Aj. e. What is the 2D correlation coefficient between A1 and A2? f. What is the difference between the standard deviations of all the elements in A1 and A2?

Answers

A1 is a 3 x 3 matrix.A1 = 559 382 207 845 657 714b) A2 is a 4 x 4 matrix of random numbers.A2 = rand(4);c) To obtain random numbers within the range of 10 and 50 in A2, we can multiply rand(4) by 40 and then add 10 to every entry, as shown below.

A2 = rand(4) * 40 + 10;d) To convert A1 into a 4 x 4 matrix by inserting a new column of Os into the 4th column of A and row 4 of Az into the 2nd row of Aj, we can perform the following operations.A1 = [559 382 207; 845 657 714; 0 0 0];Az = [1 2 3 4];Aj = [5 6 7 8];A1(1:end - 1, end + 1) = 0;A1(end + 1, :) = Az;A1(2, :) = Aj;

To find the 2D correlation coefficient between A1 and A2, we can use the corr2 function as shown below.corr2(A1, A2);f) To calculate the standard deviation of all the elements in A1 and A2, we can use the std function. The difference between the standard deviations of A1 and A2 is given by.std(A1(:)) - std(A2(:));

To know more about matrix visit:-

https://brainly.com/question/29168178

#SPJ11

Answer True or False
18. A three-phase variable reluctance stepper motor with 12 stator windings has the windings set 30 degrees apart 19. The two-phase operation of a resolver uses the variation in voltage amplitude to determine shaft position
20. The micro-stepping mode generates small stepping angles through motor current control via PWM of the excitation voltage of the rotor windings
21. A resistance-start motor has a start winding, which is a coil made of many turns of heavy-gauge wire
22. In the capacitor-start induction-run motor, the capacitor generates a current in the start-winding that lags the phase of the voltage input.
23. The centrifugal start switch is usually mounted on the shaft of the AC motor.
24. The performance of the resistance-start induction-run motor and the capacitor-start induction-run motor is basically identical
25. The shaded-pole induction motor is a single-phase motor that has no start and run windings
26. In a three-phase motor, the voltages are 180 degrees out of phase with each other
27. The current required to run the AC motor flows through the thermal overload heater and bimetallic switch contacts
28. In a synchronous motor. The salient poles project outward from the shaft of the motor
29. Detent torque is the maximum load-originating torque that the motor can stand without moving from its position with the stator energized
30. The speed torque and the current-torque curves are linear for the permanent magnetic motor
31. The total encoder error is the sum of the instrument error, quadrature error, interpolation error, and quantization error
32. The coreless motor is chosen over the wound-rotor motor in high torque application
33. The figure of merit is a number that provides and objective method of determining the relative ability of a permanent magnetic motor
34. An optical encoder is a sensor
35. The AC motor is better suited than the DC motor for those applications that require variable speeds
36. On a AC motor plate, the type specifies the motor’s enclosure.
37. Slip is the difference between the speed of the rotating field and the speed of the rotor
38. When selecting a motor, the current rating of the starter must be less than the actual current that the starter will switch
39. In an AC servomotor, the voltage applied to the winding and the voltage applied to the control winding are either in phase or ninety degrees out of phase.

Answers

An electric motor known as a stepper turns electrical pulses into exact mechanical movements. The term stepper motor refers to the fact that it is intended to move in distinct steps or increments. The True or False asked in the various questions are as-

18. True: A three-phase variable reluctance stepper motor with 12 stator windings has the windings set 30 degrees apart.

19. False: The two-phase operation of a resolver uses the variation in voltage amplitude to determine shaft position.

20. True: The micro-stepping mode generates small stepping angles through motor current control via PWM of the excitation voltage of the rotor windings.

21. True: A resistance-start motor has a start winding, which is a coil made of many turns of heavy-gauge wire.

22. True: In the capacitor-start induction-run motor, the capacitor generates a current in the start-winding that lags the phase of the voltage input.

23. True: The centrifugal start switch is usually mounted on the shaft of the AC motor.

24. False: The performance of the resistance-start induction-run motor and the capacitor-start induction-run motor is not basically identical.

25. True: The shaded-pole induction motor is a single-phase motor that has no start and run windings.

26. True: In a three-phase motor, the voltages are 120 degrees out of phase with each other.

27. False: The current required to run the AC motor does not flow through the thermal overload heater and bimetallic switch contacts.

28. True: In a synchronous motor, the salient poles project outward from the shaft of the motor.

29. True: Detent torque is the maximum load-originating torque that the motor can stand without moving from its position with the stator energized.

30. False: The speed-torque and the current-torque curves are not linear for the permanent magnetic motor.

31. True: The total encoder error is the sum of the instrument error, quadrature error, interpolation error, and quantization error.

32. False: The coreless motor is not chosen over the wound-rotor motor in high torque applications.

33. True: The figure of merit is a number that provides an objective method of determining the relative ability of a permanent magnetic motor.

34. True: An optical encoder is a sensor.

35. True: The AC motor is better suited than the DC motor for those applications that require variable speeds.

36. True: On an AC motor plate, the type specifies the motor's enclosure.

37. True: Slip is the difference between the speed of the rotating field and the speed of the rotor.

38. True: When selecting a motor, the current rating of the starter must be less than the actual current that the starter will switch.

39. True: In an AC servomotor, the voltage applied to the winding and the voltage applied to the control winding are either in phase or ninety degrees out of phase.

To know more about Stepper Motor visit:

https://brainly.com/question/33214487

#SPJ11

The method used to blend data from multiple sources so that a data warehouse or data mart can be populated with high quality data is called?
Assoiation
ETL
OLAP
Regression

Answers

The method used to blend data from multiple sources so that a data warehouse or data mart can be populated with high-quality data is called ETL (Extract, Transform, Load).

The ETL process is a method used in data integration and data warehousing to blend data from various sources and transform it into a format suitable for analysis and reporting. Here's a breakdown of the three main steps involved:

Extract: In the extraction phase, data is gathered from multiple sources, which can include databases, files, APIs, or other systems. The data is extracted from these disparate sources, ensuring that it captures the required information for analysis.Transform: After the extraction, the data undergoes transformation to make it consistent, clean, and meaningful. This involves processes such as data cleansing, validation, standardization, and data enrichment. Transformations may also involve combining data from different sources, applying calculations, aggregating values, or creating derived attributes.Load: Once the data has been extracted and transformed, it is loaded into a target system, typically a data warehouse or data mart. This involves storing the transformed data in a structured manner that supports efficient querying and analysis. The data is organized into tables or dimensional models, enabling easy retrieval and analysis by business intelligence tools or applications.

The ETL process is crucial for ensuring data quality, consistency, and usability in a data warehousing environment. It allows organizations to integrate data from various sources, cleanse and enhance it, and provide a unified view of the data for reporting, analysis, and decision-making purposes.

Overall, ETL plays a vital role in data integration, enabling organizations to populate their data warehouses or data marts with high-quality data that can be effectively used for business intelligence and analytics.

To learn more about ETL process, Visit:

https://brainly.com/question/31031148

#SPJ11

14. What additional features do objects have over modules as types? [3 marks] 15. What is the connection among template instantiation in C++, type inference in ML, and program execution in Prolog?

Answers

Answer:14. The additional features objects have over modules as types are: Objects have a more precise type structure than modules, allowing for better modularity and code reuse.

Objects provide encapsulation, which protects the integrity of the data and methods by limiting access to them. Objects have methods, which are functions associated with the object and operate on its data. Objects can be instantiated, allowing for multiple instances of the same object to be created.

15. The connection among template instantiation in C++, type inference in ML, and program execution in Prolog is that they are all related to the type system.

Type systems are used in programming languages to classify values and expressions and to ensure that the correct operations are performed on them. Template instantiation in C++ refers to the process of generating code based on a template. Type inference in ML refers to the process of deducing the type of an expression based on its context. Program execution in Prolog involves unification, which is a type of inference used to match patterns in the database with query patterns.

To learn more about "Encapsulation" visit: https://brainly.com/question/29036367

#SPJ11

Use Routh-Hurwitz criterion to determine how many roots of the following are in the left half-plane, in the right half-plane, and on the jo-axis polynomial P(s) = s5 + s + 2s³ +2s² + 3s +15

Answers

There are two sign changes in this instance, indicating that there are two roots in the left half-plane. There are no jo-axis roots since the coefficients of the polynomial are all positive. Therefore, the polynomial P(s) has two roots in the left half-plane and no roots in the right half-plane or on the jo-axis.

The polynomial P(s)

= s5 + s + 2s³ +2s² + 3s +15

is to be used to determine how many roots are in the left half-plane, the right half-plane, and on the jo-axis using the Routh-Hurwitz criterion. The Routh-Hurwitz criterion is a method for determining the stability of a system with linear differential equations.In this criterion, a polynomial is represented in the form of a matrix, which can then be analyzed to determine the number of roots that fall into the left half-plane, right half-plane, and jo-axis. Let's construct the Routh array of the given polynomial as shown below:

s^5| 1 | 2 | 3| ---|---|---|---s^4| 1 | 2 | 15/2 |s^3| -8/3 | 7/2| 0|s^2| 23/12 | 15/7| 0|s^1| -527/276 | 0| 0|s^0| 15 | 0| 0|

Here, each row corresponds to the power of s, starting with s^5 on the leftmost column and ending with s^0 in the rightmost column.In the first row, we write the coefficients of s^5, s^4, s^3, s^2, s, and s^0, respectively. The second row contains the coefficients of the s^4, s^3, s^2, s, and s^0 terms after creating an auxiliary polynomial. We will then determine the coefficients for each column in the Routh array as follows:For the first column, we simply write down the coefficients of the polynomial. For the remaining columns, we make use of the following equation: a1

= a2 b1 - a1 b2 / b1where a1 and a2 are the coefficients of the previous two rows, and b1 and b2 are the coefficients of the previous row that are in the same column as a1 and a2, respectively.If the Routh array has any negative elements in its first column, then there are roots in the right half-plane. Because there are no negative elements in the first column, we know that there are no roots in the right half-plane. The number of sign changes in the first column of the Routh array is equal to the number of roots in the left half-plane. There are two sign changes in this instance, indicating that there are two roots in the left half-plane. There are no jo-axis roots since the coefficients of the polynomial are all positive. Therefore, the polynomial P(s) has two roots in the left half-plane and no roots in the right half-plane or on the jo-axis.

To know more about polynomial visit:

https://brainly.com/question/11536910

#SPJ11

The continuous system S[] is described as follow: Compute impulse response, h(t), for this system. y(t) = x(t + l) + x(t) – 2x(t - 3)

Answers

We get the impulse response $h(t) = \delta (t+l) + \delta (t) - 2u(t-3)$ for the given system S[].Hence, the answer is: The impulse response of the given system is h(t) = $\delta$(t+l) + $\delta$(t) - 2u(t-3).

Given a system S[] as $y(t)

= x(t + l) + x(t) - 2x(t - 3)$,

we are required to find the impulse response of the given system.The impulse response of a system can be computed by taking the Laplace Transform of the input and output of the system.Let's take $X(s)$ and $Y(s)$ as the Laplace Transform of $x(t)$ and $y(t)$ respectively.$\therefore Y(s)

= X(s) e^{ls} + X(s) - 2e^{-3s}X(s)$

We know that $H(s)$ is the Laplace Transform of impulse response $h(t)$. Therefore,$H(s)

= \fraction{Y(s)}{X(s)}

= e^{ls} + 1 - 2e^{-3s}$

Now, to compute $h(t)$, we need to take the inverse Laplace Transform of

$H(s)$.$h(t)

= \mathscr{L}^{-1} [H(s)]

= \mathscr{L}^{-1} \left[\ e^{ls} + 1 - 2e^{-3s}\ \right]$

Taking the inverse Laplace Transform of each term of $H(s)$, we get,$h(t)

= \delta (t+l) + \delta (t) - 2u(t-3)$.We get the impulse response $h(t)

= \delta (t+l) + \delta (t) - 2u(t-3)$

for the given system S[].Hence, the answer is: The impulse response of the given system is h(t)

= $\delta$(t+l) + $\delta$(t) - 2u(t-3).

To know more about impulse visit:

https://brainly.com/question/30466819

#SPJ11

Using your old array program (Sort and Search), rewrite the program using pointers to manipulate and display the original and sorted contents of the array each array.
Note: Use array++ where array is the name of the array.
original program
#include
#include
#include
using namespace std;
int linearSearch(int[], int);
void printData(string[], int[], double[]);
void bubbleSort(int[], string[], double[]);
int main()
{
const int a = 10;
string name[a];
int year[a];
double tution[a];
int b = 0, r;
ifstream inFile;
inFile.open("index.txt");
if (!inFile)
{
cout << "File not found" << endl;
return 1;
}
while (inFile >> name[b] >> year[b] >> tution[b])
{
b++;
}
cout << "Original Dta" << endl << endl;
printData(name, year, tution);
bubbleSort(year, name, tution);
cout << "\n\nSorted Data" << endl << endl;
printData(name, year, tution);
cout << "\n\nEnter Year:";
cin >> r;
int pos = linearSearch(year, r);
if (pos >= 0)
{
cout << "Record found" << endl;
cout.width(15); cout << std::left << name[pos];
cout << tution[pos] << endl;
}
else
cout << "Record not fund" << endl;
return 1;
}
int linearSearch(int year[], int target)
{
int n = 10;
for (int b = 0; b < n; b++)
{
if (year[b] == target)
return b;
}
return -1;
}
void printData(string names[], int year[], double tution[])
{
int a = 10;
cout.width(20); cout << std::left << "Name";
cout.width(20); cout << std::left << "Year";
cout << "Tution" << endl << endl;
for (int b = 0; b < a; b++)
{
cout.width(20); cout << std::left << names[b];
cout.width(20); cout << std::left << year[b];
cout << tution[b] << endl;
}
}
void bubbleSort(int year[], string names[], double tution[])
{
int Year, b, a = 10;
string Name;
double Tution;
for (b = 1; b < a; ++b)
{
for(int c=0;c<(a-b);++b)
if (year[c] > year[c + 1])
{
Name = names[c];
names[c] = names[c + 1];
names[c + 1] = Name;
Year = year[c];
year[c] = year[c + 1];
year[c + 1] = Year;
Tution = tution[c];
tution[c] = tution[c + 1];
tution[c + 1] = Tution;
}
}
}

Answers

The use of pointers in rewriting the sort and search array program requires a few modifications. The pointers will be used to store the address of each array item. This way, the original array item is not affected by the manipulation process; only the pointer points to the new location of the data it was pointing to previously.

The modified program with pointers will look like this:#include
#include
#include
using namespace std;
int linearSearch(int *year, int target);
void printData(string *names, int *year, double *tution);
void bubbleSort(int *year, string *names, double *tution);
int main()

   {
       cout << "File not found" << endl;
       return 1;
   }
   while (inFile >> name[b] >> year[b] >> tution[b])
   {
       b++;
   }
   cout << "Original Data" << endl << endl;
   printData(name, year, tution);
   bubbleSort(year, name, tution);
   cout << "\n\nSorted Data" << endl << endl;
   printData(name, year, tution);
   cout << "\n\nEnter Year:";
   cin >> r;
   int pos = linearSearch(year, r);
   if (pos >= 0)
   

{
       cout << "Record found" << endl;
       cout.width(15); cout << std::left << name[pos];
       cout << tution[pos] << endl;
   }
   else
       cout << "Record not found" << endl;
   return 1;
}
int linearSearch(int *year, int target)

{
   int n = 10;
   for (int b = 0; b < n; b++)
   {
       if (*(year + b) == target)
           return b;
   }
   return -1;
}
void printData(string *names, int *year, double *tution)
{
   int a = 10;
   cout.width(20); cout << std::left << "Name";
   cout.width(20); cout << std::left << "Year";
   cout << "Tuition" << endl << endl;
   for (int b = 0; b < a; b++)
   {
       cout.width(20); cout << std::left << *(names + b);
       cout.width(20); cout << std::left << *(year + b);
       cout << *(tution + b) << endl;
   }
}
void bubbleSort(int *year, string *names, double *tution)
{
   int Year, b, a = 10;
   string Name;
   double Tution;
   for (b = 1; b < a; ++b)
   {
       for(int c=0;c<(a-b);++c)
           if (*(year + c) > *(year + c + 1))
           {
               Name = *(names + c);
               *(names + c) = *(names + c + 1);
               *(names + c + 1) = Name;
               Year = *(year + c);
               *(year + c) = *(year + c + 1);
               *(year + c + 1) = Year;
               Tution = *(tution + c);
               *(tution + c) = *(tution + c + 1);
               *(tution + c + 1) = Tution;
           }

To know more about previously visit:

https://brainly.com/question/31778751

#SPJ11
   

Consider The Following System: (3 Points) X₂ V(X₁, X₂)= X₁ = (X₂ - 1)X³ X₁ X2 (1+X²)² 1+X² X² 1 + Xi -X²/ Is A Good Candidate For The Lyapunov Show That The Function Function. Determine The Stability Of This System At The Equilibrium Point Of The Origin Coordinates.

Answers

The given system is:X₂ V(X₁, X₂)= X₁ = (X₂ - 1)X³ X₁ X2 (1+X²)² 1+X² X² 1 + Xi -X²/Consider the following steps to find whether the function given above is a good candidate for Lyapunov function: The function must be continuous. It is continuous since it is the sum and product of continuous functions.

The function must be positive definite.

The function is positive definite, since it is a sum of squares of continuous functions. If x1=0 and x2=0, then V(0,0)=0.

Therefore, V(x1,x2)>0 for (x1,x2)≠(0,0)

The derivative of the function with respect to time must be negative semidefinite for the neighborhood of the origin. Taking the derivative of V(x1,x2) with respect to time and substituting the equations given above, we getdV/dt= ∂V/∂x₁ * f₁ + ∂V/∂x₂ * f₂

The Jacobian matrix of the system is:

J(x1,x2)=   [0            1 + 3x²*x₂/(1+x²)²][((1+x²)²-2x²(1+x²))/(1+x²)²        -3x1x2/(1+x²)²]

Therefore, the time derivative of V is:dV/dt= x1x2(1+x²)²(-3x1x2/(1+x²)²)+x³x2(1+x²)²(-3x1x2/(1+x²)²)= -3x1²x2⁴(1+x²)²/(1+x²)²

Now we check if dV/dt is negative semidefinite, that is ifdV/dt < 0 for (x1,x2)≠(0,0).So, -3x1²x2⁴(1+x²)²/(1+x²)² is negative semidefinite.

Therefore, the function given above is a good candidate for Lyapunov function. Since dV/dt is negative semidefinite, the origin coordinates (0,0) are stable. The equilibrium point of the origin coordinates is asymptotically stable when V is radially unbounded. Here, we have V(x1,x2) = x1²x2²(1+x²)² which is not radially unbounded. Therefore, the stability of the system at the equilibrium point of the origin coordinates cannot be concluded.

To know more about system  visit:-

https://brainly.com/question/32668960

#SPJ11

Find the length of the latus rectum of the hyperbola 16x 2
−9y 2
−128x−90y=113. Select one: a. 12 b. 6.75 c. 4.5 d. 10.67 7. Find the area bounded by the curves y=5x−x 2
and the x - axis. Select one. a. 10.67 b. 20.83 c. 16.33 d. 18.5 8. Find the radius of a sphere whose ratio of surface area to volume is equal to 0.5. Select one: a. 6 b. 5 c. 8 d. 7 9. Find the distance between parallel lines x−2y−8=0 and x−2y+8=0. Select one: a. 7.16 b. 9.28 c. 8.64 d. 0 10. A right circular cylinder has its base diameter equal to its height. Find the base radius if its volume is 169.64 cubic cm. Select one: a. 8 cm b. 4 cm \&. 6 cm d. 3 cm ค. 5 cm

Answers

The correct option is d. 18.5. The area bounded by the curves y = 5x - x^2 and the x-axis is 125/6.

To find the area bounded by the curves y = 5x - x^2 and the x-axis, we need to integrate the given function over the appropriate interval. The interval can be determined by finding the x-values where the curve intersects the x-axis. These points can be found by setting y = 0 and solving for x:

0 = 5x - x^2

x(5 - x) = 0

x = 0 or x = 5

So, the interval of integration is [0, 5].

Now, we can calculate the area using the definite integral:

Area = ∫[0, 5] (5x - x^2) dx

= [5/2 * x^2 - 1/3 * x^3] evaluated from 0 to 5

= (5/2 * 5^2 - 1/3 * 5^3) - (5/2 * 0^2 - 1/3 * 0^3)

= (125/2 - 125/3) - (0 - 0)

= 375/6 - 250/6

= 125/6

The area bounded by the curves y = 5x - x^2 and the x-axis is 125/6.

Therefore, the correct option is d. 18.5.

Note: The options provided in the question seem to be different from the calculated results. Please double-check the options for accuracy.

Learn more about curves here

https://brainly.com/question/13445467

#SPJ11

Provide a block diagram showing a dual loop control system for
backlash compensation.

Answers

A dual-loop control system for backlash compensation consists of two cascaded loops, with the inner loop controlling the velocity and the outer loop controlling the position. The block diagram is given below

The system shown in the block diagram above uses two loops, with the outer loop controlling the position and the inner loop controlling the velocity of the actuator. Backlash is a source of nonlinearity that causes a delay in the system's response. As a result, the actuator's motion will be different for forward and reverse directions of motion, causing positioning errors.

To compensate for this, the position loop and velocity loop are combined to form a dual-loop control system. The velocity loop is used to provide feedback to the position loop to reduce the impact of the backlash. As a result, the velocity loop acts as an inner loop, and the position loop acts as an outer loop. The velocity loop is made up of a tachometer or an encoder that provides feedback to the system about the actuator's velocity.

A proportional-integral-derivative (PID) controller is used to control the velocity loop. The output of the velocity controller is fed to the position controller, which is also a PID controller. The position controller takes the reference position and feedback position and calculates the error signal, which is fed to the PID controller.The output of the position controller is fed to the actuator to produce motion.

To know more about Control System visit:

https://brainly.com/question/28136844

#SPJ11

Description Create a class called Student. It is designed to manage the status of a student in a course. The class should have the following attributes: • First name • Last name Number of assignments completed Number of quizzes completed Current quiz percentage (average grade of quizzes completed so far) • Current assignment percentage (average grade of assignments completed so far) Your class will have a single constructor. It will receive two parameters: the student's first and last names. All other values will be initialized to zero. Your class will have the following methods: • • Accessors for current quiz percentage and current assignment percentage addAssignment, which receives as a parameter the grade of a new assignment. This method will increment the number of completed assignments and recalculate the current assignment percentage. It will return the new percentage. • addQuiz, which receives as a parameter the grade of a new quiz. This method will increment the number of completed quizzes and recalculate the current quiz percentage. It will return the new percentage. • currentGrade, which receives no parameters and returns the student's current overall grade in the course. For that, assignments are weighted twice as heavily as quizzes, so the current assignment percentage would be 2/3 of the current overall grade.

Answers

A class Student is created to manage the status of a student in a course, and it has the following attributes:• First name• Last name• Number of assignments completed• Number of quizzes completed• Current quiz percentage (average grade of quizzes completed so far)• Current assignment percentage (average grade of assignments completed so far). This class has a single constructor that accepts two parameters, the student's first and last names. All other values will be initialized to zero.

The methods in this class include: Accessors for current quiz percentage and current assignment percentageaddAssignment - This method receives as a parameter the grade of a new assignment. It will increment the number of completed assignments and recalculate the current assignment percentage. It will return the new percentage.addQuiz - This method receives as a parameter the grade of a new quiz. It will increment the number of completed quizzes and recalculate the current quiz percentage. It will return the new percentage.

currentGrade - This method receives no parameters and returns the student's current overall grade in the course. For that, assignments are weighted twice as heavily as quizzes, so the current assignment percentage would be 2/3 of the current overall grade. Accessors for current quiz percentage and current assignment percentage are also included in this class.

Accessors are special methods that are used to access the value of a class's private data members. Accessors have a public scope, meaning they can be accessed by any object that has an instance of the class, but they are designed to return the value of private data members, not modify them. This allows you to provide controlled access to your class's data members, rather than giving full access to them.

Let's learn more about Accessors:

https://brainly.com/question/31972984

#SPJ11

In C++, in complexno.h, add overloading operators +, -, *, and << for the methodes add( const Complexno & ),sub(const Complexno&), mult(Complexno&)); and void shownum(); respectively. Add overloaded operator / for the division operator, so that it can do division on two complex numbers. Modify your implementation file complexno.cpp to implement the Complexno class and the necessary overloaded operators.

Answers

The answer below has been structured in a stepwise fashion.

Step: 1

Program:

complexno.h

// complexno.h file

#ifndef COMPLEXNO_H

#define COMPLEXNO_H

#include <iostream>

#include <cmath>

using namespace std;

class Complexno {

public :

Complexno(); // Default constructor

Second constructor: Complexno(double r); // Produces a complex number with the same value as a real.

Complexno(double r, double c); // Sets both the real and complex variables in the standard constructor.

friend Complexno operator + (Complexno,Complexno);

friend Complexno operator * (Complexno,Complexno);

friend Complexno operator - (Complexno,Complexno);

friend Complexno operator / (Complexno,Complexno);

friend ostream& operator<<(ostream &,Complexno &);

double magnitude(); // (4) Computes and returns the magnitude of a complex number.

void shownum(); // (5) Prints out a complex number in a readable format.

Complexno negate(); // Negates a complex number.

void enternum(); // Reads in a complex number from the user.

private :

double real; // Stores real component of complex number

double complex; // Stores complex component of complex number

};

// Displays the answer to a complex number operation.

void display(Complexno, Complexno, Complexno, char);

#endif

complexno.cpp

//complexno .cpp file

#include <cmath>

#include "complexno.h"

// Default constructor sets both components to 0.

Complexno::Complexno() {

real = 0.0;

complex = 0.0;

}

// Second constructor - creates a complex number of equal value to a real.

Complexno::Complexno(double r) {

real = r;

complex = 0.0;

}

// (1) ---------- standard constructor -----------

//Define standard constructor - sets both of the real and complex components based

Complexno::Complexno(double r, double c) {

real = r;

complex = c;

}

//................overloaded operator + ................

// Adds two complex numbers and returns the answer.

Complexno operator + (Complexno num1,Complexno num2) {

Complexno answer;

answer.real = num1.real + num2.real;

answer.complex = num1.complex + num2.complex;

return answer;

}

// (2) ------- overloaded operator -----

// Define sub to subtracts two complex numbers and returns the answer.

Complexno operator - (Complexno num1,Complexno num2) {

Complexno answer;

answer.real = num1.real - num2.real;

answer.complex = num1.complex - num2.complex;

return answer;

}

// (3) ----------- overloaded operator * ---------------

// Multiplies two complex numbers and returns this answer.

Complexno operator * (Complexno num1,Complexno num2) {

Complexno answer;

answer.real = num1.real * num2.real - num1.complex * num2.complex;

answer.complex = num1.real * num2.complex + num1.complex * num2.real;

return answer;

}

// ----------- overloaded operator /------------------

// Division two complex numbers and returns this answer.

Complexno operator / (Complexno num1,Complexno num2) {

Complexno answer;

answer.real = (num1.real * num2.real + num1.complex * num2.complex)/(num2.real * num2.real + num2.complex * num2.complex);

answer.complex = (num1.real * num2.real - num1.complex * num2.complex)/(num2.real * num2.real + num2.complex * num2.complex);

return answer;

}

// -------------- overloaded operator << ------------

ostream& operator<<(ostream &out,Complexno &C)

{

out<<"(";

out<<C.real;

out<<"+";

out<<C.complex<<"i)";

return out;

}

// Negates a complex number.

Complexno Complexno::negate() {

Complexno answer;

answer.real = -real;

answer.complex = -complex;

return answer;

}

// (4)--------------- Magnitude ----------------

// Computes and returns the magnitude of a complex number.

double Complexno::magnitude() {

double answer;

answer = sqrt(real * real + complex * complex);

return answer;

}

// (5) --------------- Print ----------------

// Prints out a complex number in a readable format.

void Complexno::shownum() {

if(complex == 0){

cout << "(" << real << ")";

}

else{

if(complex > 0)

cout << "(" << real << "+" << complex << "i" << ")";

else

cout << "(" << real << complex << "i" << ")";

}

}

// Reads in a complex number from the user.

void Complexno::enternum() {

cout << "Enter the real part of the complex number : ";

cin >> real;

cout << "Enter the imaginary part of the complex number : ";

cin >> complex;

}

// Displays the answer to a complex number operation.

void display(Complexno n1, Complexno n2, Complexno n3, char op) {

n1.shownum();

cout << " " << op << " ";

n2.shownum();

cout << " = ";

n3.shownum();

cout << endl;

}

main.cpp

#include <iostream>

#include "complexno.h"

using namespace std;

int main()

{

Complexno c1(10.0,5.0);

Complexno c2(5.0,1.0);

Complexno c3 = c1+c2;

Complexno c4 = c1-c2;

Complexno c5 = c1*c2;

Complexno c6 = c1/c2;

display(c1,c2,c3,'+');

display(c1,c2,c4,'-');

display(c1,c2,c5,'*');

display(c1,c2,c6,'/');

cout<<"\nTest operator<< overloading: "<<endl;

// using operator<< overloading

cout<<"C1: "<< c1<<endl;

cout<<"C2: "<< c2<<endl;

cout<<c1<<" + "<<c2<<" = "<<c3;

}

Know more about C++ program:

https://brainly.com/question/23866418

#SPJ4

WEEK 7 ASSIGNMENT#2
The Week 7 Script will create a star schema and populate the schema with test values. After you run the script use the star schema to address the following questions.
Note: This script will create the star schema in the master database. Once you have executed this script make sure you change your database to use master before you execute your select statements.
Return the sum of the units sold by product name.
Return the sum of the units sold by product name and quarter.
Return the sum of the units sold by product name and quarter where the year is equal to 2016.
Return the sum of units sold * sales amount as total sales.
Return the sum of units sold * sales amount as total sales by the sales team having total sales greater than 100.

Answers

The SQL Command for each case is coded below.

To address the questions, you would typically write SQL queries to retrieve the desired information from the star schema. Assuming you have a star schema with the relevant tables, such as a fact table for sales and dimension tables for product, time, and sales team, here are example queries for each question:

1. Return the sum of the units sold by product name:

SELECT p.product_name, SUM(s.units_sold) AS total_units_sold

FROM sales_fact s

JOIN product_dim p ON s.product_id = p.product_id

GROUP BY p.product_name;

2. Return the sum of the units sold by product name and quarter:

SELECT p.product_name, t.quarter, SUM(s.units_sold) AS total_units_sold

FROM sales_fact s

JOIN product_dim p ON s.product_id = p.product_id

JOIN time_dim t ON s.time_id = t.time_id

GROUP BY p.product_name, t.quarter;

3. Return the sum of the units sold by product name and quarter where the year is equal to 2016:

SELECT p.product_name, t.quarter, SUM(s.units_sold) AS total_units_sold

FROM sales_fact s

JOIN product_dim p ON s.product_id = p.product_id

JOIN time_dim t ON s.time_id = t.time_id

WHERE t.year = 2016

GROUP BY p.product_name, t.quarter;

4. Return the sum of units sold * sales amount as total sales:

SELECT SUM(s.units_sold * s.sales_amount) AS total_sales

FROM sales_fact s;

5. Return the sum of units sold * sales amount as total sales by the sales team having total sales greater than 100:

SELECT st.sales_team_id, SUM(s.units_sold * s.sales_amount) AS total_sales

FROM sales_fact s

JOIN sales_team_dim st ON s.sales_team_id = st.sales_team_id

GROUP BY st.sales_team_id

HAVING SUM(s.units_sold * s.sales_amount) > 100;

Learn more about SQL Command here:

https://brainly.com/question/31852575

#SPJ4

Create a program that (a) write data to a binary file, (b) read and display the data from the same binary file stored in the disk. Use the class you have created in Problem 2. To retrieve the data from the file saved in the disk, the number of data can be computed using rfile.seekg (0,ios::end); auto fileSize = rfile.tellg(); nData = fileSize/sizeof (StudentInfo); rfile.seekg (0) ; where rfile is the name of the binary file variable opened. nData is the number of data as integer variable. Sample Output: Enter number of data to encode: 1 Enter Student [0] Data: Name: Benjie Dela Rosa Course: Mechanical Engineering Year Level: 2nd Year Age: 19 These are the data you have encoded: Name: Benjie Dela Rosa Course: Mechanical Engineering YearLevel: 2nd Year Age: 19 The data you entered will now be saved to the disk with filename "Student.dat" These are the data retrieved from the file saved in the disk: Name: Benjie Dela Rosa Course: Mechanical Engineering YearLevel 2nd Year Age 19 Press any key to continue . . .in C++ please
below is from Problem 2
#include
using namespace std;
//StudentInfo class
class StudentInfo
{
//data member in private
string Name;
string Course;
string yearLevel;
int Age;
public:
//constructer but we are not using it to initialize values
StudentInfo() {
};
//setter to set values
void setStudentInfo() {
//we are usin getline() function because we need
//string with space
cout << "Name: ";
getline(cin, Name);
cout << "Course: ";
getline(cin, Course);
cout << "Year level: ";
getline(cin, yearLevel);
cout << "Age: ";
cin >> Age;
}
//getter to get values
void getStudentInfo() {
cout << "Name: " << Name << endl;
cout << "Course: " << Course << endl;
cout << "Year level: " << yearLevel << endl;
cout << "Age: " << Age << endl;
}
};
//function to print values.This function is
//using getStudentInfo() class function to
//excess private data member
void printStudentInfo(StudentInfo stu) {
stu.getStudentInfo();
}
int main() {
//num is number of student
int num;
cout << "Enter number of data to encode: ";
cin >> num;
cout< //array of class studentInfo type and size of array is num
StudentInfo studentArray[num];
//loop to get input
for (int i = 0; i < num; i++) {
//cin.ignore() flushes whitespace.It is very necessary
//because we need to flush whitespace to get correct
//input strings
cin.ignore();
cout <<"Enter Student[" << i << "] Data :" << endl;
//calling setStudentInfo() member function
studentArray[i].setStudentInfo();
cout< }
cout << "\nThese are the data you have encoded: " << endl;
for (int i = 0; i < num; i++) {
//calling printStudentInfo() function to print
printStudentInfo(studentArray[i]);
cout< }
return 0;
}

Answers

The given program below is to be created using C++ that (a) write data to a binary file, (b) read and display the data from the same binary file stored in the disk. Use the class you have created in Problem 2. To retrieve the data from the file saved in the disk, the number of data can be computed using rfile.

seekg (0,ios::end); auto fileSize = rfile.tellg(); nData = fileSize/sizeof (StudentInfo); rfile.seekg (0) ; where rfile is the name of the binary file variable opened. nData is the number of data as integer variable.#include
#include
using namespace std;

//StudentInfo class
class StudentInfo
{
//data member in private
string Name;
string Course;
string yearLevel;
int Age;
public:

//getter to get values
void getStudentInfo() {
cout << "Name: " << Name << endl;
cout << "Course: " << Course << endl;
cout << "Year level: " << yearLevel << endl;
cout << "Age: " << Age << endl;
}
};
//function to print values.This function is
//using getStudentInfo() class function to
//excess private data member
void printStudentInfo(StudentInfo stu) {
stu.getStudentInfo();
}

To know more about retrieve visit:

https://brainly.com/question/29371932

#SPJ11

If "I" is the length of the line and angle made with x-axis is x° then departure (D) of the line is

Answers

A right-angled triangle formed by the line, where the hypotenuse represents the length (I) and the adjacent side represents the departure (D). If the line does not form a right angle with the x-axis, additional adjustments or transformations may be required to accurately calculate the departure.

The departure (D) of a line can be calculated based on its length (I) and the angle (x°) it makes with the x-axis. The departure represents the horizontal distance between the starting point and the ending point of the line.

To calculate the departure, we use the following trigonometric formula:

D = I * cos(x°)

Here, "cos" represents the cosine function, which relates the adjacent side (departure) to the hypotenuse (length of the line) based on the given angle.

By multiplying the length (I) of the line by the cosine of the angle (x°), we can determine the departure (D) of the line.

Note that this calculation assumes a right-angled triangle formed by the line, where the hypotenuse represents the length (I) and the adjacent side represents the departure (D). If the line does not form a right angle with the x-axis, additional adjustments or transformations may be required to accurately calculate the departure.

Learn more about hypotenuse here

https://brainly.com/question/30800009

#SPJ11

Assemble a circuit representing the number of logical 1s from the input where the input data are: 4-digit binary numbers B3, B2, B1, B0. Using 1 bit Cascade (counter) method

Answers

By using a 1 bit cascade (counter) method, the circuit diagram of the number of logical 1s from the input is given below.

1-bit Cascade (Counter) methodA 1-bit cascade (counter) is a counter that counts the number of logical 1's in a binary number from B0 to B3. It operates by incrementing the count by 1 every time there is a logical 1 in the binary number.

To count the number of logical 1s, we start by setting the first bit (B0) of the output to the value of the input (B0) as shown in the figure below.

After setting the first bit of the output, we then use the OR gate to determine if there is a logical 1 in the next bit of the input, B1. If there is a logical 1 in B1, the output bit B1 will be set to 1. If there is no logical 1 in B1, the output bit B1 will be set to 0. The output bit B1 will then be used to determine whether there is a logical 1 in the next bit of the input, B2, by using another OR gate as shown below.

After setting the bits B0 and B1 of the output, we continue this process for the remaining bits of the input until we have counted all the logical 1's. In this case, we have a 4-bit input, so we will have 4 output bits, B0 to B3, that will represent the number of logical 1's in the input.

Learn more about binary number: https://brainly.com/question/28222245

#SPJ11


1. (24 pts) Let u(t) = sinc(60t) + sinc(120t). Let h(t) = 100 sinc(100t). (a) (4 pts) Sketch U(f). (b) (10 pts) Let Ik = u(k/100) and let v(t) = Σk=-[infinity]0² k sinc(100tk). Find an expression for v that does not involve any summations. (c) (10 pts) Let Ik = (u * h) (k/100) and let w(t) = [infinity] sinc(t - k/100). Find an expression for w that does not involve any summations.

Answers

The integration limits [-∞,∞] indicate that the integral is taken over the entire real line.

(a) To sketch U(f), we need to analyze the frequency content of the given signal u(t) = sinc(60t) + sinc(120t).

The sinc function has a main lobe centered around zero frequency and side lobes extending to positive and negative frequencies. The width of the main lobe and the height of the side lobes depend on the parameter of the sinc function.

For u(t) = sinc(60t), the main lobe of the sinc function is wider than u(t) = sinc(120t).

This means that u(t) = sinc(60t) contains lower frequency components compared to u(t) = sinc(120t).

Since u(t) = sinc(60t) + sinc(120t), the frequency content of U(f) will be a combination of the frequency components of sinc(60t) and sinc(120t).

The sketch of U(f) will show two main lobes centered around the frequencies corresponding to sinc(60t) and sinc(120t), with side lobes extending to positive and negative frequencies.

(b) To find an expression for v(t), we need to compute the sum of the terms in the series Σk=-∞ to 0² k sinc(100tk).

Let's simplify the expression for v(t):

v(t) = Σk=-∞ to 0² k sinc(100tk)

= -∞∑k=0² k sinc(100tk)

= -sinc(0) - 2sinc(100t) - 3sinc(200t) - ...

The expression for v(t) that does not involve any summations is:

v(t) = -sinc(0) - 2sinc(100t) - 3sinc(200t) - ...

(c) To find an expression for w(t), we need to compute the convolution of u(t) = sinc(60t) + sinc(120t) and h(t) = 100 sinc(100t).

Let's simplify the expression for w(t):

w(t) = (u * h)(t)

= ∫[-∞,∞] (u(τ)h(t - τ)) dτ

Expanding the integral and evaluating the convolution, we have:

w(t) = ∫[-∞,∞] (u(τ)h(t - τ)) dτ

= ∫[-∞,∞] ((sinc(60τ) + sinc(120τ))(100 sinc(100(t - τ)))) dτ

= ∫[-∞,∞] (100 sinc(60τ) sinc(100t - 100τ) + 100 sinc(120τ) sinc(100t - 100τ))) dτ

= 100 ∫[-∞,∞] (sinc(60τ) sinc(100t - 100τ) + sinc(120τ) sinc(100t - 100τ))) dτ

The expression for w(t) that does not involve any summations is:

w(t) = 100 ∫[-∞,∞] (sinc(60τ) sinc(100t - 100τ) + sinc(120τ) sinc(100t - 100τ))) dτ

Please note that the integration limits [-∞,∞] indicate that the integral is taken over the entire real line.
To know more about expression  visit:

https://brainly.com/question/28170201

#SPJ11

Let K = 3. Find the poles and zeros of T(s), and show them on the s-plane. Then. find the time-domain response of the system to the unit step excitation e(t) = u(t). K s+1 H(s) = = s-1 S-2 B (s): =

Answers

Laplace transform of the transfer function and hence found the time-domain response of the system to the unit step excitation. We also found the output of the system in the time-domain.

The given transfer function is

H(s)=K(s+1)S(s−1)(s−2)

Let K=3.Then the transfer function becomes,

H(s)=3(s+1)S(s−1)(s−2)

Now, we need to find the poles and zeros of the transfer function.

For that, we can factorize the denominator of the transfer function as follows.

S(s−1)(s−2)=0⇒s=0,s=1and s=2.

So, the zeros of the transfer function are s=−1.

The poles of the transfer function are s=0, s=1, and s=2.So, the zeros of the transfer function are −1 and the poles of the transfer function are 0, 1, and 2. s-plane:

The transfer function H(s) is not stable as it has poles in the right-half of the s-plane.  

To find the time-domain response of the system to the unit step excitation e(t)=u(t), we need to find the inverse Laplace transform of the transfer function.

The transfer function can be written as,

H(s)=1(s−1)−1(s−2)+3(s+1)s.

Taking inverse Laplace transform on both sides,

L{H(s)}=L{1(s−1)−1(s−2)+3(s+1)s}=L{1(s−1)}−L{1(s−2)}+3L{s+1}s.

Now, using the property,

L{1a}=e(at)we get,

L{H(s)}=et−e2t+3L{s+1}s

Applying the Laplace transform to the function L{s+1}s, we get,

L{s+1}s=L{s}+L{1s}=1s2.

Now, substituting this in the above expression, we get,

L{H(s)}=et−e2t+3(1s2). The inverse Laplace transform of the expression 1/s^2 is t.

So, the inverse Laplace transform of the transfer function becomes,

L{H(s)}=et−e2t+3t. Therefore, the time-domain response of the system to the unit step excitation is given by,

e(t)=u(t)  ⇒ E(s)=1/s

Taking inverse Laplace transform on both sides,

L{e(t)}=L{u(t)}⇒e(t)=δ(t)where, δ(t) is the unit impulse function. ]

Now, the output of the system is given by,

Y(s)=E(s)H(s)⇒Y(s)=3(s+1)s(s−1)(s−2)

Taking partial fraction of the transfer function, we get,

Y(s)=1s−2−1s−1+3s

Then,

L{Y(s)}=L{1s−2}−L{1s−1}+3L{s}=e2t−et+3

So, the time-domain response of the system to the unit step excitation is given bye(t)=u(t)⇒E(s)=1/s

L{Y(s)}=e2t−et+3

To summarize, we first found the poles and zeros of the transfer function. We then represented them on the s-plane. We then found the inverse Laplace transform of the transfer function and hence found the time-domain response of the system to the unit step excitation. We also found the output of the system in the time-domain.

To learn more about partial fraction visit :

brainly.com/question/30763571

#SPJ11

Homework 5.4 For the following characteristic equations, use the Routh-Hurwitz criterion to determine the range of K values for which the system is stable, where a and b are assumed to be known. 5s3 + 5as2 + bs + 5K = 0

Answers

The system is stable for all values of a and b. But, for the system to be stable, the value of K must be such that 5K > 0, i.e., K > 0. Hence, the range of K values for which the system is stable is K > 0.

Routh-Hurwitz criterion The Routh-Hurwitz criterion is used to decide whether the linear system is stable or not. This criterion is based on the coefficients of the characteristic equation of the system.For the characteristic equation

5s3 + 5as2 + bs + 5K

= 0, the Routh table is constructed as follows:Coefficients 5, 5a, b, 5KRow 15 5a Row 25K / 5 0 Row 3b / 5 The necessary condition for the stability of the system is that all the elements in the first column of the Routh array have the same sign (positive or negative). If this condition is not satisfied, then the number of right-half plane poles is equal to the number of sign changes in the first column. Therefore, the system is unstable for such values of the coefficients.In this case, there is no change in sign of the coefficients in the first column of the Routh array. So, the system is stable for all values of a and b. But, for the system to be stable, the value of K must be such that 5K > 0, i.e., K > 0. Hence, the range of K values for which the system is stable is K > 0.The solution for Homework 5.4:For the following characteristic equations, use the Routh-Hurwitz criterion to determine the range of K values for which the system is stable, where a and b are assumed to be known.

5s3 + 5as2 + bs + 5K

= 0.

The Routh table is constructed as follows:Coefficients 5, 5a, b, 5KRow 15 5a Row 25K / 5 0 Row 3b / 5 The necessary condition for the stability of the system is that all the elements in the first column of the Routh array have the same sign (positive or negative).If this condition is not satisfied, then the number of right-half plane poles is equal to the number of sign changes in the first column. Therefore, the system is unstable for such values of the coefficients.In this case, there is no change in sign of the coefficients in the first column of the Routh array. The system is stable for all values of a and b. But, for the system to be stable, the value of K must be such that 5K > 0, i.e., K > 0. Hence, the range of K values for which the system is stable is K > 0.

To know more about stable visit:

https://brainly.com/question/17767511

#SPJ11

Suppose that a (Java) class C is declared to extend two different classes A and B , both of which define a method called x(). The subclass itself does not overload this method x(). Let's say we call x() on a C-object somewhere. a. This will use the implementation provided by B (the last superclass mentioned in C's signature). b. This will use the implementation provided by A (the first superclass mentioned in C's signature). c. The compiler will complain because C must explicitly overload this method x(). O d. The compiler will complain because Java does not allow C to extend both A and B in this way.

Answers

Suppose that a (Java) class C is declared to extend two different classes A and B , both of which define a method called x(). The subclass itself does not overload this method x(). Let's say we call x() on a C-object somewhere This will use the implementation provided by B (the last superclass mentioned in C's signature).

In Java, when a class extends multiple classes that have a method with the same name, the implementation of the method from the last superclass mentioned in the class's signature will be used. This is known as method overriding. If class C does not override the method x() itself, it will inherit the implementation from class B.

Know more about Java here;

https://brainly.com/question/33208576

#SPJ11

Write a program that accepts an integer between 100 and 10,000,000 and then determines whether the number entered is a palindrome. An integer is a palindrome if the reverse of that number is equal to the original number. NOTE: Do not use strrev function of string.h.

Answers

To write a program that accepts an integer between 100 and 10,000,000 and then determines whether the number entered is a palindrome or not, follow the steps given below: Step 1: Declare a variable num and intialize it with 0.Step 2: Take input from the user and store it in the variable num. Step 3: Declare two variables i and j and initialize them with 0.Step 4: Declare a variable flag and initialize it with 1.

Step 5: Declare an array arr of size 10,000,000 and intialize it with 0.Step 6: Store each digit of num in the array arr in reverse order using the while loop.Step 7: Now, traverse the array arr using the for loop and compare the ith and jth element of the array.

Step 8: If ith and jth element of the array are not same, then the number is not a palindrome and the flag is set to 0.Step 9: If ith and jth element of the array are same, then the loop continues and the flag is set to 1.Step 10: At last, if the flag is 1, then print the number is a palindrome else print the number is not a palindrome.Below is the C++ implementation of the above approach:```
#include
using namespace std;
int main()
{
   int num, i = 0, j = 0, flag = 1, arr[10000000] = {0};
   cin >> num;
   while (num != 0)
   {
       arr[i] = num % 10;
       i++;
       num /= 10;
   }
   j = i - 1;
   for (i = 0; i < j; i++, j--)
   {
       if (arr[i] != arr[j])
       {
           flag = 0;
           break;
       }
   }
   if (flag == 1)
       cout << "The number is a palindrome";
   else
       cout << "The number is not a palindrome";
   return 0;
}
```

To know more about program visit:

https://brainly.com/question/30613605

#SPJ11

Other Questions
Jordan Company, which sells electric razors, had $380,000 of cost of goods sold during the month of June. The company profects a 9. percent increase in cost of goods sold during July. The inventory balance as of June 30 is $31,000, and the desired ending inventory balance for July is $32,000 Jordan pays cash to settle 80 percent of its purchases on account during the month of purchase and pays the remaining 20 percent in the month following the purchase. The accourits payable bafance as of June 30 was $32,000 Required o. Determine the amount of purchases budgeted for July. b. Determine the amount of cash payments budgeted for invertory purchases in July 3. CLASS PRESENTATION: Each team to present for 5 minutes a situational leadership example.a. Describe a situation where you had to exercise some form of leadership. This could be at work, prior school experience, sports, any life situation. Discuss among the team to see which situation the team would like to present.b. Using the Hersey and Blanchard's Situational Theory on Leadership Style describe what leadership style was appropriate for your leadership example and tell us why.c. What leader behavior did your exercise in the situation and was it an effective or ineffective behaviour? If it wasn't effective, what could be a more effective behaviour.d. Use Powerpoint Presentation slides to present. Time yourselves to make sure you don't exceed 5 minutes, or you will get cut off. Be ready to answer questions from classmates.e. Each team selects a presenter to present in class. Each member will take turns in future assignments. Once you have presented, your team needs to pick another member to present for the next assignment.f. Team members list is in MOODLE - under ANNOUNCEMENTS.g. Each team member gets the team grade for the assignment This project's purpose is to form a portfolio with 2 risky assets (2 common stocks) and a free auet it-year Treasury bhi and cite the opportfoloweghecaong these a Pick 2 stocks you are interested in investing (They can be any stock, as long as they are common stocks listed on NYSE/Nasdag/Amed for each of the stock, do the following (3) Obtain its 5-year historical daily prices (1/1/2017-12/31-2021) on Yahoo finance and calcolate as diy holding perind return (2) Generate a summary statistics report on its holting period returns, using Data Analysis tool (3) Create a Histogram chart on its holding period retums, using Data Analysis tool Brange needs to be created by you, not automatically by Excel (4) Estimate its analized volatility using all the holding period retas broen (1) 153 Download the historical data for market index during the same sample period and calculate its holding period retums. Since GSPC is not available to download directly on yahoo ance you can use "SPY instead, which is an ETF for S&P 500 index Use SPY's holding period reums as market returm, nun agression to estimate the beta of this stock. V stock rum. X market returns (6) Once beta is estimated, calculate the expected return of this stock uning CAPM. According to CAPM, Expected return-Rtbeta use 1% as Rt. Rm is historical annualized market return, which cant in this equation to risk-tree rate, you can culated using average of caly S&P 500 retums in part de multiplied by 252 17) Use the expected return and annualized volatility you estimated in part (4) and (6), simulate daly stock prices for the next 252 days, assuming stock prices follow Geometric Brownian Motion (8) Forma portfolio with both stocks and risk-free asset. To set up the portfolio, stocks mean should be CAPM retum trom part i storky SD should be annaltrest volinity from part 14 Risk free rate is 1%. Estimate the correlation coefficients between two stocks. Use this formula-CORRELO-PRs of stock1 PR of stock 21 (9) Set a target portfolio return, use Solver to estimate the optimal weights for all assets in your portfolio (Te if your solver is unable to give you a solution, consider changing your target portfolio return to a more realistic number, for example, if both your stocks have expected retums around 10% based on CAPM, setting a target portfolio return of 20% will probably not work) Name and describe the 3 architecture models that we typically use in OO-style design. 6. (4 pts) N 2 clients are accessing, via an intermediate component (for example, a cache), the same resource provided by a REST-based web service. Each client's representation of that resource is derived using client-specific information. What happens when that intermediate component receives a request to access the resource and a representation of that resource is present in the intermediate's cache? How much would you need to invest today to have $10,000 available 10 years from now if you are able to earn 4% interest on your initial investment?Group of answer choices$6,000$6,830$6,756$6,950$9,960 Independent random samples, each containing 80 obsorvations, were solocted from two populations. The samples from populations 1 and 2 produced 17 and 10 successes, respoctively. Tost H 0:(p 1p 2)=0 against H a:(p 1p 2)=0. Uso =0.1. (a) The test statistic is (b) The P-value is (c) The final conclusion is A. We can reject the null hypothesis that (p 1p 2)=0 and accept that (p 1p 2)=0. B. There is not sufficient evidence to reject the null hypothesis that (p 1p 2)=0. Note: You can earn partial credit on this problem. From the mid-1950s until 1975, a war raged in the Southeast Asian country of Vietnam. U.S. involvement in that conflict divided America. Some people supported the war, while others were fiercely against it. More than fifty-eight thousand U.S. troops and other military personnel died in Vietnam. Those who survived often felt disrespected when they came home. By the late 1970s, however, people began to recognize that no matter how they felt about the war, the bravery and sacrifice of those who fought should be recognized. In 1979, Vietnam veterans Jan Scruggs and Robert Doubek started the Vietnam Veterans Memorial Fund (VVMF). They wanted to create a memorial to honor those who had fought in the war and to provide a space for Americans to grieve and heal. The memorial design was chosen through a contest. The contest rules stated that the designs should not contain political statements and that they should include the names of all Americans who had died in the war or remained missing. The judges were well-known architects, city planners, and other professionals. Designs were submitted "blindly," meaning that the judges didn't know who the designers were. To many people's surprise, the winner of the contest was a twenty-one year old student named Maya Lin. At the time, Lin was still studying architecture and was not yet a professional designer. At first glance, Lin's design seemed simple: it was a V-shaped wall made of smooth, dark granite, inscribed with the name of every American who had died or gone missing in the war. Lin wanted the memorial to be a symbol of the great loss of life during the war. She also envisioned a place where people could come to remember, reflect, and feel a sense of peace. The Vietnam Memorial Wall that Maya Lin designed was installed in Constitution Gardens in Washington, D.C. One arm of the wall extends toward the Lincoln Memorial, while the other points toward the Washington Monument. The center of the wall is over ten feet high, while the farthest ends of the arms rise just eight inche There are times when you want a link to another website to open in a separate window. Which scenario best fits? O Keep my website in the original window so the user will come back to it O Have another window open making it easier for the user to surf the linked website O Be sure that the user has JavaScript enabled in their browser Suppose there is a bowl of 21 Hershey's Miniatures candy bars on the table containing 6 Mr. Goodbars (G), 6 Krackel bars (K), and 9 Hershey chocolate bars (H). Someone already ate all the Special Dark chocolate bars since dark chocolate is good for you. You are going to grab 6 bars, without replacement. (Who'd want to replace them? We'd still eat 'em). Setup and calculate each probability below. Express your answer in decimal form, including as many decimal places as your calculator will give you. P(all 6 are Hershey chocolate bars): Set up: Result: (9/6)/(21/6) 0.0015479876161 P(2 are Mr. Goodbars, and 4 are Krackel bars): Set up: Result: P(4 are Krackel bars, and 2 are Hershey chocolate bars): Set up: Result: P(none of the 6 bars are Hershey chocolate bars): Set up: Result: Write an assembly code that multiplies two matrices of size m x n and n x k, stores the result on the memory. Then find the two largest and smallest numbers of the result matrix and save them in R5, R6, R7 and R8.m, n and k numbers should be changeable; the program should run correctly for all m, n and k numbers.Explain your code in detail. What were the main economic perspectives of David Ricardo andKarl Marx? Will you agree/disagree with any of the ideas ofeither? Find the effective rate of interest (rounded to 3 decimal places) which corresponds to 6% compounded daily. ( 2 marks) 4. How much money can you borrow at 7.5% compounded monthly if the loan is to be paid off in monthly payments for 5 years, and you can afford to pay $400 per month? Find all solutions of the equation 2 cos 3 interval [0, ).= 1 in theThe answer is 1and 23 =2with x1 . The company spent and expensed $10,000 on research related to the project last year. Would this change your answer? Explain. I. No, last year's expenditure is considered a sunk cost and does not represent an incremental cash flow. Hence, it should not be included in the analysis. II. Yes, the cost of research is an incremental cash flow and should be included in the analysis. III. Yes, but only the tax effect of the research expenses should be included in the analysis. IV. No, last year's expenditure should be treated as a terminal cash flow and dealt with at the end of the project's life. Hence, it should not be included in the initial investment outlay. be included in the analysis. c. Suppose the company plans to use a bullding that it owns to house the project. The building could be sold for $1 million after taxes and real estate commissions. How would that fact affect your answer? I. The potential sale of the building represents an opportunity cost of conducting the project in that building. Therefore, the possible after-tax sale price must be charged against the project as a cost. II. The potential sale of the building represents an opportunity cost of conducting the project in that building. Therefore, the possible before-tax sale price must be charged against the project as a cost. III. The potential sale of the building represents an externality and therefore should not be charged against the project. IV. The potential sale of the building represents a real option and therefore should be charged against the project. V. The potential sale of the bullding represents a real option and therefore should not be charged against the project. Colsen Communications is trying to estimate the first-year cash flow (at Year 1) for a proposed project. The assets required for the project were fully depreciated at the time of purchase. The financial staff has collected the following information on the project: The company has a 25% tax rate, and its WACC is 14%. Write out your answers completely. For example, 13 million should be entered as 13,000,000. a. What is the project's operating cash flow for the first year (t=1) ? Round your answer to the nearest dollar. $ b. If this project would cannibalize other projects by $1 million of cash flow before taxes per year, how would this change your answer to part a? Round your answer to the nearest dollar. The firm's OCF would now be $ Analyze manufacturing accounts and determine missing amounts Phillips Corporation's fiscal year ends on November 30 . The following accounts are found in its job ori manernars cesis or $9,150 and direct tabor costs of $15,000. Overhead was applied at a rate that was 75% of direct labor cost. 2. During December, Job Nos. 156, 157 and 158 were started, On December 31, Job No. 158 was unfinished. This job had charges for direct materials $3,800 and direct labor $4,800 plus manufacturing overhead. All Other data: 1. On December 1, two jobs were in process: Job No. 154 and Job No.155. These jobs had combined direct materials costs of $9,750 and direct labor costs of $15,000. Overhead was applied at a rate that was 75% of direct labor cost. 2. During December, Job Nos. 156, 157 and 158 were started. On December 31 , Job No. 158 was unfinished. This job had charges for direct materials $3,800 and direct labor $4,800 plus manulacturing overhead All jobs, except for Job No. 158, were completed in December. 3. On December 1, Job No. 153 was in the finished goods warehouse. It had a total cost of $5,000. On December 31, Job No. 157 was the only job finished that was not sold. It had a cost of $4,000. 4. Manufacturing overhead was $1,470 underapplied in December. Instructions List the items (a) through (m) and indicate the amount pertaining to each letter. NOTE: Enter a number in cells requesting a value; enter either a number or a formula in cells with a "?". (a) Beginnirgbilance, raw materia's (b) Begirning work in process (Wob 154 8. Job 155) \begin{tabular}{|l|c|} \hline Direct materials & Value \\ \hline Direct labor & Value \\ \hline Overhead appled & ? \\ \hline (c) Direct materials & ? \\ \hline Requisitions of raw materials & Value \\ \hline Less: indirect materials & Value \\ \hline Derect malerials & ? \\ \hline \end{tabular} (4) Compleled bobs (Uobs 154 - 157). \begin{tabular}{|l|l|} \hline Bepinning balance, work in process: \\ \hline Direct materials \\ \hline Direct labor \\ \hline Overhead applied \\ \hline Lessi ending work in process \\ \hline Jobs completed \\ \hline \end{tabular} (9) Beginning balance, finished goods (Job 153) (h) Jobs completed \begin{tabular}{|l|l|l|} \hline (0) Cast of goods sold & \\ \hline Beginning finished goods & Vhiue \\ \hline Jobs completed & Value \\ \hline Less: ending finished goods & Value \\ \hline Cost of goods sold & ? \\ \hline \end{tabular} (i) Ending finished goods (Wob 157) (h) Wages assigned to (i) Indliect labor Factory weges Less: direct labor Indirect labor \begin{tabular}{|l|l|l|l|l|l|} \hline & Less: ending finished goods & Value \\ \hline & Cost of goods sold & ? & \\ \hline & & & \\ \hline & & & \\ \hline (i) & Ending finished goods (Job 157) & Value \\ \hline & & & \\ \hline & & & \\ \hline (k) & Wages assigned to work in process & Value & \\ \hline & \\ \hline (i) & Indirect labor & & \\ \hline & Factory wages & Value & \\ \hline & Less: direct labor & Value \\ \hline & Indirect labor & \\ \hline & \\ \hline & & \\ \hline (m) & Overhead applied & \\ \hline & Direct labor & \\ \hline & Overhead applied & \\ \hline & \\ \hline & \\ \hline \end{tabular} When you have completed P15-5A, consider the following additional question. 1. Assume that requisitions changed to $17,600. Show the impact of this change on the items listed. In the United States reserve requirements are set by Select one:A. the Federal Reserve Bank.B. the President.C. the U.S. Treasury.D. Congress The car has a rechargeable battery to drive its motor. The rechargeable battery provided a potential difference of 330 volts and can store up to 64 mega Jules it takes 8 hours for the battery to receive a full charge assume that the charging process is 100% efficient calculate the total charge the flows while the battery is being charged A wire is formed into a circle having a diameter of 15.0 cm and placed in a uniform magnetic field of 3.10 mt. The wire carries a current of 5.00 A. (a) Find the maximum torque on the wire. UN. (h) Find the range of potential energies of the wire-field system for different orientations of the circle. minimum 2.7410 4 X maximum what onentation of the loop will correspond to the largest potential energy? A bond currently trades at a price of $982.86 in the market. The bond offers a coupon rate of 7%, paid annually, and has a maturity of 13 years. Face value is $1,000. What is the bond's Current Yield? Enter your answer as a percentage, rounded to two decimals, and without the percentage sign ('\%'). For example, if your answer is 0.123456, then it is equivalent to 12.35%, so you should enter 12.35 as the answer. Use the minus sign ('-') if the yield is negative. how to find all duplicates of a word in python. For example if I have the sentence in python,sentence = ""Hello Hello Bye Bye Hungry Bird Bird Bird Hungry dog""have a program that finds all the words in that sentence and list them from most appeared to least appeared.Output:Birds repeated 3 timesHungry Repeated 2 timesBye Repeated 2 timesHello Repeated 2 timesDog Repeated 1 timesNote: What I'm using this for has thousands of words