In: Computer Science
Using egrep and grep in linux
What sentences.txt contains:
Anything goes here.
Or not
When, why or how.
A bat can die
The dog never does.
Yikes! he proclaimed
A big can of doo doo is gone.
The zebra never yells at x-rays well unless it is proscribed.
Once upon a time.
Farther. Back down the road!
Yes, a time once did exist
In: Computer Science
Consider two functions
f (x; y) = (x10)2 + (y + 2)2; and
g(x; y) = (x ? 10)2 + (x ? y + 5)4
Please implement a basic gradient descent algorithm using
python
Starting with (x; y) = (0; 0), and set up a xed learning rate =
0:5,
run the gradient descent algorithm for each function. Run for
10
iterations, and report both (x; y) and the function value at the
end of
each iteration.
Adjust the , and nd out the fastest convergence (smallest
function
value) after T steps (try T = 10 or 100).
In: Computer Science
Discuss how the use of certain IT systems or technologies could make working or schooling from home easier and effective in this Corona Virus era.
In: Computer Science
[ RACKET]
a) Write a recursive function (gen-list start end). This function will generate a list of consecutive integers, from start to end. If start > end then an empty list is generated.
For example: (gen-list 1 5) ---> (1 2 3 4 5)
b) write a recursive function pair-sum? that takes an integer sequence as generated by the gen-list function in exercise 4 above. This function tests whether any two adjacent values in the given list sum to the given val.
For example,
(pair-sum? '(1 2 3) 3) ---> #t since 1+2=3. Similarly,
(pair-sum? (gen-list 1 100) 1000) ---> #f since no two adjacent integers in the range 1 to 100 can sum to 1000.
You must use recursion, and not iteration. Please include explanation thanks.
In: Computer Science
Spring 2019 CMSC 140 Programming Project 4: Days Out
Project Specifications
Input for this project:
Input Validation:
Output: The program should display the following data:
In: Computer Science
In: Computer Science
Explain how Artificial Intelligence could be adopted in the lecture hall for IT101 to enable students have total concentration on the lecture and not to be distracted by anything else (such as putting down notes while the lecture is ongoing, etc.). Discuss, in detail, the components of such system(s) and how each component of such system(s) functions
In: Computer Science
In Java, how can I convert a string user input for example a student starts a uni degree in "Winter/2022", to a date type, and then once I have done that, add 3 years to that value, and changing the season, so for example Student Started: Winter/2022 and Student Finished: Summer/2025. Is there any possible way to do this?
Thank you.
In: Computer Science
Download the Unit 5 Programming Assignment When you're finished, upload the following to the Programming Assignment submission area: Upload the following for your Programming Assignment submission. Question.java TrueFalseQuestion.java MultipleChoiceQuestion.java Quiz.java A screenshot showing a dialog box asking a true/false question Your assignment will be graded by your peers using the following criteria. Does the submission include a file that defines the class "Quiz" with a main method? Does the submission include a file that defines the abstract class "Question" with instance method "check", class method "showResults", and abstract method "ask"? Does the submission include a file that defines the class "MultipleChoiceQuestion" as a subclass of "Question" with an implementation of "ask" method? Does the submission include a file that defines the class "TrueFalseQuestion" as a subclass of "Question" with an implementation of the "ask" method? Does the class "TrueFalseQuestion" implement the method "ask" to keep asking its question until it receives an answer of "f", "false", "n", "no", "t", "true", "y", or "yes" in any combination of upper and lower case? Does the class "TrueFalseQuestion" implement the method "ask" to return only "TRUE" or "FALSE"? Does the class "TrueFalseQuestion" have a constructor that initializes the question and correct answer using its parameters, where the correct answer is initialized to only "TRUE" or "FALSE"? Does the main method in class "Quiz" use the "check" method with both "MultipleChoiceQuestion" and "TrueFalseQuestion" objects? Does the main method in class "Quiz" report correct results using the "showResults" method from class "Question"?
In: Computer Science
In: Computer Science
In C Write a program that
Note : c = (5.0/9.0)*(f-32.0)
Sample output
Enter temperature in deg F
50
You entered 50 def F. The corresponding temp in deg C is 10.00
Another temperature conversion?
Enter y or n please
y
Enter temperature in deg F
60
You entered 60 def F. The corresponding temp in deg C is 15.56
Another temperature conversion?
Enter y or n please
a
Enter y or n please
#
Enter y or n please
y
Enter temperature in deg F
70
You entered 70 def F. The corresponding temp in deg C is 21.11
Another temperature conversion?
Enter y or n please
n
Bye
Problem 3
Write a program that
Note : c = (5.0/9.0)*(f-32.0)
Sample output
Enter temperature in deg F
50
You entered 50 def F. The corresponding temp in deg C is 10.00
Another temperature conversion?
Enter y or n please
y
Enter temperature in deg F
60
You entered 60 def F. The corresponding temp in deg C is 15.56
Another temperature conversion?
Enter y or n please
a
Enter y or n please
#
Enter y or n please
y
Enter temperature in deg F
70
You entered 70 def F. The corresponding temp in deg C is 21.11
Another temperature conversion?
Enter y or n please
n
Bye
In: Computer Science
1) Describe a real-world situation for which a for loop would provie an appropriate simulation.
2) Describe a real-world situation for which a while loop would be more appropriate.
3) How could a while loop be coded to run forever?
4) How could a for loop be coded to run forever?
5) Describe a testing strategy for ensuring that your loop conditions are properly coded.
*These are conceptual questions, I don't need any actual code. Please give me conceptual answers NOT CODE!
In: Computer Science
Prove {0n1n, n≥0} is a computable language
In: Computer Science
a)Adoubledata field(private)named realfor real part of a complex number.
b)Adoubledata field(private)named imgfor imaginarypart of a complex number.
c)A no-arg constructor that creates a default complex number with real 0and img 0.
d)Auser-defined constructorthat creates a complex number with given 2 numbers.
e)The accessor and mutator functions for realand img.
f)A constant function named addition(Complex&comp1, Complex&comp2) that returns the sum of two givencomplex numbers.
g)Aconstantfunction named subtraction(Complex&comp1, Complex&comp2) that returns the subtractionof two givencomplex numbers.
h)A constant function named multiplication(Complex&comp1, Complex&comp2) that returns the multiplicationof two givencomplex numbers.
i)Write a test program that creates aComplexobject with no-arg constructor.Then, set -4.2 and 3.1to real and imaginary parts of the complex number, respectively.
j)Create another Complexobject using the user-defined constructor.
k)Testaddition, subtractionand multiplication functions using thesetwoComplex objects.
In: Computer Science