Please answer in JAVA
I am using java.time.Duration class.
1.). How can I add all of the given duration time?
for example:
Duration t1 = Duration.ofMinutes(2).plusSeconds(30)
Duration t2 = Duration.ofMinutes(3).plusSeconds(20)
then the result would be total = Duration.ofMinutes(5).plusSeconds(50)
*** and how would it be if it exceeds 59 minutes and its an hour.
2). How would I be able to add it all up on an ArrayList? does a for loop and simple add() works?
In: Computer Science
You have been tasked to write a C# application that will go
through the first step of encrypting an input file and writing the
encrypted contents to an output file.
For this first step in encryption, read each letter in from the
input file, add 3 letters to the value of the input letter. If the
input letter is an A then the encrypted letter would be a D. If the
input letter from the input file is an X then the encrypted letter
would be an A.
All spaces, digits, punctuation, and special characters do not need
to be encrypted at this level. Simply write the space,
punctuation, or special character to the output file as is.
If a letter is uppercase in the input file, it should remain as an
uppercase character in the output file. If a letter is lowercase in
the input file, it should remain as a lowercase character in the
output file.
Since this program runs each month, the input file will be of
various lengths; therefore, the program will read until end of
file.
The input file is found in the current directory and is named
October20.txt. The output
file will be written to the current directory and named
EncryptOct20.txt.
An example:
If the contents of the input file is
Live long and prosper. |
The output file would be:
Olyh orqj dqg survshu. |
What the user should see when the program executes:
When the program begins, the statement "Encryption Level 1" should
be displayed.
The focus should be set to the "Begin Encryption" button.
When the user clicks the "Begin Encryption" button, the program
opens the input file, the statement "Opening input file...." should
be displayed. The "Begin Encryption" button should be
disabled.
When the program begins reading through the input file encrypting
the contents, the statement "Encrypting input file...." should be
displayed.
When the program closes the input and output files, the statement
"Encryption complete...." should be displayed.
When the program is complete, the statement "End of process" should
be displayed.
In: Computer Science
course: IT Data Mining and Data Warehousing
There are several typical cube computation methods such as Multi-Way, BUC, and Star-cubing. Briefly describe each one of these methods outlining the key points.
note: need a unique answer and no handwriting please.
In: Computer Science
After your successful engagement to develop privacy and personal data protection strategies for DAS, you have been engaged by the Department of Health (DoH) to advise on the development of privacy and data protection for CovidSafe users. DoH expect up to 16 million Australian mobile users to download and use this app. DoH have announced that they will be using a major U.S. based public cloud provider to host the CovidSafe data, but claim that the data will always be under Australian Government control.
You are to provide a report to DoH that:
In: Computer Science
Mention any three reconnaissance techniques. Briefly explain each of them (just one or two sentences). Why reconnaissance is a threat to network security?
In: Computer Science
In: Computer Science
I. Answer part A,B, C and D.
1a)
Count the number of times a given char occurs in a given range of a String parameter (i.e. starting at a given start index, and up to but not including and end index). If end is greater than the length of the String, then the method should stop looking at the end of the String.
countCharsInRange("java", "v", 1, 2) → 0
countCharsInRange("java", "v", 0, 2) → 0
countCharsInRange("java", "v", 0, 3) → 1
1b)
Return a new String that removes all copies of the given char ch from the given String
removeChar("dog", "o") → "dg"
removeChar("cat", "o") → "cat"
removeChar("aaa", "a") → ""
1c)
Return the number of times the letter 'a' is directly followed by the letter 'b' in the given String.
countAB("abc") → 1
countAB("wxyz") → 0
countAB("bcaca") → 0
1d)
Return a new String that is a copy of the given String with each character copied the given number of times. Assume that n is 0 or more.
eachCharNTimes("abc", 2) → "aabbcc"
eachCharNTimes("xyz", 3) → "xxxyyyzzz"
eachCharNTimes("a", 5) → "aaaaa"
In: Computer Science
Project : facial recognition system
use the DEEP method to reflective writing. The four steps in this method are:
In: Computer Science
How would you describe some of the ER design limitations, and discuss how understanding these limitations will influence how you choose to model a particular situation so that you are able to represent the things that are most important?
In: Computer Science
Consider an array A[1 · · · n] which is sorted and then rotated k steps to the right. For example, we might start with the sorted array [1, 4, 5, 9, 10], and rotate it right by k = 3 steps to get [5, 9, 10, 1, 4]. Give an O(log n)-time algorithm that finds and returns the position of a given element x in array A, or returns None if x is not in A. Your algorithm is given the array A[1 · · · n] but does not know k. You can use C, C++, Java, or Python to solve this problem (ask the instructor if you have another programming language in mind). Python3 pls
In: Computer Science
*** Using Python ***
Your program must prompt the user for their city or zip code and request weather forecast data from openweathermap.org. Your program must display the weather information in an READABLE format to the user.
Requirements:
*** also formatted into imperial units. Site defaults into Kelvin. ***
In: Computer Science
1. What is the fundamental equation that guides changes to a weight wij in a BP network. Describe its components.
2. Multi-layer BP neural networks have no proof of converging to an optimal solution. Is this true? If it is, then why do we bother to use them?
In: Computer Science
In this assignment you are going to create a Student class to demonstrate a Student object. Then create a StudentTest class to place the main method in, which demonstrates the Student object.
Student class should have the following instance
variables:
Student class should have the following
methods:
Design the application in main that you create 10 student
objects in main. You don’t need to get the input from the user;
just provide some values you prefer. Also, create an ArrayList of
type Student in main.
Once you create 10 student objects, add these objects into the ArrayList. Using enhanced for loop (which we sometimes call foreach loop), display the information of every student in your ArrayList
In: Computer Science
Safaricom service provider has assigned you a task in their software section to design an application that can be used by wholesalers to buy their products. Your duty is to implement the data structure which can be used to store the inventory of the warehouse containing the products. The data structure should be able to add a product with an associated code indicating its likelihood to spoil, remove a product that is most likely to spoil, and return the overall number of products in the inventory.
i. Describe the data structure you would use and give reasons.
ii. With reference to algorithms, explain the terms time efficiency and space efficiency.
iii. Describe a non-linear data structure. Give examples and operations in which you might perform on such a structure.
In: Computer Science
In: Computer Science