Create, test, and validate an HTML document that has a form with the following controls:
a. A text box to collect the user's name
b. Four checkboxes, one for each of the following items:
i. Four 25-watt light bulbs for $2.39
ii. Eight 25-watt light bulbs for $4.29
iii. Four 25-watt long-life light bulbs for $3.95
iv. Eight 25-watt long-life light bulbs for $7.49
c. A collection of three radio buttons that are labeled as follows:
i. Visa
ii. Master Card
iii. Discover
In: Computer Science
In: Computer Science
Create, test, and validate an HTML document for yourself, including your name, address, and email address. If you are a student, you must include your major and your grade level. This document must use several headings and <em>, <strong>, <hr />, <p>, and <br /> tags.
In: Computer Science
The Tokenizer.java file should contain:
A class called: Tokenizer
Tokenizer should have a private variable that is an ArrayList of Token objects.
Tokenizer should have a private variable that is an int, and keeps track of the number of keywords encountered when parsing through a files content.
In this case there will only be one keyword: public.
Tokenizer should have a default constructor that initializes the ArrayList of Token objects Tokenizer should have a public method called: tokenizeFile
tokenizeFile should have a string parameter that will be a file path tokenizeFile should return void tokenizeFile should throw an IOException tokenizeFile should take the contents of the file and tokenize it using a space character as a delimiter
If there are multiple spaces between tokens then ignore those spaces and only retrieve the words, so given the string: “The cat” should still only produce two tokens: “The”, and “cat”
A newline should also serve to separate tokens, for example:
If the input contains multiple lines such as:
The cat in the hat Red fish blue fish There is no space between “hat” and “Red”, just a newline, which means the resulting tokens are “hat” and “Red”, NOT a single token: “hatRed”
Each token should be added to the private ArrayList variable as a Token object If the value of a token is the keyword: public , then increment the private int counter that is keeping track of the number of keywords encountered when parsing the content of a file.
- Remember that “public” is the only keyword you have to worry about - Any letter in the word: public , can be capitalized and you must still increment the counter -
If public is part of another token, then it should NOT count as a keyword -
For example if a file contained: - Blahblahpublic -
The above public does not count as a keyword since public in this case is not its own token Every call to tokenizeFile should first clear the previous tokens from the ArrayList of Tokens, as well as reset the private int counter of keywords (public) For example: if a user calls tokenizeFile(“someFile.txt”) and it generates these tokens:
“The” , “cat”, “in” , and then the user calls tokenizeFile again but with a different input file, such as: tokenizeFile(“somenewfile.txt”), the ArrayList should no longer hold the previous tokens, and should instead hold only the new tokens generated by the new file.
Tokenizer should have only a getter for the ArrayList of Token objects (not a setter) The getter should be called: getTokens and should return an Array of Token objects, NOT an ArrayList of Token objects Tokenizer should have a method called: writeTokens writeTokens should have no input parameter writeTokens should have a return type of void writeTokens should throw an IOException writeTokens should write the tokens out to a file called: “output.txt”, and should reside in your current working directory. Each token should be written on a newline, for example - Given tokens: “The”, “cat”, “in”, “the”,”hat” The result in output.txt should be: The cat in the hat Notice the order the tokens should be written to file are in order from which they are read from the input file, which should be from left to right and from top to bottom Tokenizer should have a public method called: getKeywordCount , that has no input arguments and returns the private int keyword counter field Override the toString method inherited from the Object class, have it return the same value as calling the toString method on the ArrayList of Token objects
In: Computer Science
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