Suppose A and B are regular language. Prove that AB is regular
In: Computer Science
1. Write CREAT TABLE statements for the following tables (primary keys are underlined, foreign keys are in italic and bold). Make sure you have all needed constraints and appropriate datatypes for attributes: Student (stID, stName, dateOfBirth, advID, majorName, GPA) Advisor (advID, advName, specialty) 2. Insert several records in each table.
In: Computer Science
Convert the decimal floating point value 8.125 to a 12 bit binary floating point value. Use a sign bit, 3 bits (excess 3) for the exponent and an 8 bit significand. Enter just a 12 digit binary value ( e.g. 0 000 11110000 ) spaces ignored.
In: Computer Science
Discuss how companies use social media information to identify trends for products. Provide an example of a software or analytics tool that is used to gather data. What legal or ethical issues does this type of information gathering present? Provide two examples and justify your ideas with specific reasons, facts, and examples.
In: Computer Science
In: Computer Science
1. True or False? If one programmer in a large team is given the task of writing a single function for the team project, this programmer is more likely to need a function driver than a function stub.
2. A(n) ____________________ is a dummy function that is included for testing the higher-level code.
3. ____________________ is the principle that a module should perform exactly one abstract action.
4.
For the function definition
int SomeFunc( /* in */ int alpha,
/* in */ int beta )
{
int gamma;
alpha = alpha + beta;
gamma = 2 * alpha;
return gamma;
}
what is the function postcondition?
a. // Postcondition: gamma == 2*alpha
b. // Postcondition: alpha == alpha@entry + beta
// && gamma == 2*alpha
c. // Postcondition: Function value == gamma
d. // Postcondition: Function value == 2*alpha
e. // Postcondition: Function value == 2*(alpha@entry + beta)
5. ____________________ is a measure of the quantity of information passing through a module's interface.
6. In contrast to promotion, ____________________ of data values can potentially cause loss of information.
7.
Using the library functions available through the header file cctype, which of the following can be used to determine if the variable someChar contains either a digit character or a lowercase letter?
a. if (isalnum(someChar) || isdigit(someChar))
b. if (isalpha(someChar) || isdigit(someChar))
c. if (isalnum(someChar) && !isupper(someChar))
d. if (islower(someChar) || isdigit(someChar))
e. c and d above
8. True or False? For team programming to succeed, it is essential that all of the module interfaces be defined explicitly and the coded modules adhere strictly to the specifications for those interfaces.
9.
Which of the following could cause an unexpected side effect?
a. modifying a global variable
b. changing the value of a value parameter
c. referencing a global constant
d. declaring an incoming-only parameter to be a reference parameter
e. a and d above
10. True or False? Unsigned types are most appropriate for advanced techniques that manipulate individual bits within memory within memory cells to avoid errors caused by, for example, using unsigned variables for ordinary numeric computations.
In: Computer Science
Write a function which takes in X and Y arrays, a column number, and a threshold. The function should return arrays X0 and Y0 containing all rows where the value in the specified column falls strictly below the threshold, as well as arrays X1 and Y1 containing all rows where the value in the specified column is above or equal to the threshold.(use numpy)
def split_on_feature(X_test, Y_test, column, thresh):
## TYPE ANSWER HERE
In: Computer Science
public class Square {
public static final int NUM_OF_SIDES = 4;
private float length;
public Square(float l) {
setLength(l);
}
public void setLength(float l) {
if(l >= 0) {
length =
l;
}
}
public float getLength() {
return length;
}
//TODO - Add method to calculate add return area
//TODO - Add method to calculate add return
perimeter
public String toString() {
return String.format("Square
[length: %f]", length);
}
}
I am trying to add the formulas for area and perimeter but using the info provided each time I get a compile error indicating I am missing a main method. How would I go about adding these formulas without getting more compile errors?
In: Computer Science
Computer Science: Data Structures and Algorithms
Practice:
Construct a C++ program that takes two SQUARE matrices, and multiplies them and produces a new matrix:
Example:
[Matrix A] * [Matrix B] = [Matrix C]
(A 3x3 is the most preferred example to use)
(The first two matrices, A and B can be fixed numbers, hard-coded into the program. as opposed to user input)
Display Matrix C, also (cout etc.)
In: Computer Science
c++ code
Reverse the order of elements in a vector of integers using two functions:
(a) The first function takes the input vector a and return a vector b with the input data but in the reverse order, e.g. input: 1, 2, 3 and output 3, 2, 1.
(b) The second function is a recursive one and it reverses the input data in place (without using an additional vector).
In: Computer Science
You have been asked to create a list of all MAC addresses and corresponding IP addresses and computer names in your network. Propose at least two methods for performing this task. Your network has almost 100 computers in a Windows Server 2016 domain network with statically assigned IP addresses. Using the tools available in Windows Server 2016, carry out the procedure you think will work best. Write a short report of your results and submit it to your instructor.
In: Computer Science
// The QuickCopy company currently makes 100,000 copies per
year
// at 15 cents each.
// They expect to increase the number of copies produced
// by 4 percent per year each year for the next 10 years,
// starting with this year.
// They also expect the price of each copy to increase
// by 3 cents per year, starting with this year.
// This program displays the company's expected
// income for each of the next 10 years.
// Modify it to be more efficient.
start
Declarations
num year = 1
num copies = 100000
num price = 0.15
num total = 0
num COPIES_INCREASE = 0.04
num PRICE_INCREASE = 0.03
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
year = year + 1
copies = copies + copies * COPIES_INCREASE
price = price + price * PRICE_INCREASE
total = total + copies * price
output year, total
stop
In: Computer Science
You are the IT director for XYZ Manufacturing. Your company is a B2B (business-to-business) organization that supplies auto parts to General Motors. There are 200 employees at XYZ Manufacturing with a headquarters in Detroit, Michigan, and field offices in Omaha, Nebraska; Austin, Texas; and Orlando, Florida. There are over 10,000 items in the inventory for XYZ Manufacturing and you receive raw material (i.e. steel, plastic, wiring, etc.) from China.
XYZ Manufacturing has been struggling for years with inadequate computer resources to track inventory and handle user requests from internal management, orders and invoices from General Motors, orders and invoices from your suppliers, and management reports. There is clearly an inability to store and retrieve complex “big data,” and recently there have been frequent security breaches. Your CIO is extremely frustrated with this situation and is looking for an alternative approach to providing IT services. She has asked you for input on this investigation.
Write a paper that describes advantages and disadvantages that cloud computing offers to XYZ Manufacturing. Include a sensible, detailed strategy to migrate to cloud computing, addressing the issues of performance, scalability, and economic factors.
Your paper should be 8-10 pages in length. Include at least five credible references.
In: Computer Science
Using PopG, set the fitness of the aa homozgyote to 0.95 (so s = 0.05). Set the population size to 5. Run the program for 500 generations with 5 populations, no mutation, no migration and a starting allele frequency of 0.50 for the A allele. How many populations at generation 500 were fixed for the A allele?
In: Computer Science
Python
#Exercise 1
#Assign the following first names to a variable name as a list:
peter,paul,mary
#Assign the following last names to a variable name as a list:
ng,lo,lau
#Display each first name in a separate line in turn so that your
screen shows (ignore the #):
#peter
#paul
#mary
#Combine the elements in the list in turn so that you display the
full names of each person in separate lines
#Output should look like the following (ignore the #):
#peter ng
#paul lo
#mary lau
#Exercise 2
#Assign the following grades to a variable name as a list:
80,90,100,70
#Use the sum() function to total up the values in the list and
assign the sum to a variable
#Use the len() function to get the length of the list and assign
the length to a variable
#Compute the average grade using the sum and length of the list and
assign the average to a variable
#Convert the list length, list sum, and average to strings
#Display the results of your calculation in the following format
using the + concatenator
#Your total score for [length of list] grades is [sum of list]
resulting in an average of [average grade]!
#Ask the user for a grade using the prompt: New grade? (include a
space after the ?)
#Convert the new grade into an integer
#Add the new grade to the end of the existing list using the append
method
#Remove the second grade in the list using the pop method
##Use the sum() function to total up the values in the list and
assign the sum to a variable
#Use the len() function to get the length of the list and assign
the length to a variable
#Compute the average grade using the sum and length of the list and
assign the average to a variable
#Display the results of your calculation in the following format
using the + concatenator
#Your total score for [length of list] grades is [sum of list]
resulting in an average of [average grade]!
#Exercise 3
#Ask the user for a student's name using the propmt: Student Name?
(include a space after the ?)
#Assign the following grades to a variable name as a list:
80,90,70,85
#Assign the following requirement codes to a variable name as a
list: HW,MT,IC,HW
#Ask the user for a new requirement code using the prompt:
Requirement Code? (include a space after the ?)
#Ask the user for a new grade using the prompt: Grade? (include a
space after the ?)
#Add the new requirement code to the requirement code list using
the append method
#Convert the new grade to an integer
#Add the new grade to the end of the list of grades using the
append method
#Display the following: Grades for: [student name -- input from
user in first instruction of Exercise 3]
#Combine the information from both lists to display each pair of
requirement code and grade in a separate line
#The output should have the following structure:
#[requirement code] [grade]
#For example, the first two lines should read (ignore the #)
#HW 80
#MT 90
#etc until the last items in the lists -- There should be 5 lines
of code-grade pairings
#Get the sum of the grades list using the sum() function
#Get the length of the grades list using the len() function
#Compute the student's average grade using the sum and length
#Convert the average grade to a string
#Use the + concatenator to display the following statement (ignore
the #):
#[student name]: your average grade is [average grade]!
#If student name is George Smith and average grade is 80, output
should be:
#George Smith: your average grade is 80!
In: Computer Science