Answer:
The answer is "Option b".
Explanation:
In the given code, a static method "inCommon" is declared, that accepts two array lists in its parameter, and inside the method two for loop is used, in which a conditional statement used, that checks element of array list a is equal to the element of array list b. If the condition is true it will return the value true, and if the condition is not true, it will return a false value. In this, the second loop is not used because j>0 so will never check the element of the first element.
Complete the getOdds method so it returns a new ArrayList of Integers containing all odd Integers from the parameter ArrayList vals in the order they originally appeared. The contents of vals should not change. For example if an ArrayList containing the Integers 2,5,8,6,7,3, 12 in that order is passed as a parameter to getOdds, it should return an ArrayList containing the Integers 5, 7,3 in that order. Write your getOdds method in the U7_L2_Activity Three class. Use the runner class to test your method but do not add a main method to your U7_L2_Activity Three.java file or your code will not be scored correctly.
Answer:
Following are the code to this question:
import java.util.*;//import package for user-input
public class U7_L2_Activity Three//defining class U7_L2_Activity Three
{
public static ArrayList<Integer> getOdds(ArrayList<Integer> val)//defining a static method getOdds as an ArrayList
{
ArrayList<Integer> odd = new ArrayList<Integer>();//creating ArrayList Object
int i; //defining integer variable
for(i=0;i<val.size();i++)//defining for loop for calculating odd values
{
if(val.get(i)%2!=0)//defining if block to check odd numbers
{
odd.add(vals.get(i));//add values in odd ArrayList
}
}
return odd;//return ArrayList odd
}
public static void main(String[] asr)//defining main method
{
int l,i;//defining integer variable
Scanner sob = new Scanner(System.in);//creating Scanner calss Object
ArrayList<Integer> num = new ArrayList<Integer>();//creating ArrayList object
System.out.println("Enter length of the ArrayList: ");//print message
l = scan.nextInt();//input length value
System.out.println("Enter ArrayList values: "); //print message
for(i = 0; i < l; i++)//use for to input value
{
num.add(sob.nextInt());//input value
}
System.out.println("Odds list: " + getOdds(num));//calling method getOdds
System.out.println("Original list: " + num);//print array value
}
}
Output:
Enter ArrayList length:
7
Enter values:
2
5
8
6
7
3
12
Odds list: [5, 7, 3]
Original list: [2, 5, 8, 6, 7, 3, 12]
Explanation:
In the above-program inside the class, a static method "getOdds "is declared, that accepts an array list in its parameters, and defined an array list "odd", in this a for loop is defined, that check the odd numbers in the array and add the value in the odd Arraylist, and returns its values.
Inside the main method is defined that creates scanner class object for input array value and pass the value into the method "getodds" and print its return values.
The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods are not all correct.
Your job is to go through and fix them. You will need to make edits in both files to get them working correctly, but once complete, your output should match the output below.
Sample Output:
Circle with a radius of 5.0
The diameter is 10.0
The perimeter is 31.41592653589793
CIRCLE.JAVA
public class Circle {
public double radius;
private Circle(double myRadius) {
radius = myRadius;
private void setRadius(int myRadius){
radius = myRadius;
}
private double getDiameter() {
return radius*2;
}
public double getRadius() {
return radius;
}
private double getPerimeter() {
return Math.PI*getDiameter();
}
private String toString() {
return "Circle with a radius of " + radius;
}
}
CIRCLE TESTER.JAVA
public class CircleTester {
public static void main(String[] args) {
Circle circ = new Circle(10);
circ.radius = 5;
System.out.println(circ);
System.out.println("The diameter is " + circ.getDiameter());
System.out.println("The perimeter is " + circ.getPerimeter())
}
}
Answer:
CIRCLE.JAVA
public class Circle {
private double radius;
public Circle(double myRadius) {
radius = myRadius;
private void setRadius(int myRadius){
radius = myRadius;
}
public double getDiameter() {
return radius*2;
}
public double getRadius() {
return radius;
}
public double getPerimeter() {
return Math.PI*getDiameter();
}
public String toString() {
return "Circle with a radius of " + radius;
}
}
CIRCLE TESTER.JAVA
public class CircleTester {
public static void main(String[] args) {
Circle circ = new Circle(10);
circ.radius = 5;
System.out.println(circ);
System.out.println("The diameter is " + circ.getDiameter());
System.out.println("The perimeter is " + circ.getPerimeter())
}
}
Explanation:
public class Circle {
//This could be made private or public.
//Making it private is better
private double radius;
//This is a constructor. It should be made public
//since it would most likely be used in another class
//to create an object of this class.
//Making it private means no other external class can create
//an object of this class.
//Since the tester class (CIRCLETESTER.java), as shown on line 3,
// needs to create
//an object of this class, this should be made public
public Circle(double myRadius) {
radius = myRadius;
private void setRadius(int myRadius){
radius = myRadius;
}
//This should be made public since it will be
// used in another class (CIRCLETESTER.java in this case)
public double getDiameter() {
return radius*2;
}
public double getRadius() {
return radius;
}
//This should be made public since it will be
//used in another class (CIRCLETESTER.java)
public double getPerimeter() {
return Math.PI*getDiameter();
}
//The toString() method is the string representation
//of an object and is called when there is an attempt to
//print the object. It should be made public since it will
//be used in another class (CIRCLETESTER.java)
public String toString() {
return "Circle with a radius of " + radius;
}
}
CIRCLE TESTER.JAVA
public class CircleTester {
public static void main(String[] args) {
Circle circ = new Circle(10);
circ.radius = 5;
System.out.println(circ);
System.out.println("The diameter is " + circ.getDiameter());
System.out.println("The perimeter is " + circ.getPerimeter())
}
}
HELP AASAP BRAINLIEST JUST HELP
Answer:
d
Explanation:
plz brainliest
write a short note on Magnetic tape as a secondary storage device
Answer:
In magnetic tape only one side of the ribbon is used for storing data. It is sequential memory which contains thin plastic ribbon to store data and coated by magnetic oxide. Data read/write speed is slower because of sequential access. It is highly reliable which requires magnetic tape drive writing and reading data.
Explanation:
At Moore High, 456 students attended the prom. This is 65 more students than
the previous year.
To the nearest percent, what is the percent of increase from last year to this
year?
12%
15%
17%
19%
Answer:
B-15%
Explanation:
write an algorithm to find the average of six numbers
Answer:
Input: two numbers x and y Output: the average of x and y Step 1 : input x,y Step 2: sum=0,average=0 Step 3:sum = x + y Step 4:average = sum /2 Step 5: print average.
Explanation:
Input: two numbers x and y Output: the average of x and y Step 1 : input x,y Step 2: sum=0,average=0 Step 3:sum = x + y Step 4:average = sum /2 Step 5: print average.
Algorithms are set of instructions which are to be followed in other to solve a particular problem. The algorithm which gives the average of six values goes thus:
1.)
Input : a, b, c, d, e, f
#takes input of the six numbers
2.)
sum=0 ; average=0
# initialize sum and average variables to 0
3.)
sum = a + b + c + d + e + f
#takes the sum of the six numbers
4.)
average = sum /6
#divide the sum by the number of values.
5)
print average.
#display the average value
Learn more : https://brainly.com/question/24266817
Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can cover 350.0 square feet. So gallons = the square feet divided by 350.0. If the input is 250.0, the output should be:
0.714285714286
Answer:
gallons_paint = wall_area / 350.0
Explanation:
So gallons = the square feet divided by 350.0:
So gallons = gallons_paint
the square feet = wall_area
then divide by 350.0
the whole thing:
wall_area = float(input())
# Assign gallons_paint below
gallons_paint = wall_area / 350.0
print(gallons_paint)
The program to compute how many gallons of paints are needed to cover the given square feet's of walls is as follows:
def square_feet_to_gallons(area):
gallons = area / 350
return gallons
print(square_feet_to_gallons(250))
1 gallon covers 350 square feet.
Therefore, gallons = area / 350
The user inputs is the area in square feet. Then the output should be the number of gallons.
The code explanation python.We declared a function named square_feet_to_gallons and the argument is area.
Then we declared a variable and assigned the mathematical operation area/350 to it.
Then we return the gallons.
Finally, we call the function with a print statement.
learn more on programming here:https://brainly.com/question/14469650?referrer=searchResults
write down the name of output devices
Answer:
Monitor
Printer
Headphones
Computer Speakers
Projector
GPS
Sound Card
Video card
Explanation:
monitor
printer
headphones
computer speakers
projector
GPS
sound card
video card
hope it helps you
plese follow me
What is the relationship between a database and an information system and what impact does this relationship have on database design?
Respond to one or both of the following statements:
a. It is impossible to produce good information from poor data.
b. No matter how sophisticated the application programs are, it is impossible to use good application programs to overcome the effects of bad database design.
Answer:
b
Explanation:
hhiivibibu9 gg8 oh 8h h9 h 0h9
Write a method named numUnique that accepts a sorted array of integers as a parameter and that returns the number of unique values in the array. The array is guaranteed to be in sorted order, which means that duplicates will be grouped together. For example, if a variable called list stores the following values: int[] list
Answer:
The method in Java is as follows:
public static int numUnique(int list[]) {
int unique = 1;
for (int i = 1; i < list.length; i++) {
int j = 0;
for (j = 0; j < i; j++) {
if (list[i] == list[j])
break;
}
if (i == j)
unique++;
}
return unique;
}
Explanation:
This line defines the numUnique method
public static int numUnique(int list[]) {
This initializes the number of unique elements to 1
int unique = 1;
This iterates through the list
for (int i = 1; i < list.length; i++) {
The following iteration checks for unique items
int j = 0;
for (j = 0; j < i; j++) {
if (list[i] == list[j]) If current element is unique, break the iteration
break;
}
if (i == j)
unique++;
}
This returns the number of unique items in the list
return unique;
}
A type of SDLC in which each phase has results that flow into the next phase is called the __________ model.
C6
D
E
F
B
SABROSA
Catering Invoice
Sabrosa Empanadas & More
1202 Biscayne Bay Drive
Orlando, FL 32804
Empanadas & More
Invoice #: 5690B
Date: 05/15/20
1
2
MENU ITEM
3 Empanadas: Poblano & Cheese
4 Empanadas: Spicy Sweet Potato
UNIT PRICE
$2.79
$2.29
SUBTOTAL
TOTAL W/ TAX
QUANTITY
35
20
S
6
7
8
9
Catering Invoice Catering Subtotal Challenge +
Calculation Mode: Automatic Workbook Statistics
Answer:
Catering Invoice
Sabrosa Empanadas & More
1202 Biscayne Bay Drive
Orlando, FL 32804
Empanadas & More
Invoice #: 5690B
Date: 05/15/20
1
2
MENU ITEM
3 Empanadas: Poblano & Cheese
4 Empanadas: Spicy Sweet Potato
UNIT PRICE
$2.79
$2.29
SUBTOTAL
TOTAL W/ TAX
QUANTITY
35
Explanation:
hi I think this is vorrect
attribute variables have the same meaning as participants variables. is this true or false?
Answer:
true
Explanation:
because I said so dude
Boolean, integer, string, and float are examples of:
constants.
recursions.
loops.
variables.
Answer:
variables
Explanation:
The tool chest for programmers is also known as the CPU.
True or False?
Explanation:
I would say yes, but I'm not sure
What effect would excluding quotation marks from a search phrase have?
A.
It would narrow down the search.
B.
It would have little or no impact on the search.
C.
It would broaden the search.
D.
It would cause the search engine to bring up very different results.
Answer: C
it would broaden the search
Explanation:
Placing quotation marks around a search term or phrase limits your search to that exact term or phrase. Without the quotes, your search engine may return all results that contain each separate word. Placing AND between your keywords will return results that only include both or all your keywords.
Answer:
The answer is C. It would broaden the search.
Explanation:
I got it right on the Edmentum test.
What email program would you suggest and why?
Answer:
An email program
Explanation:
And why?
Answer:
I would suggest g m a i l.
Explanation:
I use G m a i l all the time and I think it is easy to use! A lot of people think it is great too! :)
being the server administrator how often will you conduct a server maintenance?
The measure of software complexity that measure how complex a software is in machine's viewpoint in terms of how the size of the input data affects an algorithm's usage of computational resources is known as Computational Complexity.
a. True
b. False
Answer:
a. True
Explanation:
In Computer science, an algorithm can be defined as a standard formula or procedure which comprises of set of finite steps or instructions for solving a problem on a computer.
Basically, the time complexity of an algorithm is defined by f(n) if; for all "n" and all inputs with length "n" the execution of the algorithm takes a maximum of f(n) steps. Therefore, this is a measure of the efficiency of an algorithm.
Hence, the time complexity is a measure of the amount of time required by an algorithm to run till its completion of the task with respect to the length of the inpu
Computational complexity can be defined as a measure of software complexity that measure how complex a software is in machine's viewpoint in terms of how the size of the input data affects an algorithm's usage of computational resources such as memory or running time.
How do we use game maker?
Answer:
The easy to use powerful game engine that is the best for 2D games
Why are object-oriented languages very popular?
They can use flowcharts.
They can use pseudocode.
They are powerful, clear, and efficient.
They don't use binary.
Answer:
Explanation:
Other advantages of object-oriented programming languages are you can use it to kinds of web applications for thorough data analysis, less development time, accurate coding, easy testing, reusability, debugging, less data corruption, and maintenance.
Which of the following is not a form of technology?
A) computer
B) ketchup
C) pencil
D) umbrella
Answer:
ketchup because all of the others are objects with certain creative functions but ketchup is just K e t c h u p.
Why are object-oriented languages very popular?
They can use flowcharts.
They can use pseudocode.
They are powerful, clear, and efficient.
They don't use binary.
Answer: I don't know the Choices but I can give u an example.
Explanation:
Other advantages of object-oriented programming languages are you can use it to kinds of web applications for thorough data analysis, less development time, accurate coding, easy testing, reusability, debugging, less data corruption, and maintenance.
Answer:
They are powerful, clear, and efficient.
Explanation:
Which of the following is NOT one of the Internet sources that hackers use to gather information about a company's employees?
1. Blogs
2. Company website
3. Social networking sites
4. Regional Internet registries
Answer:
4. Regional Internet registries
Explanation:
Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.
With cybersecurity theory, security standards, frameworks and best practices we can guard against cyber attacks and easy-to-guess passwords such as using alphanumeric password with certain composition and strength.
Some examples of the Internet sources that hackers use to gather information about a company's employees includes;
I. Blogs.
II. Company website.
III. Social networking sites.
However, Regional Internet registries cannot be used by hackers to gather information about a company's employees because it is an internet protocol resource organization saddled with the responsibility of allocating and registering internet protocol (IP) addresses.
compare and contrast Charles bebbage and Blaise Pascal inventions
Explanation:
A computer might be described with deceptive simplicity as “an apparatus that performs routine calculations automatically.” Such a definition would owe its deceptiveness to a naive and narrow view of calculation as a strictly mathematical process. In fact, calculation underlies many activities that are not normally thought of as mathematical. Walking across a room, for instance, requires many complex, albeit subconscious, calculations. Computers, too, have proved capable of solving a vast array of problems, from balancing a checkbook to even—in the form of guidance systems for robots—walking across a room.
Before the true power of computing could be realized, therefore, the naive view of calculation had to be overcome. The inventors who laboured to bring the computer into the world had to learn that the thing they were inventing was not just a number cruncher, not merely a calculator. For example, they had to learn that it was not necessary to invent a new computer for every new calculation and that a computer could be designed to solve numerous problems, even problems not yet imagined when the computer was built. They also had to learn how to tell such a general problem-solving computer what problem to solve. In other words, they had to invent programming.
They had to solve all the heady problems of developing such a device, of implementing the design, of actually building the thing. The history of the solving of these problems is the history of the computer. That history is covered in this section, and links are provided to entries on many of the individuals and companies mentioned. In addition, see the articles computer science and supercomputer.
Early history
Computer precursors
The abacus
The earliest known calculating device is probably the abacus. It dates back at least to 1100 BCE and is still in use today, particularly in Asia. Now, as then, it typically consists of a rectangular frame with thin parallel rods strung with beads. Long before any systematic positional notation was adopted for the writing of numbers, the abacus assigned different units, or weights, to each rod. This scheme allowed a wide range of numbers to be represented by just a few beads and, together with the invention of zero in India, may have inspired the invention of the Hindu-Arabic number system. In any case, abacus beads can be readily manipulated to perform the common arithmetical operations—addition, subtraction, multiplication, and division—that are useful for commercial transactions and in bookkeeping.
The abacus is a digital device; that is, it represents values discretely. A bead is either in one predefined position or another, representing unambiguously, say, one or zero.
Analog calculators: from Napier’s logarithms to the slide rule
Calculating devices took a different turn when John Napier, a Scottish mathematician, published his discovery of logarithms in 1614. As any person can attest, adding two 10-digit numbers is much simpler than multiplying them together, and the transformation of a multiplication problem into an addition problem is exactly what logarithms enable. This simplification is possible because of the following logarithmic property: the logarithm of the product of two numbers is equal to the sum of the logarithms of the numbers. By 1624, tables with 14 significant digits were available for the logarithms of numbers from 1 to 20,000, and scientists quickly adopted the new labour-saving tool for tedious astronomical calculations.
Most significant for the development of computing, the transformation of multiplication into addition greatly simplified the possibility of mechanization. Analog calculating devices based on Napier’s logarithms—representing digital values with analogous physical lengths—soon appeared. In 1620 Edmund Gunter, the English mathematician who coined the terms cosine and cotangent, built a device for performing navigational calculations: the Gunter scale, or, as navigators simply called it, the gunter. About 1632 an English clergyman and mathematician named William Oughtred built the first slide rule, drawing on Napier’s ideas. That first slide rule was circular, but Oughtred also built the first rectangular one in 1633. The analog devices of Gunter and Oughtred had various advantages and disadvantages compared with digital devices such as the abacus. What is important is that the consequences of these design decisions were being tested in the real world.
Digital calculators: from the Calculating Clock to the Arithmometer
In 1623 the German astronomer and mathematician Wilhelm Schickard built the first calculator. He described it in a letter to his friend the astronomer Johannes Kepler, and in 1624 . .
Write a program to insert an array of letters (word), then arrange the letters in ascending order and print this array after the arrangement.
Answer:
def split(word):
return [char for char in word]
word = input("Enter a word: ")
chars = split(word)
chars.sort()
sorted = ''.join(chars)
print(sorted)
Explanation:
Here is a python solution.
12. What was the trade Howard offered to Death?
Answer:
His life
Explanation:
Write a constructor for BaseballPlayer. The constructor takes three int parameters: numHits, numRuns, and numRBIs storing the values within the class' ArrayList field named playerStats.
Answer:
Following are the code to the given question:
public class BaseballPlayer//defining a class BaseballPlayer
{
BaseballPlayer(int numHits, int numRuns, int numRBIs)//defining a parameterized cons
{
}
}
Explanation:
Some of the data is missing, which is why the solution can be represented as follows:
In this code, a class BaseballPlayer is defined, and inside the class a parameterized constructor is defined that holds three integer variable "numHits, numRuns, and numRBIs".
divide the difference of 47 and 23 by the difference of 25 &13
Answer:
The answer is 2
Explanation:
Adding a paper clip to the vertical stabilizer of your glider will have what effect on its Center of Gravity (CG)?
The CG would move toward the rear.
The CG would stay the same.
The CG would move toward the nose.
O The CG would move lower
Answer:
the CG would move toward the rear.
Explanation:
Adding a paper clip to the vertical stabilizer of your glider will, the CG would move toward the rear. The correct option is A.
What is center of gravity?The place on an item where the force of gravity is thought to act is known as the center of gravity (CG).
The gravitational pull is thought to be focused at the point where an object weighs on average. Depending on the object's size, shape, and mass distribution, the center of gravity will be in one place or another.
The impact of adding a paper clip to your glider's vertical stabilizer is to shift the center of gravity (CG) to the back of the glider.
This is due to the fact that the paper clip adds weight to the glider's rear, moving the center of mass there and, as a result, the center of gravity.
Thus, the correct option is A.
For more details regarding center of gravity, visit:
https://brainly.com/question/20662119
#SPJ6