double_vowels
Given a string, return a copy of the string with all of the vowels doubled. Consider the five letters 'aeiou' as vowels.
middle_hash
|
In: Computer Science
Context switching occurs when a task surrenders the CPU to
another task or
is preempted by another task. Use program examples (pseudo code
plus Gantt
charts) to show a scenario for each of the cases.
In: Computer Science
Below is what I have to do. This is all performed in SQL. I have written a bunch of code, that I have also provided. Any help is appreciated
Exercises
Complete each of the following exercises. If you are unsure how to accomplish the task, please consult the coursework videos where there are explanations and demos.
Your select statement should include
product id, product name, product category and product
department.
Written Code
use fudgemart_v3
go
--Question 1
--This runs but doesn't supply correct output
select * from fudgemart_products
select right(product_name, charindex(' ', product_name)) as
product_category from fudgemart_products
go
---Runs but returns NULL for product_Category
select product_id, product_name, product_department
from fudgemart_products
order by product_id
declare @product_name as varchar(20)
select right(@product_name, charindex(' ',@product_name)) as
product_category
print len(@product_name)
---question 2-----
drop function dbo.f_vendor_sales
go
declare @vendor_id int
set @vendor_id = 1
select count(*) from fudgemart_products where product_vendor_id =
@vendor_id
go
--Function says it is completed
create function dbo.f_total_vendor_sales(
@vendor_id int --input
) returns int as
begin
declare @count int
set @count = (select count(*) from
fudgemart_products.dbo.product_wholesale_price where
product_vendor_id = @vendor_id)
return @count --output
end
go
---When i attempt function, I get invalid object name
select product_vendor_id, product_wholesale_price,
dbo.f_total_vendor_sales(product_vendor_id) as
total_vendor_sales
from fudgemart_products
----For question 3-------
create procedure p_write_vendor
(
@vendor_name varchar (50),
@vendor_phone varchar (20),
@vendor_website varchar (100)
) as
if exists ( select 1 from fudgemart_vendors
where vendor_name = @vendor_name
or vendor_phone = @vendor_phone
or vendor_website = @vendor_website)
begin
update fudgemart_vendors
set vendor_name
=@vendor_name,
vendor_phone =
@vendor_phone,
vendor_website =
@vendor_website
where vendor_name =
@vendor_name
or vendor_phone =
@vendor_phone
or vendor_website =
@vendor_website
end
else
begin
insert into fudgemart_vendors
values (@vendor_name, @vendor_phone, @vendor_website)
end
In: Computer Science
Give short answers or Define the following questions [in your own words]:
1. Compare the difference between Attack and Threat.
2. List out 6 different types of attackers
3. Briefly explain 5 different types of vulnerabilities and give examples for each.
4. Explain in brief the different goals of Security.
5. What are the various classes of Threat? Explain in your own words.
6. Briefly explain the principle of Least Privilege with an example scenario.
7. What are fail-safe defaults? Give 3 examples for the same [You are allowed to google to find your examples]
8. Give a brief note about Open design. Give the benefits and disadvantages of Open source code.
9. Why is it required to Separate privileges? Give a brief note on the same.
10. Why do you need to introduce Mandatory vacations for staffs during investigation process?
In: Computer Science
Explain a least 4 kinds of wireless communication subsystems that were used by NASA and SoaxeX for their recent space expedition
In: Computer Science
In C#
creating a math challenge program using +, -, /, *
In: Computer Science
In: Computer Science
Write a java program which can randomly generate a permutation of the integer {1, 2, 3, ..., 48,49,50}. Use the most efficient sorting algorithm to sort the list in an acceding order.
In: Computer Science
Python Coding Question: Find the minimum number of coins that make a given value.
In: Computer Science
linux
use the command dmesg, use grep to filter and then redirect just the lines with the word Linux in them from the output generated by the dmesg command. redirect this output to a file at the path PutFileHere/Dmesgoutput.txt. What command did you use to do this, if there is no output choose a different word to grep for in the output of this command and substitute that word.
In: Computer Science
This LinkedListUtil class tests various usages of the LinkedList class. The single param is an array of string. You will create a linked list with the string elements and return the linked list with all but the 1st two elements removed.
Note: In this question use a for or while loop instead of the suggested iterator. You should also ignore CodeCheck’s error message about a missing class (LinkedListUtil.class). Your code still needs to pass all test cases.
EDIT: you want to remove all besides the first 2 elements. So only the first 2 elements should be returned
LinkedListUtil.java
import java.util.LinkedList;
import java.util.ListIterator;
/**
This LinkedListUtil class tests various usages of the LinkedList
class
*/
public class LinkedListUtil
{
/**
Constructs a LinkedListUtil.
@param list is the initialized list
*/
public LinkedListUtil(LinkedList list)
{
this.list = list;
}
/**
deletes all but the first two linked list enries
*/
public void processList()
{
// TODO: create a list iterator and remove all but the first two
elements
}
private LinkedList list;
// this method is used to check your work
public static LinkedList check(String[] values)
{
LinkedList list = new LinkedList();
for (String s : values)
list.addLast(s);
LinkedListUtil tester = new LinkedListUtil(list);
tester.processList();
return list;
}
}
In: Computer Science
Question #1
Data Modelling is the primary step in the process of database design. Compare and contrast Conceptual data model versus Physical data model. Illustrates with help of example to list down data (entities), relationship among data and constraints on data.
Question #2
What strategic competitive benefits do you see in a company’s use of extranets?
Question #3
Explain how Internet technologies are involved in developing a process in one of the functions of the business? Give an example and evaluate its business value.
Question #4
What are the basic differences between HRM, Intranet and Internet in terms of Domain and Network Communication Scope?
All information are written. there is no more information.
In: Computer Science
Objective
Make a function to serve as a Craps dice game simulator. If you are not familiar Craps is a game that involves rolling two six-sided dice and adding up the total. We are not implementing the full rules of the game, just a function that returns the value of BOTH dice and their total.
Details
In the function you create: Make a function that uses pointers and pass by reference to return THREE separate outputs (arrays are not allowed). Inside the function you will call rand() to represent a random dice roll of a six sided dice. One output will be the first call to rand() and represent the first dice roll. The second output will be a second call to rand() and represents the second dice roll. The third output is the total of the two other outputs added together.
You may choose either options for defining the function:
Option A:
Option B:
In the Main Function: Call srand() to initialize the pseudo-random algorithm. Create three variables to hold your outputs, the two dice rolls and the total. In a for loop call your dice roll function FIVE times, each time it should set the three variables to new values. Also within the for loop print the values of the dice rolls and the total.
In: Computer Science
C Programming
How do you read in a text file line by line into a an array.
example, i have the text file containing:
line 1: "qwertyuiop"
line 2: "asdfghjkl"
line 3: "zxcvbnm"
Then in the resulting array i get this:
array:"qwertyuiopasdfghjklzxcvbnm"
In: Computer Science