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
Alina [70]
3 years ago
6

Code in Java:

Computers and Technology
1 answer:
OverLord2011 [107]3 years ago
4 0

Answer:

Explanation:

The following expressions are written in Java and require the rest of the "assummed code" to run correctly, but can be pasted to that code and it has already been tested to be working and be bug free.

1)  boolean areEqual = (a1.getName() == a2.getName());

2) ch = c1.getModel().charAt(2);

3)  public static void whatIsStatus(Lamp myLamp) {

       if (myLamp.status == true) {

           return "ON";

       } else if (myLamp.status == false) {

           return "OFF";

       } else {

           return "ERROR";

       }

   }

You might be interested in
What is the meaning of a red wavy underline that appears under text in a publication?
matrenka [14]
It is a misspelling.
If you misspell a word the red wavy line will appear and give a suggestion when right clicked.
6 0
3 years ago
Read 2 more answers
A developer writes a SOQL query to find child records for a specific parent. How many levels can be returned in a single query.
blagie [28]
The correct answer to this question is A. One level or record an be returned in a single query when a developer writes a SOQL query to find child records for a specific parent.
4 0
3 years ago
Is the type of vision useful in sending motion and objects outside normal vision
nlexa [21]
Yes it is in fact it is usful
8 0
3 years ago
"re-type the celsius_to_kelvin function. Change the name to kelvin_to_celsius, and modify the function accordingly."
yanalaym [24]

You didn't include the original function, but the new function will contain something like:

function kelvin_to_celsius(k)

{

  return k - 273.15;

}

Depending of course on your programming language.

The outcome for negative Kelvin is undefined, you could test for that.


6 0
3 years ago
Read 2 more answers
Write a program that sorts an array of 20 random numbersin the range from 0 through 1000.
Nuetrik [128]

Answer:

#include<iostream>

#include<stdlib.h>

#include<time.h>

#include <algorithm>

using namespace std;

//main function program start from here

int main(){

   //seed the rand() function

   srand(time(NULL));

   //initialization

   int arr[20];

   //generate the 20 random number

  for(int i=0;i<20;i++){

   arr[i]=rand()%1000;   //store in array

  }

  sort(arr,arr+20); //sort the array by inbuilt function

  cout<<"The sorted array is."<<endl;

  //for display the each element in the array

  for(int i=0;i<20;i++){

   cout<<arr[i]<<endl;

  }

}

Explanation:

Create the main function and declare the array with size 20.

Take a for loop and generate the random number 20 times. For generating a random number, use the function rand();

rand() function which defines in the library stdlib.h, generate the random number within the range.

for example:

rand() % 20: generate the number between 0 to 19 ( Exclude 20).

for generating the random number different for every time, then we have to use srand() function and time function which defines in time.h library.

After that, store the number in the array.

Finally, take another loop and print all elements one by one.  

6 0
3 years ago
Other questions:
  • George borrowed some equipment from his friend for recording his monologue for his art class. He got all the equipment except th
    15·1 answer
  • If you are planning to carry a large balance on your credit card, which of the following credit card features should you look fo
    7·2 answers
  • ​Which of the following languages is used to set the width of a media player, add borders, drop shadows, and apply filters and t
    7·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • To create a formula in______, you would first click in one of the cells​
    14·2 answers
  • Harmful programs used to disrupt computer operation, gather sensitive information, or gain unauthorized access to computer syste
    7·1 answer
  • I have a summary to write for my robotics class but it is way too hard and i have a bery less time. If you can help me it would
    7·1 answer
  • Why is network security important? Check all of the boxes that apply. A. Network security allows organizations to continue to fu
    8·1 answer
  • Which of these is NOT a standard part of the outro of a podcast?
    15·1 answer
  • Which of these about non-disclosure agreements is accurate?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!