using java:
There's a hole in the bottom of the sea There's a hole in the bottom of the sea There's a hole, there's a hole There's a hole in the bottom of the sea There's a log in the hole in the bottom of the sea There's a log in the hole in the bottom of the sea There's a hole, there's a hole There's a hole in the bottom of the sea There's a bump on the log in the hole in the bottom of the sea There's a bump on the log in the hole in the bottom of the sea There's a hole, there's a hole There's a hole in the bottom of the sea Want at least 5 inputs from the user (variables), meaning you'll also end up printing 5 different verses or stanza.
In: Computer Science
java script
Define a function named height which has two inputs. This first input is the number of feet. The second input is the number of inches. Both inputs will be Number values. Your function must calculate and return a Number. he returned value represents number of meters equal to the input. Your function should start by multiplying the first parameter by 0.3048 (1 foot is 0.3048 meters). Then multiply the second input by 0.0254 (1 inch is 0.0254 meters). Your function must return the sum of those two products. Sample test cases: height(0.0, 100.0) would evaluate to 2.54 (finds bug in how second parameter converted) height(100.0, 0.0) would evaluate to 30.48 (finds bug in how first parameter converted) height(100.0, 100.0) would evaluate to 33.02 (finds bug if not adding result of converting both parameters)
A2For this question you will need to use the following library function: Math.floor(x) returns the largest whole number less than or equal to x Define a function named weight which has one input. The input is a Number representing a person's weight in pounds. Your function will calculate and return a string saying how much they weigh in stone. Your function should start by multiplying the input by 0.0714286. Because stone weight is always a whole number, your function will need to use the Math.floor to get the whole number portion of that product. The function needs to return a String with the text You weigh ______ stone (replacing the underscores with the weight in stone your function calculated). Sample test cases: weight(196.0) would evaluate to "You weigh 14 stone" (finds bug in calculation since rounding not needed) weight(153.5) would evaluate to "You weigh 10 stone" (finds bug in rounding step)
In: Computer Science
Write a complete C++ program to implements a Min-heap.
Each node will contain a single integer data element. Initialize the Min-heap to contain 5 nodes, with the values 8, 12, 24, 32, 42.
The program should allow for the insertion and deletion of nodes while maintaining a Min-Heap.
The program should allow the user to output data in Preorder, Inorder and Postorder.
The program should loop with menu items for each of the above objectives and the choice to quit.
In: Computer Science
1. a What are the main activities in software requirements engineering?
b.Why is it important to document the software requirements clearly?
c. What do we represent in use cases?
d. How do we represent the software requirements?
Answer this questions in your words please.Thanks you.
e. What diagrams can be used to elaborate the use cases?
In: Computer Science
#data structures
Assume you are given an implementation of the Stack class. Recall
that it has methods push(), pop(), top(), isEmpty() and isFull().
Write an Integer function with prototype:
public static Integer popBottom(Stack<Integer> stk);
Note that it has one parameter, a single stack object stk. The
function should delete the item at the bottom of the stack and
return this item as the value of the function. If the stack is
empty return null. When the function returns the stk should not
otherwise be changed. You may not use arrays or queues – only Stack
objects, Integer objects or ints. Make no assumptions about the
implementation details of the stack object.
In: Computer Science
What are ACLs in the context of this class? What is RBAC? How does each address the issue of security?
In: Computer Science
Write a JAVA program that contains the following 4 void methods whic will print all subtrings of s in specific orders: printSub1(String s), printSub2(String s), printSub3(String s), and printSub4(String s)
For example, if S = "abcd":
printSub1 will print "a", "ab", "abc", "abcd", "b", "bc", "bcd", "c", "cd", "d"
printSub2 will print "a", "ab", "b", "abc", "bc", "c", "abcd", "bcd", "cd", "d"
printSub3 will print "d", "c", "b", "a", "cd", "bc", "ab", "bcd", "abc", "abcd"
printSub4 will print "abcd", "bcd", "abc", "cd", "bc", "ab", "d", "c", "b", "a"
(Note: the actual output will not have quotation marks around the substrings.)
Create a menu in your main method using a switch statement inside of a do…while loop so the user can repeatedly choose which method to execute from the menu. The user should be asked to input the string in your main method before the menu is presented to them.
Additional Assignment Requirements
1. You must use NESTED FOR LOOPS to do the work in each method in this lab.
2. YOU MAY NOT USE any concepts not yet taught in this course like ARRAYS.
3. The only built-in String methods you can use are length() and substring().
4. You must work with everything as Strings.
5. If appropriate for this algorithm, you should validate any input from the user to make sure the data input is an appropriate value to work in your program’s logic. You don’t have to worry about validating that it is the correct data type. For now, assume the user is only giving you the correct data type and just worry about validating the value given is usable in your program.
In: Computer Science
Create a new project for Constructor Injection. Create three classes, Address.java, Employee.java and Department.java with the following fields :
Address.java
1) int houseNumber
2) String streetName
3) String zipCode
Department.java
int departmentId
String departmentName
Employee.java
1) String firstName
2) String lastName
3) String ssn;
4) Address address
5) Department department
Using Spring Constructor Injection inject Address and Department into the Employee class.
In: Computer Science
Revision Question 1 on Linux. Please briefly explain the shell script given.
a) You have just logged in and have a directory called "images" in your home directory containing the following files:
favicons login.png logo.png newlogo.png
where "favicons is a directory and contains the files
favicon.ico favicon.gif favicon.png favicon.jpg
Describe the results you would expect when executing the following shell commands:
i) ls images/*og* | wc -1
ii) ls -ld images/*
iii) rmdir images/favicons
iv) cp images/*/*png images
v) rm -r images
(assume each command is run when the directory "images" is as described above)
b) Consider the following short shell script:
#!/bin/sh
mkdir $3
for i in $1/*$2
do
cp $i $3
touch $i
done
If this script is stored in a file called script1, what would be the effect of running this shell command:
./script1 images png newdir
c) Describe the underlying principle behind the Linux command set - often called the "UNIX philosophy".
In: Computer Science
Technical report on differences between quantum computing and current computing devices. The references taken must be 4 yrs old, not more than 4yrs old.
In: Computer Science
Question 3
(a) Give a description of the Test-Driven Development paradigm and
provide
details of two benefits.
[6 marks]
(b) Explain the difference between white-box testing and black-box
testing.
Provide an advantage and a disadvantage of white-box testing
compared to black-box testing.
[6 marks]
(c) In black-box testing, it is usually infeasible to test all uses
of an interface
of a module. Therefore it is common to test only a subset of
all
possible input patterns. Describe a method by which such a subset
can
be selected. Provide concrete examples in your answer.
[3 marks]
(d) As a project manager which of the following is
preferable:
The test suite covers 100% of the critical code, but currently
a
large number of these tests fail.
The test suite covers less than 50% of the critical code, but all
tests
pass.
Justify your answer.
[4 marks]
[Total for Question 3: 19 marks]
In: Computer Science
How do i create a python function that will calculate the Levenshtein distance given a user input of two words? I am aware that there are packages already made to do this, but I want to create my own. Please explain all the steps.
https://en.wikipedia.org/wiki/Levenshtein_distance#:~:text=Informally%2C%20the%20Levenshtein%20distance%20between,considered%20this%20distance%20in%201965.
In: Computer Science
In the notation, <T extends Number>, the Number class
A. Specifies both an upper and lower bound for the type T
B. Specifies a lower bound for the parameter type T
C. Specifies an upper bound for the parameter type T
D. None of the above
In: Computer Science
Radix sortCome up with an unsorted array of numbers (integer array). Sort the numbers in ascending order and descending order and display them using radix sort. First sort in ascending, then reset the array to its original order and finally sort the array again in descending order. I need this in java language. Radix Sort assignment (CISP430 ignore this part) This is only for those who are using Java How many classes do I need? A: Node, Queue, Radix, Driver Do not use any of the built-in data structures What goes into the Radix class A: There are a couple of ways to do this. You can deal with instances or you can make everything in this class static. The static approach makes the most sense For the static approach, you can simply call a static method inside the Radix class as such Radix.sort(arr); where arr represents the array to be sorted. This function can return a sorted array. The sort method can call helper functions so that it doesn’t become too long. Where should I put the functions that display the array in ascending and descending order? A: It is up to you. This can be done in the Driver Class or it can be done in the Radix class General: Why do I need a queue A: You need an array of queues( from 0-9) which correspond to all the possible digits.For example queue[0] will hold all the numbers that contain a zero in the spot that corresponds to the pass that you are on. For example, let’s say we have 120, 30,41 For pass 1, Queue[0] would contain 120 and 30 Queue[1] would contain 41 Notice on the 1st pass, we are processing the 1st digit from the right and on each subsequent pass, we would work our way to the right one digit at a time. To display in descending order, can I just display the array backwards A: yes Do I worry about negative numbers? A: You don’t have to incorporate negative numbers for this lab Where do I define my array and how big does it have to be? A: You can hardcode your array in your program and make it as big or small as you want it.
In: Computer Science
Web Development Example Question:
(a) Difference between Ethernet and IP
When we look at the diagrams of the Ethernet and IP packets we see a number of similarities. Both contain source and destination addresses, a data payload, and a field to indicate what higher layer protocol the data payload is carrying. Why do we use IP for the worldwide Internet and only use Ethernet in limited networks?
In: Computer Science