Develop SQL statements to do the following:
Query 1: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_EMP_CITY, LXXX_EMP_PHONE, LXXX_DEP_ID, order by LXXX_DEP_ID.
Query 2: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME, order by LXXX_DEP_NAME.
Query 3: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME who work for the "XXX_SALES" department.
Query 4: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME, LXXX_EMP_CITY, LXXX_DEP_CITY who live and work in the same city, order by LXXX_DEP_CITY
Query 5: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_PROJ_TYPE, LXXX_START_DATE, LXXX_END_DATE who have worked in either an “XXX_CUSTOMER SURVEY” project or an “XXX_CUSTOMER GOLF OUTING” project.
Query 6: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_ROLE_NAME who have worked in the role of an “XXX_PROJECT MANAGER”.
In: Computer Science
Try to debug it! (fixes needed are explained below)
########################################
##def primes_list_buggy(n):
## """
## input: n an integer > 1
## returns: list of all the primes up to and including n
## """
## # initialize primes list
## if i == 2:
## primes.append(2)
## # go through each elem of primes list
## for i in range(len(primes)):
## # go through each of 2...n
## for j in range(len(n)):
## # check if not divisible by elem of list
## if i%j != 0:
## primes.append(i)
#
#
## FIXES: --------------------------
## = invalid syntax, variable i unknown, variable primes
unknown
## can't apply 'len' to an int
## division by zero -> iterate through elems not indices
## -> iterate from 2 not 0
## forgot to return
## primes is empty list for n > 2
## n = 3 goes through loop once -> range to n+1 not n
## infinite loop -> append j not i
## -> list is getting modified as iterating over it!
## -> switch loops around
## n = 4 adds 4 -> need way to stop going once found a divisible
num
## -> use a flag
## --------------------------
def primes_list_buggy(n):
"""
## input: n an integer > 1
## returns: list of all the primes up to and including n
## """
# initialize primes list
if i == 2:
primes.append(2)
# go through each elem of primes list
for i in range(len(primes)):
# go through each of 2...n
for j in range(len(n)):
# check if not divisible by elem of list
if i%j != 0:
primes.append(i)
print(primes_list(2) )
print(primes_list(15) )
(a) Debug the program by using Python Programming Language.
In: Computer Science
Making a program in Python with the following code types. I'm very confused and would love the actual code that creates this prompt and a brief explanation. Thanks!
A comment on the top line of your program containing your name.
A comment on the second line containing your section number.
A comment on the third line containing the date.
A comment on the fourth line containing your email address.
A comment with the lab number and purpose of this lab.
Declare a function with one parameter to create a list of X elements (numbering from 1 to X) and then output this list to the screen.
Declare a function with two parameters (X and Y) to create a list of X elements where the elements count by Y. For example, if X = 4 and Y = 3, you should create the following list [3, 6, 9, 12]. You will then need to output this list to the screen.
Declare a function with one parameter X that creates a list of X elements (numbering from 1 to X). You will then remove the last element of the list and print the updated list repeatedly until only one element in the list remains. At this point you will output the remaining list (consisting of the one element) and a message saying that that is the last one.
Include code in your .py file to execute each of the above three functions once each. To execute each function, you should prompt the user for whatever values the function requires, then call the function with the user's values.
Output a message to the user thanking them from using your program that includes your first and last name.
In: Computer Science
In C++
In this lab we will creating two linked list classes: one that is a singly linked list, and another that is a doubly linked list ( This will be good practice for your next homework assignment where you will build your own string class using arrays and linked list ) .
These LinkedList classes should both be generic classes. and should contain the following methods:
Add - Adds element to the end of the linked list.
IsEmpty
Push - Adds element to the beginning of the linked list
InsertAt - Inserts an element at a given position
Clear - Removes all elements from the linked list
Contains - Returns true if element is in the linked list
Get - Returns a value at a specific position
IndexOf - Returns the first position where an element occurs, -1 if not
LastOf - Returns the last position where an element occurs, -1 if not
Remove - Removes the last item added to the list
RemoveAt - Removes an element at a specific position
RemoveElement - Removes the first occurrence of a specific element
Size
Slice - Returns a subset of this linked list given a beginning position start and end position stop.
You will also count the number of operations that is performed in each method and will calculate the RUN-TIME of each method, as well as calculating the BIG O, OMEGA and THETA notation of each method. This information should be written in a comment block before each method ( you may count the number of operations on each line if you want ).
You are required to write self commenting code for this Lab, refer to the Google Style Sheet if you haven't become familiar with it.
In: Computer Science
In Java
In this lab we will creating two linked list classes: one that is a singly linked list, and another that is a doubly linked list ( This will be good practice for your next homework assignment where you will build your own string class using arrays and linked list ) .
These LinkedList classes should both be generic classes. and should contain the following methods:
Add - Adds element to the end of the linked list.
IsEmpty
Push - Adds element to the beginning of the linked list
InsertAt - Inserts an element at a given position
Clear - Removes all elements from the linked list
Contains - Returns true if element is in the linked list
Get - Returns a value at a specific position
IndexOf - Returns the first position where an element occurs, -1 if not
LastOf - Returns the last position where an element occurs, -1 if not
Remove - Removes the last item added to the list
RemoveAt - Removes an element at a specific position
RemoveElement - Removes the first occurrence of a specific element
Size
Slice - Returns a subset of this linked list given a beginning position start and end position stop.
You will also count the number of operations that is performed in each method and will calculate the RUN-TIME of each method, as well as calculating the BIG O, OMEGA and THETA notation of each method. This information should be written in a comment block before each method ( you may count the number of operations on each line if you want ).
You are required to write self commenting code for this Lab, refer to the Google Style Sheet if you haven't become familiar with it.
In: Computer Science
Write a program to remove the node of Fruit type which contains “Banana” from a given linked list and then print the updated linked list. Part of the program is given below but it is incomplete. You need to complete it. You should create your own data file. After you complete the program, please check it carefully to ensure it can handle the following cases:
Banana is the first node in the linked list.
Banana is not the first node in the linked list.
Banana doesn’t exist in the linked list.
Note that head should points to the first node of the linked list even after you remove the node which contains “banana”.
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
struct Fruit{
string strF;
Fruit* next;
};
int main()
{
ifstream myfile;
myfile.open("test.txt");
Fruit * head = 0;
Fruit f;
myfile >> f.strF;
f.next = head;
head = &f;
Fruit f1;
myfile >> f1.strF;
f1.next = head;
head = &f1;
Fruit f2;
myfile >> f2.strF;
f2.next = head;
head = &f2;
//print the linked list:
cout<<"Print the linked list before the insertion:"<<endl;
Fruit * t = head;
while(t!= 0)
{
cout << t->strF << "--->"<<endl;
t = t->next;
}
cout<<endl;
//Write your code here to delete the node which has "banana"
cout<<"Print the linked list after the insertion:"<<endl;
//print the updated linked list
return 0;
}
In: Computer Science
Copy the following Python fuction discussed in class into your file:
from random import *
def makeRandomList(size, bound):
a = []
for i in range(size):
a.append(randint(0, bound))
return a
a. Add another function that receives a list as a parameter and computes the sum of the elements of the list. The header of the function should be
def sumList(a):
The function should return the result and not print it. If the list is empty, the function should return 0. Use a for loop iterating over the list.
Test the function in the console to see if it works.
b. Write a function that receives a list as a parameter and a value, and returns True if the value can be found in the list, and Falseif not. Use a for loop that goes over the list and compares each element to the value. If any of them is equal to the value, it returns True. Otherwise after the loop is done, you can return False. Thus, if the loop completes without a return statement happening, then the value is not in the list. The function header should look like this:
def searchList(a, val):
Test this second function a few times the same way as the first one.
c. Below the three functions, add a piece of code that
Test the program to make sure that it works fine.
In: Computer Science
Purpose: This lab will give you experience modifying an existing ADT.
Lab
Main Task 1: Modify the ListInterface Java interface source code
given below.
Change the name of ListInterface to ComparableListInterface, and
have ComparableListInterface inherit from the built-in Java
interface Comparable.
Note that Comparable has a method compareTo(). compareTo()
must be used in programming logic you will write
in a method called isInAscendingOrder() (more about
isInAscendingOrder() is mentioned further down in the lab
description).
You can find a brief summary on compareTo() at these web pages:
http://chortle.ccsu.edu/java5/notes/chap53b/ch53B_2.html (Links to an external site.)
https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html#compareTo(T) (Links to an external site.)
and in other sources you can find by performing a search for the Java Comparable interface using a web search engine.
Main Task 2: Modify the AList class source code given below by
performing the following:
1) change the name of the class from AList to ComparableAList
2) change ListInterface to ComparableListInterface
3) add a method corresponding to the following UML:
+isInAscendingOrder() : boolean
isInAscendingOrder() returns true if the list is in ascending
sorted order, else returns false isInAscendingOrder() should use
the compareTo() method that was inherited from
ComparableListInterface in order to perform the logic it needs to
return true or false.
Note: You MUST use the List ADT method's to
perform the logic for isInAscendingOrder(). That is, you must use
the methods declared in the interface for the List ADT and defined
in the implementation class for the List ADT in the programming
logic for isInAscendingOrder(). You will not receive
credit for the lab if you try to directly access the list array
member and determine from the list array member whether the List
ADT is in ascending order in the programming logic for
isInAscendingOrder().
Test your solution by writing a driver program. The driver program
will have a main() method and is the program that is run at the
command line. You may give your driver program any name you like.
The driver program should perform a loop, ask for input, and
display output in the following way (note that the output in bold
is what the user inputs):
Input a list of integers: 5 9 101 183
4893
Your list of integers is in ascending order.
Do you want to continue (y/n): y
Input a list of integers: 5 9 101 183 48
Your list of integers is not in ascending order.
Do you want to continue (y/n): y
Input a list of integers: 5 4 100 101 183
4893
Your list of integers is not in ascending order.
Do you want to continue (y/n): y
Input a list of integers: 5 9 101 101 183
4893
Your list of integers is in ascending order.
Do you want to continue (y/n): y
Input a list of integers: -48 -7 0 5 9 101
183
Your list of integers is in ascending order.
Do you want to continue (y/n): y
Input a list of integers: 14
Your list of integers is in ascending order.
Do you want to continue (y/n): y
Input a list of integers:
Your list of integers is in ascending order.
Do you want to continue (y/n): n
What to submit for the lab:
• your program source code for the List ADT you modified to have
inheritance from the Comparable interface, the isInAscendingOrder()
method, and the driver program
• a capture the results of the program runs as shown above. You may
submit captures of the program run as either a text file that has
all of the output of the driver program, or as an image file that
has all of the output of the driver program.
In: Computer Science
For each of the actions depicted below, a magnet and/or metal loop moves with velocity v? (v? is constant and has the same magnitude in all parts). Determine whether a current is induced in the metal loop. If so, indicate the direction of the current in the loop, either clockwise or counterclockwise when seen from the right of the loop. The axis of the magnet is lined up with the center of the loop.

