1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
blsea [12.9K]
2 years ago
7

Please create a new java package and class file for each problem. 1. Given the current array of numbers - [0,2,85,71,44,6,8,54,5

,21], find the largest and smallest value in the unsorted array. 2. Given the current array of integers - [235,21,5,6,21,22,5,6,1,2,3], check if the array contains either 3 or 6. 3. Create an array which contains 20 integer values. Assign a ramdom value for each array element using a for loop . Find all duplicate interger values in an array
Computers and Technology
1 answer:
EastWind [94]2 years ago
8 0

Answer:

¿Cómo se crear un objeto de una determinada clase en Java?

Para crear un objeto de una clase se usa la palabra reservada new. Por ejemplo, Rectangulo rect1=new Rectangulo(10, 20, 40, 80); new reserva espacio en memoria para los miembros dato y devuelve una referencia que se guarda en la variable rect1 del tipo Rectangulo que denominamos ahora objeto.

Explanation:

¿Cómo pasar un objeto de una clase a otra en Java?

Para clasificar un método de otra clase, necesitamos tener el objeto de esa clase. Aquí, tenemos una clase “Student” que tiene un método getName() . Accedemos a este método desde la segunda clase SimpleTesting usando el objeto de la clase Student

You might be interested in
What parts of the computer does it not need to function?​
Thepotemich [5.8K]
Fancy lights, mouse, keyboard, you can do fan but the computer will eventually overheat, it need coolant for it to run for a long while
6 0
3 years ago
C++
Sonbull [250]

Answer:

#include <iostream>

#include<iomanip>

using namespace std;

double DrivingCost(double drivenMiles, double milesPerGallon, double dollarsPerGallon)

{

  double dollarCost = 0;

  dollarCost = (dollarsPerGallon * drivenMiles) / milesPerGallon;

  return dollarCost;

}

int main()

{

  double miles = 0;

  double dollars = 0;

  cout << "Enter miles per Gallon   : ";

  cin >> miles;

  cout << "Enter dollars per Gallon: ";

  cin >> dollars;

  cout << fixed << setprecision(2);

  cout << endl;

  cout << "Gas cost for 10 miles : " << DrivingCost(10, miles, dollars) << endl;

  cout << "Gas cost for 50 miles : " <<DrivingCost(50, miles, dollars) << endl;

  cout << "Gas cost for 400 miles: "<<DrivingCost(400, miles, dollars) << endl;

  return 0;

}

Explanation:

  • Create a method definition of DrivingCost that accepts  three input double data type parameters drivenMiles,  milesPerGallon, and dollarsPerGallon and returns  the dollar cost to drive those miles .
  • Calculate total dollar cost and store in the variable, dollarCost .
  • Prompt and read the miles and dollars per gallon  as input from the user .
  • Call the DrivingCost function three times  for the output to the gas cost for 10 miles,  50 miles, and 400 miles.

 

8 0
3 years ago
Read 2 more answers
The main purpose of a constructor is to initialize the data members at the moment that an object is created. true or false?
GalinKa [24]

Answer:

True

Explanation:

In Object Oriented Programming, a constructor is a type of subroutine whose purpose is to create an object.

when the constructor is called, it initializes the data members of the object and establishes the invariant of the class.

Some important concepts:

Data members: The data members are the data encapsulated within the object (e.g. int hour for the variable <em>'hour'</em> in an object called <em>'date'</em>)

Invariant of the class: The class invariant is the invariant used to constrain the object (e.g. values between 0 and 24 for the variable <em>'hour'</em>)

4 0
4 years ago
A canister is released from a helicopter 500m above the ground. The canister is designed to withstand an impact speed of up to 1
Lisa [10]

Answer:

a) h = 1/2 gt² b) 99 m/s c) 14.1 m/s

Explanation:

a) As the only force acting on the canister once released is gravity, as it is constant, we can use one of the kinematic equations, as follows:

h = h₀ + v₀t + 1/2a t²

As we are told that the canister is simply released, it means that v₀ =0.

If we choose the direction of the acceleration (downward) as positive ,and we select the height at which it was released as our origin, so h₀ =0, the final expression for height is as follows:

h = 1/2 g t²

b) Combining this equation with the expression of t, from the definition of acceleration as the rate of change of velocity, we arrive to this expression:

vf² - v₀² = 2 g h  

As v₀ = 0, we have v₀ = √2.g.h = √2.9.8.500 m²/s² = 99 m/s

c) In order to be able to break the canister, impact speed must be larger than 100 m/s.

So, we can use the same equation as above, putting vf=100 m/s, and solving for v₀, as follows:

v₀² = vf² - 2.g.h = 100² m²/s² - 2.9.8.500 m²/s² = 200 m²/s²

v₀ = √200 m²/s² = 14.1 m/s

For any value of v₀ just barely larger than this, the canister will be broken.

7 0
3 years ago
Which of the following is not considered format?
GalinKa [24]
The answer is indeed the last one, ordering information and let me say it is true because this describes a function in itself and not a format like the first option that is a text format, the second a visual format and the third could be a table format. I hope this clarifies things
6 0
3 years ago
Read 2 more answers
Other questions:
  • Consider the following scenario and prescribe a solution. Situation: Tenisha is moving to Ohio to attend college. It is very hum
    15·1 answer
  • What is the systems development life cycle?1) Involves describing the desired features and operations of the system. 2) Involves
    15·1 answer
  • In 1928 what film was the first all talking feature
    12·1 answer
  • Why do you think Google+'s engagement levels are so low? Do you think they will rise as people become more familiar with the soc
    12·1 answer
  • The advantage of an electronic ____ is that the content can be easily edited and updated to reflect changing financial condition
    8·1 answer
  • Reflect on the questions below.
    7·1 answer
  • How many registers are there in the memory unit?
    8·1 answer
  • What is digital scavenger hunting? A. An application that locates addresses B. A scavenger hunt where players use GPS and digita
    5·1 answer
  • Immigrants are allowed to enter the country to work when they have a(n)
    10·1 answer
  • Write a program in c# that simulates the roll of two six sided dice.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!