Explain the function/purpose of the following section of the script
-- Set environment variables
SET FEEDBACK OFF
SET HEADING OFF
SET VERIFY OFF
Explain the function/purpose of the following section of the script
PROMPT ********** Create New Order **********
PROMPT
SELECT 'Date: ', TO_CHAR(SYSDATE,'MM/DD/YYYY') FROM DUAL;
PROMPT
Explain the function/purpose of the following section of the script
DEFINE v_cus_lname = 'Customer Not Found'
DEFINE v_cus_fname = 'Customer Not Found'
DEFINE v_cus_phone = 'N/A'
Explain the function/purpose of the following section of the script
ACCEPT v_cus_code NUMBER FORMAT 99999 PROMPT 'Enter Customer Code (format 99999): '
In: Computer Science
Below is an invoice sent out by MegaCorp.
|
Order ID |
Order |
Customer |
Customer |
Customer |
Product |
Product |
Product |
Product |
Ordered |
|
Date |
Num |
Name |
Address |
ID |
Description |
Finish |
Standard Price |
Quantity |
|
|
1006 |
10/24/2018 |
2 |
HugeCorp |
Chicago, IL |
7 |
Widgets |
Platinum |
800 |
2 |
|
8 |
Widgets |
Chrome |
790 |
4 |
|||||
|
5 |
Wadgets |
Cherry |
325 |
2 |
|||||
|
4 |
Scaffolding |
Silver |
650 |
1 |
|||||
|
1007 |
10/25/2018 |
6 |
LittleCorp |
Edwardsville, IL |
7 |
Widgets |
Platinum |
800 |
1 |
|
11 |
Ladder |
Silver |
275 |
3 |
|||||
|
1008 |
10/26/2018 |
2 |
Huge Corp |
Chicago, IL |
5 |
Wadgets |
Cherry |
325 |
2 |
|
4 |
Scaffolding |
Silver |
650 |
1 |
STEP 1:
Convert the above to 1NF
STEP 2:
Consider the following functional dependencies of the invoice data:
OrderID à OrderDate, CustomerNum, CustomerName, CustomerAddress
ProductID à ProductDescription, ProductFinish, ProductStandardPrice
STEP 3:
Convert your 1NF table to 2NF. (i.e., look only at non-key attributes that are dependent on a single PK)
A relation is in 2NF if it contains no partial functional dependencies.
STEP 4:
Now, you’ve realized there are some additional functional dependencies:
CustomerNum à CustomerName, CustomerAddress
Convert your 2NF relations to 3NF based on the dependencies you just received.
In: Computer Science
|
Please only edit the list.cpp file only, implement the push_front method that will insert a new element to the front of the list. |
|
//list.h // Doubly linked list template<typename T> class List; template <typename T> template <typename T>
#endif |
|
//list.cpp // Implement the push_front method #include <string> using namespace std; // Node class implemenation template <typename T> // List implementation template <typename T>
} template <typename T>
template <typename T> // Iterator implementation template <typename T>
template <typename T> template <typename T> template <typename T> |
|
list_test.cpp // Test for push_front method int main() { // Should print - kings of king Ozymandias is name
My } |
In: Computer Science
The probability that a telephony call will last t minutes can be approximated as -
Probability that call lasts less than t minutes =1 - e-t/a
Where e = Euler’s constant (2.71828) and a = average call duration
Using the above probability function, write a program in C that
a. takes the average call duration (a) from the user,
b. then accepts the call duration to find the probability for (t) and
c. then calculates and prints the probability that a call lasts less than t.
The program should repeat the sequence of operations a to c until the user enters a value of 0 for either variable a or t in the steps a or b above
In: Computer Science
In: Computer Science
Please what is wrong with this two code that is showing error message when run them?
>>>data =[1,2,3,4] >>>reduce(lambda x,y:x+y,data) #Produce the sum 10 >>> reduce(lambda x,y:x*y, data) # Produce the product 24
___________________________________________________________________________________________________________-
def sum(lower,upper): “””Returns the sum of the numbers from lower to upper.””” if lower> upper: return 0 else: return reduce(lambda x,y:x+y, range(lower, upper+1))
In: Computer Science
PET (OwnerID, PetID, OwnerFName, OwnerLName, PetName, PetCategory, PetBreed, BreedDescription)
You also know that each attribute value is a single value and the functional dependencies as below:
fd1: OwnerID, PetID → OwnerFName, OwnerLName, PetName, PetCategory, PetBreed, BreedDescription
fd2: OwnerID → OwnerFName, OwnerLName
fd3: PetBreed → BreedDescription
In: Computer Science
2. Let BT Node be the class we often use for binary-tree nodes. Write the following recursive methods: (a) numLeaves: a method that takes a BT Node T as parameter and returns the number of leaves in the tree rooted at T. (b) isEven: a boolean method that takes a BT Node T and checks whether its tree is strictly binary: every node in the tree has an even number of children.
3. Suppose you want to improve Merge Sort by first applying Heap Sort to a number of consecutive subarrays. Given an array A, your algorithm subdivides A into subarrays A1, A2 · · · Ak, where k is some power of 2, and applies Heap Sort on each subarray Ai alone. The algorithm proceeds into merging pairs of consecutive subarrays until the array is sorted. For example, if k = 4, you first apply Heap Sort to sort each Ai and then you merge A1 with A2 and A3 with A4, then you apply the merge function once to get the sorted array. (a) Does the proposed algorithm improve the asymptotic running time of Merge Sort when k = 2? How about the case k = log n (or a power of 2 that is closest to log n)? Justify. (b) Is the proposed algorithm stable? Is it in-place? Prove your answers.
4. Write a clear pseudocode for Breadth-First Search (BFS) in undirected graphs. How would you modify your code to compute the number of connected components in the input graph? Give details about the used data structures and the running time.
5. Write a clear pseudocode for Depth-First Search (DFS) in graphs. How would you modify your code to check whether the graph is acyclic?
6. The centrality of a vertex v in an undirected graph G is measured as follows: c(v) = n1(v) + n2(v) + · · · nd(v) where ni(v) is the number of vertices at distance i from v (e.g., n1(v) is the number of neighbors of v) and d is the maximum distance between v and a vertex of the same connected component as v in G (so d = 0 if v is isolated). Write the pseudocode of a most-efficient algorithm that computes the centrality of a vertex v in a given graph G. What is the running time of your algorithm? Prove your answer.
In: Computer Science
In: Computer Science
Read the free ebook Cost Estimating in an Agile Development Environment by Alvin Alexander, which discusses estimating software costs. Find one or two other references on ways to measure software development costs. In your own words, write a two-page paper that explains how to estimate software development costs using at least two different approaches.
In: Computer Science
/**
* Write a recursive function that accepts a stack of integers and
* replaces each int with two copies of that integer. For example,
* calling repeatStack and passing in a stack of { 1, 2, 3} would change
* the stack to hold { 1, 1, 2, 2, 3, 3}. Do not use any loops. Do not use
* any data structures other than the stack passed in as a parameter.
* @param stack
*/
public static void repeatStack(Stack<Integer> stack) {}
In: Computer Science
In: Computer Science
Re-write all with proper code syntax and
conventions
Add a while loop that continues to ask the age until a
blank value is entered, or a user presses cancel.
let userage=prompt("enterage");
let userageindays=userage*365;
let userageinmonths=userage*12;
let useragein hours=userageindays*24
get useragein-minutes=userageinhours*60
let userageinseconds=userageinminutes*60;
if userage>=40 {
console.log("You are older than 40";
} else {
console.log("You are younger than 40");
}
switch (true) {
case (userage<5):
console.log("You are between 0 and 5");
break;
case (userage<10):
console.log("You are between 5 and 10");
break;
case (userage<20):
console.log("You are between 5 and 10");
break;
case (userage<10):
console.log("You are between 5 and 10");
break;
case (userage<20):
console.log("You are between 5 and 10");
break;
case (userage<30):
console.log("You are between 5 and 10");
case (userage<40):
console.log("You are between 5 and 10");
case (userage<50):
console.log("You are between 5 and 10");
case (userage<60):
console.log("You are between 5 and 10");
case (userage<70):
console.log("You are between 5 and 10");
case (userage<80):
console.log("You are between 5 and 10");
case (userage<90):
console.log("You are between 5 and 10");
case (userage<100):
console.log("You are between 5 and 10");
case (userage>=100):
console.log("Wow you are older than 100");
break;
}
console log(`You are %userageindays months old,
%userageinmonths days old, %userageinhours hours old,
%userageinminutes minutes old, and %userageinseconds seconds
old`);
In: Computer Science
********************C# C# C#********************
Part A: Create a project with a Program class and write the following two methods(headers provided) as described below:
1. A Method, public static int InputValue(int min, int max), to input an integer number that is between (inclusive) the range of a lower bound and an upper bound. The method should accept the lower bound and the upper bound as two parameters and allow users to re-enter the number if the number is not in the range or a non-numeric value was entered.
2. A Method, public static bool IsValid(string id), to check if an input string satisfies the following conditions: the string’s length is 5, the string starts with 2 uppercase characters and ends with 3 digits. For example, “AS122” is a valid string, “As123” or “AS1234” are not valid strings.
Part B: Create a Book class containing the following:
1. Two public static arrays that hold codes (categoryCodes) and descriptions of the popular book categories (categoryNames) managed in a bookstore. Thesecodes are CS, IS, SE, SO, and MI, corresponding to book categories Computer Science, Information System, Security, Society and Miscellaneous.
2. Data fields for book id (bookId) and book category name (categoryNameOfBook)
3. Auto-implemented properties that hold a book’s title (BookTitle), book’s number of pages (NumOfPages) and book’s price (Price).
4. Properties for book id and book category name. Assume that the set accessor will always receive a book id of a valid format. For example, “CS125” and “IS334” are of valid format and also refer to known categories “Computer Science” and “Information Systems”. If the book ID does not refer to a known category, then the set accessor must retain the number and assign to the “MI” category. For example, “AS123” will be assigned as “MI123”. The category property is a read-only property that is assigned a value when the book id is set.
5. Two constructors to create a book object:
- one with no parameter:
public Book()
- one with parameter for all data fields:
public Book(string bookId, string bookTitle, int numPages, double price)
6. A ToString method, public override string ToString(), to return information of a book object using the format given in the screen shot under
Information of all Books
Part C:
Extend the application in Part A (i.e., adding code in the Program class) to become a BookStore Application by making use of the Book class and completing the following tasks:
1. Write a Method,
private static void GetBookData(int num, Book[] books),
to fill an array of books. The method must fill the array with Books which are constructed from user input information (which must be prompted for). Along with the prompt for a book id, it should display a list of valid book categories and call method in Part A.2 to make sure the inputted book id is a valid format. If not the user is prompted to re-enter a valid book id.
2. After the data entry is complete, write a Method,
public static void DisplayAllBooks(Book[] books),
to display information of all books that have been entered including book id, title, number of pages and price. This method should call the ToString methodthat has been created in Book class.
3. After the data entry is complete, write a Method,
private static void GetLists(int num, Book[] books),
to display the valid book categories, and then continuously prompts the user for category codes and displays the information of all books in the category as well as the number of books in this category.
Appropriate messages are displayed if the entered category code is not a valid code.
4. Write the Main method that first prompts the user for the number of books that is between 1 and 30 (inclusive), by calling the method in Part A.1.
Then call method in Part C.1 to create an array of books.
Then call method in Part C.2 to display all books in the array.
Then call method in Part C.3 to allow the user to input a category code and see information of the category.
In: Computer Science
For each of the following assertions, say whether it is true or false. Justify your answers.
a) Imagine the next Mars rover stops working upon arrival on Mars. From this we can deduce that Mars rover is not a rational agent. (Note that a rational agent is not necessarily perfect, it's only expected to maximize goal achievement, given the available information.)
b) Every optimal search strategy is necessarily complete.
c) Breadth-first search is optimal if the step cost is positive
In: Computer Science