Answer:
Yes
Explanation:
Artificial Intelligence is just a subcategory of Technology. That being said, if any type of technology has the ability to do the job of a human being in the management sector of a company it would be Artificial Intelligence. This is because AI is designed to be able to analyze data, discover patterns, and make decisions based on those patterns. These decisions are incredibly sophisticated, efficient, and made incredibly fast. It also learns the more that it makes decisions, therefore increasing its efficiency the more that it does a specific task. This would represent the same tasks that management is responsible for getting done, but the AI is able to do it faster, cheaper, and more efficiently. So, yes, AI is very capable of bringing the end of management.
Debug the recursive reverseString method, which is intended to return the input String str reversed (i.e. the same characters but in reverse order).
Use the runner class to test this method but do not write your own main method or your code will not be graded correctly.
public class U10_L2_Activity_One
{
public static String reverseString(String str)
{
if (str.length() < 0)
{
return str;
}
s = reverseString(str.substring(2)) + str.substring(0,1);
}
}
Runner's code (don't change):
import java.util.Scanner;
public class runner_U10_L2_Activity_One
{
public static void main(String[] args)
{
System.out.println("Enter string:");
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
System.out.println("Reversed String: " + U10_L2_Activity_One.reverseString(s));
}
}
Answer:
Explanation:
The following modified code correctly uses recurssion to reverse the string that was passed as a parameter to the reverseString method. A test output using the runner class can be seen in the attached image below.
import java.util.Scanner;
class U10_L2_Activity_One {
public static String reverseString(String str) {
if (str.isEmpty()) {
return str;
}
return reverseString(str.substring(1)) + str.charAt(0);
}
}
class runner_U10_L2_Activity_One
{
public static void main(String[] args)
{
System.out.println("Enter string:");
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
System.out.println("Reversed String: " + U10_L2_Activity_One.reverseString(s));
}
}
Write a program that reads in 10 numbers and displays the number of distinct numbers and the distinct numbers in their input order and separated by exactly one space (i.e., if a number appears multiple times, it is displayed only once). After the input, the array contains the distinct numbers. Here is a sample run of the program.
Answer:
Explanation:
The following code is written in Python. It creates a for loop that iterates 10 times, asking the user for a number every time. It then checks if the number is inside the numArray. If it is not, then it adds it to the array, if it is then it skips to the next iteration. Finally, it prints the number of distinct numbers and the list of numbers.
numArray = []
for x in range(10):
num = input("Enter a number")
if int(num) not in numArray:
numArray.append(int(num))
print("Number of Distince: " + str(len(numArray)))
for num in numArray:
print(str(num), end = " ")
List the invoice number and invoice date for each invoice that was created for James Gonzalez but that does not contain an invoice line for Wild Bird Food (25lb).
Answer:
Derive FROM invoice_transaction, invoice_details, item_details
and JOIN customer_details ON (invoice_transaction.CUST_ID = customer_details.CUST_ID AND customer_details.FIRST_NAME = 'James' AND customer_details.LAST_NAME = 'Gonzalez')
Explanation:
The following details will be there in the invoice
item_details rep_details invoice_details customer_details invoice_transactionDerive FROM invoice_transaction, invoice_details, item_details
and JOIN customer_details ON (invoice_transaction.CUST_ID = customer_details.CUST_ID AND customer_details.FIRST_NAME = 'James' AND customer_details.LAST_NAME = 'Gonzalez')
Create an array using the makeRandomArray method, then take a start time using System.currentTimeMillis(). Next, run the array through one of the sort methods in the Sorter class. Finally, record the end time. Subtract the start time from the end time and print out the results. You will test each of the 3 sorts.
Required:
Is the fastest sort always the same?
2- Write aC+ program that calculates the sum of all even numbers from [1000,2000], using the while loop.
Answer:
#include <iostream>
using namespace std;
int main() {
int n = 1000;
int sum = 0;
while(n <= 2000) {
sum += n;
n += 2;
}
cout << "sum of even numbers in [1000..2000] = " << sum << endl;
}
Explanation:
This will output:
sum of even numbers in [1000..2000] = 751500
Question B_1 (15 points) Please define (describe) local variables and how they are used in computer programming ( e.g. In C, C ). Please write clearly and use no more than 2 sentences. Question B_2 ( 15 points) Please define (describe) static variables and how they are used in computer programming ( e.g. In C, C ). Please write clearly and use no more than 2 sentences. Question
Answer and Explanation:
Static variables are variables that still maintain their values outside the score which they are declared. They are declared with the static keyword
Example:
static int score = 30;
Local variables are variables whose scope are restricted to a block. Their values are restricted to the block which they are declared in.
Example:
void abd(){
int score;
}
score is a local variable to abcd() function
Security monitoring has detected the presence of a remote access tool classified as commodity malware on an employee workstation. Does this allow you to discount the possibility that an APT is involved in the attack
Answer:
No it doesn't
Explanation:
Targeted malware can be linked to such high resource threats as APT. Little or nothing can be done to stop such advanced persistent threats. It is necessary to carry out an evaluation on other indicators so that you can know the threat that is involved. And also to know if the malware is isolated or greater than that.
Part1) Given 3 integers, output their average and their product, using integer arithmetic.
Ex: If the input is:
10 20 5
the output is:
11 1000
Note: Integer division discards the fraction. Hence the average of 10 20 5 is output as 11, not 11.6667.
Note: The test cases include three very large input values whose product results in overflow. You do not need to do anything special, but just observe that the output does not represent the correct product (in fact, three positive numbers yield a negative output; wow).
Submit the above for grading. Your program will fail the last test cases (which is expected), until you complete part 2 below.
Part 2) Also output the average and product, using floating-point arithmetic.
Output each floating-point value with two digits after the decimal point, which can be achieved by executing
cout << fixed << setprecision(2); once before all other cout statements.
Ex: If the input is:
10 20 5
the output is:
11 1000
11.67 1000.00
Answer:
The program is as follows:
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int num1, num2, num3;
cin>>num1>>num2>>num3;
cout << fixed << setprecision(2);
cout<<(num1 + num2 + num3)/3<<" ";
cout<<num1 * num2 * num3<<" ";
return 0;
}
Explanation:
This declares three integer variables
int num1, num2, num3;
This gets input for the three integers
cin>>num1>>num2>>num3;
This is used to set the precision to 2
cout << fixed << setprecision(2);
This prints the average
cout<<(num1 + num2 + num3)/3<<" ";
This prints the product
cout<<num1 * num2 * num3<<" ";
1- By using C++ programming language write a program which displays the Fibonacci Series numbers. Note: The number of elements is taken as in input from the user Hint: The Fibonacci Sequence: 0,1,1,2,3,5,8,13,21,34,55.. .
Answer:
i hope this helpful for you
Explanation:
Example 1.
#include <iostream>
using namespace std;
int main() {
int n, t1 = 0, t2 = 1, nextTerm = 0;
cout << "Enter the number of terms: ";
cin >> n;
cout << "Fibonacci Series: ";
for (int i = 1; i <= n; ++i) {
// Prints the first two terms.
if(i == 1) {
cout << t1 << ", ";
continue;
}
if(i == 2) {
cout << t2 << ", ";
continue;
}
nextTerm = t1 + t2;
t1 = t2;
t2 = nextTerm;
cout << nextTerm << ", ";
}
return 0;
}
Example 2.
#include <iostream>
using namespace std;
int main() {
int t1 = 0, t2 = 1, nextTerm = 0, n;
cout << "Enter a positive number: ";
cin >> n;
// displays the first two terms which is always 0 and 1
cout << "Fibonacci Series: " << t1 << ", " << t2 << ", ";
nextTerm = t1 + t2;
while(nextTerm <= n) {
cout << nextTerm << ", ";
t1 = t2;
t2 = nextTerm;
nextTerm = t1 + t2;
}
return 0;
}
The program DebugTwo2.cs has syntax and/or logical errors. Determine the problem(s) and fix the program.// This program greets the user// and multiplies two entered valuesusing System;using static System.Console;class DebugTwo2{static void main(){string name;string firstString, secondSting;int first, second, product;Write("Enter your name >> );name = ReadLine;Write("Hello, {0}! Enter an integer >> ", name);firstString = ReadLine();first = ConvertToInt32(firstString);Write("Enter another integer >> ");secondString = Readline();second = Convert.ToInt(secondString);product = first * second;WriteLine("Thank you, {1}. The product of {2} and {3} is {4}", name, first, second, product);}}
Answer:
The corrected code is as follows:
using System;
using static System.Console;
class DebugTwo2{
static void Main(string[] args){
string name;string firstString, secondString;
int first, second, product;
Write("Enter your name >> ");
name = ReadLine();
Write("Hello, {0}! Enter an integer >> ", name);
firstString = ReadLine();
first = Convert.ToInt32(firstString);
Write("Enter another integer >> ");
secondString = ReadLine();
second = Convert.ToInt32(secondString);
product = first * second;
Write("Thank you, {0}. The product of {1} and {2} is {3}", name,first, second, product);
}
}
Explanation:
string name;string firstString, secondString; ----- Replace secondSting with secondString,
int first, second, product;
Write("Enter your name >> "); --- Here, the quotes must be closed with corresponding quotes "
name = ReadLine(); The syntax of readLine is incorrect without the () brackets
Write("Hello, {0}! Enter an integer >> ", name);
firstString = ReadLine();
first = Convert.ToInt32(firstString); There is a dot between Convert and ToInt32
Write("Enter another integer >> ");
secondString = ReadLine(); --- Readline() should be written as ReadLine()
second = Convert.ToInt32(secondString);
product = first * second;
Write("Thank you, {0}. The product of {1} and {2} is {3}", name,first, second, product); --- The formats in {} should start from 0 because 0 has already been initialized for variable name
}
}
computer __ is any part of the computer that can be seen and touched
WAP to find area of circle
Answer:
program by LET statement
Explanation:
CLS
REM to find the area of circle
LET r=10
LET a=22/7*2*r^2
PRINT "area=;"a
END
press f5
output:
a=628.57
True or false a mirrorless camera has a pentaprism
Answer:
No the pentaprism or pentamirror are both optical viewfinder viewing systems and are not part of the mirrorless camera. Some thing the pentaprism actually operates better than the electronic viewfinder of mirrorless cameras.
Explanation:
magbigay ng ibang produkto na ginagamitan ng kasanayan ng basic sketching shading at outlining
Answer:
Procreate
Explanation:
Exercise : Randomizer In this exercise, we are going to create a static class Randomizer that will allow users to get random integer values from the method nextInt() and nextInt(int min, int max). Remember that we can get random integers using the formula int randInteger = (int)(Math.random() * (range + 1) + startingNum). nextInt() should return a random value from 1 - 10, and nextInt(int min, int max) should return a random value from min to max. For instance, if min is 3 and max is 12, then the range of numbers should be from 3 - 12, including 3 and 12.
Answer:
Here the code is by using java.
Explanation:
//Randomizer.java
public class Randomizer {
public static int nextInt() {
//get random number from 1-10
int randInteger = (int) (Math.random() * (11) + 1);
//if number is greater than 10 or less than 1
while (randInteger > 10 || randInteger < 1) {
randInteger = (int) (Math.random() * (11) + 1);
}
return randInteger;
}
public static int nextInt(int min, int max) {
//formula to get random number from min-max
int randInteger = (int) (Math.random() * (max + 1) + min);
while (randInteger > max || randInteger < min) {
randInteger = (int) (Math.random() * (max + 1) + min);
}
return randInteger;
}
}
//RandomizerTester.java
public class RandomizerTester {
public static void main(String[] args) {
System.out.println("Results of Randommizer.nextInt()");
for (int i = 0; i < 10; i++) {
System.out.println(Randomizer.nextInt());
}
int min = 5;
int max = 10;
System.out.println("\n Results of Randomizer.nextInt(5,10)");
for (int i = 0; i < 10; i++) {
System.out.println(Randomizer.nextInt(min, max));
}
}
}
OUTPUT:
Results of Randommizer.nextInt()
9
2
3
8
5
9
4
1
9
2
Results of Randomizer.nextInt(5,10)
9
8
9
7
5
10
5
10
7
7
describe all the main stress causal agents
Answer:
Causes of Stress
Being unhappy in your job.
Having a heavy workload or too much responsibility.
Working long hours.
Having poor management, unclear expectations of your work, or no say in the decision-making process.
Working under dangerous conditions.
Being insecure about your chance for advancement or risk of termination.
Joe has just started the Security Module. He wants to get through it as quickly as possible and take the Quiz. As he clicks through the unit, he sees a bunch of text with some activities sprinkled throughout, and is trying to decide how to proceed.
Required:
Which strategies would likely be most effective and efficient for Joe?
Answer:
Joe should read the explanatory text and complete the learning activities.
Explanation:
Given
See attachment for options
Required
Best strategy to get through the module
First off, rushing through the activities and taking guess for each question (as suggested by (a)) will not help him;
He may complete the activities but sure, he won't learn from the module.
Also, reading through the units without completing the activities is not an appropriate method because Joe will not be able to test his knowledge at the end of the module.
The best strategy to employ is to read through the units and complete the activities, afterwards (option (b)).
write a python program to calculate the average of the given number
Answer:
The program in Python is as follows:
n = int(input())
sum = 0
for i in range(n):
num= float(input())
sum+=num
print("Average: ",sum/n)
Explanation:
Required
Average of numbers
The explanation is as follows:
This prompts the user for the count of numbers, n
n = int(input())
Initialize sum to 0
sum = 0
Iterate through n
for i in range(n):
This gets input for each number
num= float(input())
This calculates the sum of all inputs
sum+=num
This calculates and prints the average of all inputs
print("Average: ",sum/n)
What advice would you give to the students in the grade behind you?
If you could do one over for this school year, what would it be?
What is 4÷15-18×27.6
List three authentication questions (but not the answers) a credit card company could ask to authenticate a customer over the phone. The questions should be ones to which an impostor could not readily obtain the answers. How difficult would it be for you to provide the correct answer vs a malicious actor
Answer:
Explanation:
Security questions need to be very personal and very specific so that only one individual knows them. Some example questions would be the following...
What are the last 4 digits of your Social Security Number? ... every US citizen has a social security number and it is very personal document that only the owner should have access to.
What is the street name where you lived when you opened the account? ... on average a person moves 12 times in their lifetime, therefore, very few people would know the exact address where you lived when you opened the account.
What is your mother's maiden name? ... This is a common question asked by banks and financial institutions because most people will not know your mother and even less will know her maiden name. Therefore, it is a very good security question.
These are all questions that a bank will have the answers too and know if you are telling the truth or not, but are also questions that would be extremely difficult for anyone else to obtain. Mainly since some require a personal long time connection with you while others require very personal information which no one shares.
Which commands (constructs) do NOT have a loop when expressed in syntax graphs? Select all that apply Group of answer choices if-then-else switch (expr) { case value: statements ;} for ( ; ; ) {} while (condition) do {statements;}
Answer:
if-then-else
switch (expr) { case value: statements ;}
Explanation:
Required
Which do not represent loop
Literally, looping means repeating an action or sequence of actions as long as a given condition is true.
For options (a) to (d), we have:
(a): if-then-else:
if statements are used to test conditions; depending on the truth or falsity of the condition, only one block of code can be executed at once.
In summary, if statements are not loops
(b): switch statements
This is an alternate to if statements and can be used in place of if statements.
Hence, switch statements are not loops
(c) and (d): for and while:
The above represent loops, because they both involve repetition of operations until the condition is no longer satisfied.
As you continue to build the help desk, you want to ensure that all of the tools are in place and that the analysts have the tools needed to resolve issues as they are reported. First, you want to understand and be able to report what the steps in problem solving entails. The following are common steps when solving issues:Identifying the problemDetermining the cause of the problemGenerating optionsEvaluating and prioritizing optionsDetermining a course of actionDescribe each step in detail, and discuss the issues and deliverables that exist at each step. To help ensure that the infrastructure is in place for the analysts, describe what technologies need to be in place at each step for you to enable your help desk analysts.
Answer:
):
Explanation:
Write a program with a function that accepts a string as an argument and returns the number of uppercase, lowercase, vowel, consonants, and punctuation that the string contains. The application should let the user enter a string and should display the number of uppercases, lowercases, vowels, consonants, and punctuations that the string contains.
Answer:
Explanation:
The following code is written in Python. It is a function called checkString that takes in a string as an argument and loops through each char in that string and checking to see if it is lowercase, uppercase, vowel, consonant, or punctuations. It adds 1 to the correct variable. At the end of the loop it prints out all of the variables. The picture below shows a test output with the string "Brainly, Question."
def checkString(word):
uppercase = 0
lowercase = 0
vowel = 0
consonants = 0
punctuation = 0
vowelArray = ['a', 'e', 'i', 'o','u', 'y' ]
consonantArray = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z']
punctuationArray = ['.', '!', '?', ',', ';', '(', ')']
for char in word:
if char.isupper():
uppercase += 1
else:
lowercase += 1
if char.lower() in vowelArray:
vowel += 1
elif char.lower() in consonantArray:
consonants += 1
if char in punctuationArray:
punctuation += 1
print('Uppercase: ' + str(uppercase))
print('Lowercase: ' + str(lowercase))
print('Vowels: ' + str(vowel))
print('Consonants: ' + str(consonants))
print('Punctuations: ' + str(punctuation))
The following Python program should print the sum of all the even numbers from 0 to 10 (0, 2, 4, 6, 8, 10), but it has two bugs:
x = 0
sum = 0
while x < 10:
sum = sum + x
x = x + 1
print(sum)
Write a sentence or two explaining what the errors are and how to fix them.
Answer:
To make the value 10 also part of the loop, the while statement must be "while x<=10" otherwise 10 is excluded. To have only even numbers, x should be increased by 2, not 1, i.e.: "x = x + 2".
Design and Analyze an algorithm for the following problem,
Give pseudocode for your algorithm.
Prove that your algorithm is correct.
Give the recurrence relation for the running time for your algorithm.
Solve the recurrence relation.
Suppose you are given 3n marbles that look identical, with one special marble that weighs more than the other marbles. You are also given a balancing scale that takes two items (or sets of items) and compares their weights. Design and analyze a divide and conquer algorithm to find the heavy marble using the balancing scale at most n times.
Answer:
If you have 3n marbles, then you need at least n weighings to find the heavier marble.
Algorithm:-
Label all marbles from 1 to n.
Divide the marbles into three groups G1, G2, and G3 such 2 groups G1, and G2 are compared to every other employing a pan, and therefore the third group G3 is kept aside.
Condition 1- If G1>G2, If the special marble is one among the primary two groups that are being weighed,i.e., special marble is in G1.
Condition 2- If G2>G1, If the special marble in group 2, G2.
Condition 3- If G1=G2 If the primary two groups weigh equal, then special marble is present within the third group, G3.
Take the group containing special marble and perform the above steps 1,2,3,4 on it.
Keep repeating the above steps until, a gaggle of three marbles is obtained, and therefore the special marble is found from that group by performing steps 1,2,3,4 on the group.
Explanation:
Pseudocode:-
function puzzle( G1, G2, G3)
{
Compare the values G1, G2
if G1>G2
return G1
else if G2>G1
return G2
else
return G3
end of function puzzle
}
function main()
{
print prompt "Enter the value of n"
Take the value of n from the user
while(n != 0)
{
Create 3 groups/arrays each of size 3n-1
G= puzzle( g1,g2,g3)
n= 3n-1
}
print the value in G
end of main
}
Recurrence relation for the running time for the algorithm:-
T (n) = 2T ( n1/3) + 1 with base T (3) = 1.,
here n is the total number of marbles.
We cannot apply the master theorem because of the cube root, so we draw the recursion tree.
First, we determine the height of the tree; denote this by h. By observing the powers of the arguments in the tree, we can see that in order to get to the base case of n = 3, it must be that,
n(1/2)h=3
(1/3)h=logn(3) = log 3/ log n = 1/log n
3h=log n
Now, since we do a constant amount of work (1, specifically) at each node in the recursion tree, we note that at depth d in the recursion tree we do 3d total work. We can therefore write the sum over the tree as a geometric series as follows:
[tex]T(n)= \sum_{d=0}^{log(logn)}3^d = (1-3^{log(log(n)+1)})/1-3)=(3^{log(log(n)+1)}-1)/2\\T (n) = 3 log (n)-1[/tex]
Therefore,
T (n) = Θ(log n).
TRUE or FALSE: HTML is used to style web pages.
Answer:
TRUE
Explanation:
How long does it take to learn python
Answer:
five to 10 weeks
On average, it can take anywhere from five to 10 weeks to learn the basics of Python programming, including object-oriented programming, basic Python syntax, data types, loops, variables, and functions.
:
Write a program that prints the following line of output 1000 times:
All work and no play makes Jack a dull boy.
You should not write a program that uses 1000 lines of source code; use methods to shorten the program.
(Hint: use methods to shorten the program). Each print statement should only have one line of "All work and no play makes Jack a dull boy". What is the shortest program you can write that will produce the 1000 lines of output, using only the material?
White spaces will be ignored (empty lines, (. ). class header, method headers, etc)
AllWorkNoPlay: Using static methods to shorten the program (no loops allowed)
AllWorkNoPlay
Answer and Explanation:
Using javascript:
var play;
function AllWorkNoPlay(){
Console.log("All work and no play makes Jack a dull boy");
play++
If(play<=1000){
AllWorkNoPlay()
}
else(
return;
)
}
AllWorkNoPlay()
From the above we have defined a function that uses recursive function to print "All work and no play makes Jack a dull boy" to the console 1000 times and not more than that. We have called the function after that.
What sequence is used to create a brochure document from a template?
New, File, Brochures
File, New, Brochures
Brochures, File, New
Brochures, New, File
Answer:B. File, New, Brochures
Explanation: Just took the test