Which scenario requires the use of a cursor?
Given a list of product code, display the products whose product code is in the list, and the products have been ordered at least twice. The products must also cost at least 50 dollars.
Given a list of customer id, insert the ids in the list if they are not in the customer table yet.
Given a list of student id, module code, and an assignment score and an exam score for the module, display the student id, module code and final score for the module. Assume that assignment score contributes 30% and exam score contributes 70% to the final score.
None of the above.
In: Computer Science
answer only in 2 or 3 lines
1. When conducting needs analysis what aspects have to be
tackled?
2. List some considerations when designing the training
program.
3. List the training and development methods available in the
implementation phase.
4. List ways to evaluate the training.
5. What is orientation? Explain.
6. What are the benefits of orientation?
7. List the characteristics of successful orientation
process.
8. What is career development? Explain.
9. What are some favorable conditions for career development?
Explain.
10. List some special development needs.
In: Operations Management
1.Please write a C++ program that counts the nodes in a linked list with the first node pointed to by first. Also please explain. 2. Write a program to determine the average of a linked list of real numbers with the first node pointed to by first. 3. Determine the computing times of the algorithms in question 1 and 4. Write a program to insert a new node into a linked list with the first node pointed to by first after the nth node in this list for a given integer n. 5. Write a program to delete the nth node in a linked list with the first node pointed to by first, where n is a given integer.
In: Computer Science
Write a Python function that will do the following:1. Ask the user to input an integer which will be appended to a list that was originally empty. This will be done 5 times, meaning that when the input is complete, the list will have five elements (all integers).2. Determine whether each element is an even number or an odd number3. Return a list of five-string elements "odd" and "even" that map the indexes of the elements of the input list, according to whether these elements are even or odd numbers. For example: if the input sequence is 10, 7, 9, 51, and 100, the function will return the list ["even", "odd", "odd", "odd", "even"].
In: Computer Science
//C++
a. Add the following operation to the class orderedLinkedList:
void mergeLists(orderedLinkedList &list1, orderedLinkedList &list2);
//This function creates a new list by merging the //elements of list1 and list2.
//Postcondition: first points to the merged list
// list1 and list2 are empty Consider the following statements:
orderedLinkedList newList;
orderedLinkedList list1;
orderedLinkedList list2;
Suppose list1 points to the list with the elements 2 6 7, and list2 points to the list with the elements 3 5 8.
The statement: newList.mergeLists(list1, list2); creates a new linked list with the elements in the order 2 3 5 6 7 8, and the object newList points to this list. Also, after the preceding statement executes, list1 and list2 are empty.
b. Write the definition of the function template mergeLists to implement the operation mergeLists.
In: Computer Science
PYTHON:
Write a recursive function named linear_search that searches a list to find a given element. If the element is in the list, the function returns the index of the first instance of the element, otherwise it returns -1000.
Sample Output
>> linear_search(72, [10, 32, 83, 2, 72, 100, 32])
4
>> linear_search(32, [10, 32, 83, 2, 72, 100, 32])
1
>> linear_search(0, [10, 32, 83, 2, 72, 100, 32])
-1000
>> linear_search('a', ['c', 'a', 'l', 'i', 'f', 'o', 'r', 'n', 'i', 'a'])
1
Use this template:
=============================================================================
def linear_search(ele, array):
"""searches the given list for the given element
INPUT:
* ele - the element
* array - the list
OUTPUT: the index of the first instance of the element in the list,
or -1000 if it is not in the list.
"""
pass
In: Computer Science
Please use C++ for Mac (XCode)
In this program, a user can search for a name within a list of names. Here are the steps the program will implement:
1. Reads the names from the file names.txt into a vector that stores strings.
2. Sorts the names in alphabetical order using selection sort.
3. The program then prompts the user to enter a name.
4. The program then uses binary search to see if the name is in the list.
5. If the name is in the list, the program prints: "The name you entered is in the list!"
6. If the name entered was not in the list, the program prints "The name you entered was not in the list."
Notes: You will need to change your swap function to swap strings, like this:
void swap(string& x, string& y)
{
string temp = x;
x = y;
y = temp;
}
In: Computer Science
Python
Question 5 (Multiple Choice)
msg1 = "My favorite number is " + str(fav_num) + "." msg2 = "My
favorite number is "+str(fav_num)+"." Why would msg1 be preferred
over msg2
(a)The user output is easier to read
(b)The code is easier to read. (c)Both a and b
Question 6
Given this list: pets = ['teddy', 'jessie', 'skippy'] Be sure to refer to the list element by its index Write the python statement whose output is: Hello SKIPPY; you are a fine parrot!
Note: print("Hello SKIPPY; you are a fine parrot!") is incorrect
Question 7
Using the list in Question 6
Write the python statement to add 'spot' to the list between
'teddy' and 'jessie'.
Question 8
Using the list updated in Question 7
Write the python statement to remove 'jessie' from the list.
In: Computer Science
(Implement a doubly linked list) The MyLinkedList class used in Listing 24.5 is a one-way directional linked list that enables one-way traversal of the list. Modify the Node class to add the new data field name previous to refer to the previous node in the list, as follows
: public class Node {
E element;
Node next;
Node previous;
public Node(E e) {
element = e; } }
Implement a new class named TwoWayLinkedList that uses a doubly linked list to store elements. Define TwoWayLinkedList to implements MyList. You need to implement all the methods defined in MyLinkedList as well as the methods listIterator() and listIterator(int index). Both return an instance of java.util.ListIterator (see Figure 20.4). The former sets the cursor to the head of the list and the latter to the element at the specified index..
In: Computer Science
Courage 1. List and describe three risks that I can take to improve my project or team’s performance. 2. List and describe three risks that I can take to improve my career. 3. List and describe the barriers that prevent you from taking career or team risks.
Alignment of time and talent 1. What resources can I provide to the organization that I work or hope to work? List and describe the knowledge, skills, and abilities that you can offer a current or perspective employer. 2. What types of organizations do I feel comfortable associating with and volunteering my time? List and give a brief description of at least two organizations, clubs, social causes, etc. 3. List and describe the barriers that prevent you from volunteering in organizations.
In: Operations Management