Part A
For the action depicted in the figure, (Figure 1) indicate the direction of the induced current in the loop (clockwise, counterclockwise or zero, when seen from the right of the loop).
Part B
For the action depicted in the figure, (Figure 2) indicate the direction of the induced current in the loop (clockwise, counterclockwise or zero, when seen from the right of the loop).

Part C
For the action depicted in the figure, (Figure 3) indicate the direction of the induced current in the loop (clockwise, counterclockwise or zero, when seen from the right of the loop).

Part D
For the action depicted in the figure, (Figure 4) indicate the direction of the induced current in the loop (clockwise, counterclockwise or zero, when seen from the right of the loop).

Part E
For the action depicted in the figure, (Figure 5) indicate the direction of the induced current in the loop (clockwise, counterclockwise or zero, when seen from the right of the loop).

In: Physics
An electric eel (Electrophorus electricus) can produce a shock of up to 600 V and a current of 1 A for a duration of 2 ms, which is used for hunting and self-defense. To perform this feat, approximately 80% of its body is filled with organs made up by electrocytes. These electrocytes act as self-charging capacitors and are lined up so that a current of ions can easily flow through them.
a) How much charge flows through the electrocytes in that amount
of time?
b) If each electrocyte can maintain a potential of 100 mV, how many
electrocytes must be in series to produce the maximum shock?
c) How much energy is released when the electric eel delivers a
shock?
d) With the given information, estimate the equivalent capacitance
of all the electrocyte cells in the electric eel.
In: Physics