Answers

Answer 1

Answer:

import java.util.Random;

class Main {

 static int[] createRandomArray(int nrElements) {

   Random rd = new Random();

   int[] arr = new int[nrElements];

   for (int i = 0; i < arr.length; i++) {

     arr[i] = rd.nextInt(1000);

   }

   return arr;

 }

 static void printArray(int[] arr) {

   for (int i = 0; i < arr.length; i++) {

     System.out.println(arr[i]);

   }

 }

 public static void main(String[] args) {

   int[] arr = createRandomArray(5);

   printArray(arr);

 }

}

Explanation:

I've separated the array creation and print loop into separate class methods. They are marked as static, so you don't have to instantiate an object of this class type.


Related Questions

h. What is recycle bin?
->​

Answers

Answer:

Trash application, the Recycle Bin

Explain the complement of a number along with the complements of the binary and decimal number systems.why is the complement method important for a computer system?​

Answers

olha so olha la que bacana bonito

The complement method are the digital circuits, are the subtracting and the addition was the faster in the method.  The binary system was the based on the bits are the computer language.

What is computer?

Computer is the name for the electrical device. In 1822, Charles Babbage created the first computer. The work of input, processing, and output was completed by the computer. Hardware and software both run on a computer. The information is input into the computer, which subsequently generates results.

The term “binary” refers to the smallest and minimum two-digit number stored on a computer device. The smallest binary codes are zero (0) and one (1). The use of storing numbers easily. The computer only understands the binary language. The binary is converted into the number system as a human language. The complement method are the digital circuits the addition and the subtracting was the easily.

As a result, the complement method is the digital circuits are the subtracting to the binary system was the based on the bits are the computer language.

Learn more about on computer, here:

https://brainly.com/question/21080395

#SPJ2

A data science experiment you are conducting has retrieved two historical observations for the price of Bitcoin(BTC) on December 2, 2017 of 11234 and 12475. Create a Python script that stores these two historicalobservations in a list variable namedbtcdec1.

Answers

Answer:

In Python:

btcdec1 = []

btcdec1 = [11234, 12475]

print(btcdec1)

Explanation:

First, create an empty list named btcdec1

btcdec1 = []

Next, insert the two data (11234 and 12475) into the list

btcdec1 = [11234, 12475]

Lastly, print the list

print(btcdec1)

A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first student, denoted S1, opens every locker. Then the second student, S2, begins with the second locker, denoted L2, and closes every other locker (i.e. every even numbered locker). Student S3 begins with the third locker and changes every third locker (closes it if it was open, and opens it if it was closed). Student S4 begins with locker L4 and changes every fourth locker. StudentS5 starts with L5 and changes every fifth locker, and so on, until student S100 changes L100.After all the students have passed through the building and changed the lockers, which lockers areopen? Write a program to find your answer.(Hint: Use an array of 100 boolean elements. each of which indicates whether a locker is open (true) or closed (false). Initially, all lockers are closed.)

Answers

Solution :

public class NewMain {  

   public_static void main_(String[] args) {  

       boolean[] _locker = new boolean_[101];  

       // to set all the locks to a false NOTE:  first locker is the number 0. Last locker is the 99.

       for (int_i=1;i<locker_length; i++)

       {

       locker[i] = false;

       }

       // first student opens all lockers.

       for (int i=1;i<locker.length; i++)        {

       locker[i] = true;

       }

       for(int S=2; S<locker.length; S++)

       {

          for(int k=S; k<locker.length; k=k+S)

          {

              if(locker[k]==false) locker[k] = true;

              else locker[k] = false;      

          }            

       }

       for(int S=1; S<locker.length; S++)

       {

           if (locker[S] == true) {

               System.out.println("Locker " + S + " Open");

           }

         /* else {

               System.out.println("Locker " + S + " Close");

           } */

       }

   }

}

Which image-editing tool can be used to help remove spots and other marks from an image?
A. brighten
B. stylize
C. healing brush
D. contrast
E. desaturate

Answers

C. Healing brush
That’s the answer

Answer:

c. healing brush

Explanation:

Write a program that asks the user to enter a date in MM/DD/YYYY format that is typical for the US, the Philippines, Palau, Canada, and Micronesia. For the convenience of users from other nations, the program computes and displays this date in an alternative DD.MM.YYYY format. Sample run of your program would look like this: Please enter date in MM/DD/YYYY format: 7/4/1776 Here is the formatted date: 04.07.1776 You can assume that the user will enter correctly formatted date, but do not count on having 0s in front of one-digit dates. Hint: you will need to use string addition (concatenation) here.

Answers

Answer:

In Python:

txt = input("Date in MM/DD/YYYY format: ")

x = txt.split("/")

date=x[1]+"."

if(int(x[1])<10):

   if not(x[1][0]=="0"):

       date="0"+x[1]+"."

   else:

       date=x[1]+"."

   

if(int(x[0])<10):

   if not(x[0][0]=="0"):

       date+="0"+x[0]+"."+x[2]

   else:

       date+=x[0]+"."+x[2]

else:

   date+=x[0]+"."+x[2]

   

print(date)

Explanation:

From the question, we understand that the input is in MM/DD/YYYY format and the output is in DD/MM/YYYY format/

The program explanation is as follows:

This prompts the user for date in MM/DD/YYYY format

txt = input("Date in MM/DD/YYYY format: ")

This splits the texts into units (MM, DD and YYYY)

x = txt.split("/")

This calculates the DD of the output

date=x[1]+"."

This checks if the DD is less than 10 (i..e 1 or 01 to 9 or 09)

if(int(x[1])<10):

If true, this checks if the first digit of DD is not 0.

   if not(x[1][0]=="0"):

If true, the prefix 0 is added to DD

       date="0"+x[1]+"."

   else:

If otherwise, no 0 is added to DD

       date=x[1]+"."

   

This checks if the MM is less than 10 (i..e 1 or 01 to 9 or 09)

if(int(x[0])<10):

If true, this checks if the first digit of MM is not 0.

   if not(x[0][0]=="0"):

If true, the prefix 0 is added to MM and the full date is generated

       date+="0"+x[0]+"."+x[2]

   else:

If otherwise, no 0 is added to MM and the full date is generated

       date+=x[0]+"."+x[2]

else:

If MM is greater than 10, no operation is carried out before the date is generated

   date+=x[0]+"."+x[2]

This prints the new date

print(date)

which internet service is the main reason the internet has expanded and what draws newcomers to the internet?

Answers

Answer:

It has spread throughout the world since it is a very useful tool since most things are facilitated, thus leading to a much more efficient daily life, which is why the internet is one of the main means for the functioning of the world today. day, as new technologies have revolutionized

Social media.

The term social media refers to those digital tools that facilitate the transmission of information, communication and social interaction between individuals. Thus, social media allows individuals to relate to each other, in a similar way as if they were physically interacting, but through computer means.

These social media can be from profiles on social networks to blogs, podcasts or even videos on digital platforms. In short, nowadays social media is an integral part of people's social life, and it is in many cases what ends up driving them to use the internet.

Learn more in https://brainly.com/question/21765376

____________ reference is used when you want to use the same calculation across multiple rows or columns.

Answers

Answer:

relative cell

Explanation:

So, if you want to repeat the same calculation across several columns or rows, you need to use relative cell references. For example, to multiply numbers in column A by 5, you enter this formula in B2: =A2*5. When copied from row 2 to row 3, the formula will change to =A3

Answer:

Relative

Explanation:

Relative  reference is used when you want to use the same calculation across multiple rows or columns.

Suppose you present a project and your supervisor comments that the graphics need to be a higher quality and suggests you replace a circuit board. To what circuit board is your supervisor referring?


graphics card

video card

sound card

system card

Answers

Answer:graphics card

Explanation:

Answer:

graphics card

Explanation:

3. Given the following total revenue functions, find the corresponding demand functions:

a) TR = 50Q-4Q²
b) TR = 10

Answers

a)TR=50Q4Q2 I hope.this helps

A) The demand function for the total revenue function TR = 50Q - 4Q² is;

P = 50 - 4Q

B) The demand function for  the total revenue function TR = 10 is; 10/Q

We are given total revenue functions as;

TR = 50Q - 4Q²

TR = 10

A) TR = 50Q - 4Q²

Formula for revenue function if Q represents the units demanded is;

TR = P × Q

Where P is the demand function

Thus;

50Q - 4Q² = PQ

Divide both sides by Q to get the demand function;

P = 50 - 4Q

B) TR = 10

Formula for revenue function if Q represents the units demanded is;

TR = P × Q

Where P is the demand function

Thus;

10 = P × Q

Divide both sides by Q to get the demand function;

P = 10/Q

Read more at;https://brainly.com/question/13701068

Are items a through e in the following list algorithm? If not, what qualities required of algorithms do they lack?
a. Add the first row of the following matrix to another row whose first column contains a nonzero entry. (Reminder: Columns run vertically; rows run horizontally.)
[1 2 0 4 0 3 2 4 2 3 10 22 12 4 3 4]
b. In order to show that there are as many prime numbers as there are natural numbers, match each prime number with a natural number in matching the first prime number with 1 (which is the first natural number) and the second prime number with 2, the third with 3, and so forth. If, in the end, it turns out that each prime number can be paired with each natural number, then it is shown that there are as many prime numbers as natural numbers.
c. Suppose you're given two vectors each with 20 elements and asked to perform the following operation. Take the first element of the first vector and multiply it by the first clement of the second vector. Do the same to the second elements, and so forth. Add all the individual products together to derive the dot product.
d. Lynne and Calvin are trying to decided who will take the dog for a walk. Lynne suggests that they flip a coin and pulls a quarter out of her pocket. Calvin does not trust Lynne and suspects that the quarter may be weighted (meaning that it might favor a particular outcome when tossed) and suggests the following procedure to fairly determine who will walk the dog.
1. Flip the quarter twice.
2. If the outcome is heads on the first flip and tails on the second, then I will walk the dog.
3. If the outcome is tails on the first flip, and heads on the second, then you will walk the dog.

Answers

Answer:

Following are the responses to the given points:

Explanation:

The following features must contain a well-specified algorithm:

Description [tex]\to[/tex] Exact measures described

Effective computation   [tex]\to[/tex]  contains steps that a computer may perform

finitude  [tex]\to[/tex]  It must finish algorithm.

In choice "a", there is little algorithm Because it does not stop, finiteness has already been incomplete. There is also no algorithm.

In choice "b", it needs productivity and computational burden. because it's not Enter whatever the end would be.

In choice "c", the algorithm is given the procedure. It fulfills all 3 algorithmic properties.

In choice "d", each algorithm is a defined process. Since it needs finitude.

Explain different types of networking-based attacks

Answers

Answer:

Network-based cyber attacks. ... These may be active attacks, wherein the hacker manipulates network activity in real-time; or passive attacks, wherein the attacker sees network activity but does not attempt to modify it

1 #include
2 using namespace std;
3
4 int main() {
5 int userNum;
6 int userNumSquared;
7
8 cin >> userNum;
9
10 userNumSquared = userNum + userNum; // Bug here; fix it
11
12 cout << userNumSquared; // Output formatting issue |
13
14 return 0;
15 }
16
While the zyLab platform can be used without training, a bit of training may help some students avoid common issues.
The assignment is to get an integer from input, and output that integer squared, ending with newline. (Note: This assignment is configured to have students programming directly in the zyBook. Instructors may instead require students to upload a file). Below is a program that's been nearly completed for you.
Click "Run program". The output is wrong. Sometimes a program lacking input will produce wrong output (as in this case), or no output. Remember to always pre-enter needed input.
Type 2 in the input box, then click "Run program", and note the output is 4.
Type 3 in the input box instead, run, and note the output is 6.
When students are done developing their program, they can submit the program for automated grading.
Click the "Submit mode" tab
Click "Submit for grading".
The first test case failed (as did all test cases, but focus on the first test case first). The highlighted arrow symbol means an ending newline was expected but is missing from your program's output.
Matching output exactly, even whitespace, is often required. Change the program to output an ending newline.
Click on "Develop mode", and change the output statement to output a newline: cout << userNumSquared << endl;. Type 2 in the input box and run.
Click on "Submit mode", click "Submit for grading", and observe that now the first test case passes and 1 point was earned.
The last two test cases failed, due to a bug, yielding only 1 of 3 possible points. Fix that bug.
Click on "Develop mode", change the program to use * rather than +, and try running with input 2 (output is 4) and 3 (output is now 9, not 6 as before).
Click on "Submit mode" again, and click "Submit for grading". Observe that all test cases are passed, and you've earned 3 of 3 points.

Answers

Answer:

Change line 10 to:

userNumSquared = userNum * userNum;

Change line 11 to:

cout << userNumSquared<<endl;

Explanation:

Though the question is a bit lengthy but the requirements are not clearly stated. However, I'm able to pick up the following points.

Print the square of the inputted numberPrint the squared number with a new line

To do this, we simply modify the affected lines which are lines 10 and 11.

The plus sign on line 10 will be modified to multiplication

i.e.

userNumSquared = userNum * userNum;

And line 11 will be modified to:

cout << userNumSquared<<endl;

Every other line of the program is okay and do not need to be modified

You are working with an online tech service to fix a problem with installation of a program on your machine. You grant them remote access to your computer to enable them to act as you to fix situation. What type of must be installed on your machine to allow this type of action by another person

Answers

Answer:

Single User OS.

Explanation:

An operating system is a system software pre-installed on a computing device to manage or control software application, computer hardware and user processes.

This ultimately implies that, an operating system acts as an interface or intermediary between the computer end user and the hardware portion of the computer system (computer hardware) in the processing and execution of instructions.

Some examples of an operating system on computers are QNX, Linux, OpenVMS, MacOS, Microsoft windows, IBM, Solaris, VM etc.

There are different types of operating systems (OS) used for specific purposes and these are;

1. Batch Operating System.

2. Multitasking/Time Sharing OS.

3. Multiprocessing OS.

4. Network OS.

5. Mobile OS.

6. Real Time OS .

7. Distributed OS.

8. Single User OS.

A Single User OS is a type of operating system that only allows one user to perform a task or use a system at any time.

In this scenario, you are working with an online tech service to fix a problem with installation of a program on your machine. You grant them remote access to your computer to enable them to act as you to fix situation. Therefore, the type of OS which must be installed on your machine to allow this type of action by another person is called a Single User OS.

In order to enhance the training experience and emphasize the core security goals and mission, it is recommended that the executives _______________________.

Answers

Answer:

vg

Explanation:

kiopoggttyyjjfdvhi


Write a function solution that, given an integer N, returns the maximum possible
value obtained by inserting one '5' digit inside the decimal representation of integer N.
Examples:
1. Given N = 268, the function should return 5268.
2. Given N = 670, the function should return 6750.
3. Given N = 0, the function should return 50.
4. Given N = -999, the function should return - 5999.
Assume that:
• N is an integer within the range (-8,000..8,000).
In your solution, focus on correctness. The performance of your solution will not be the
focus of the assessment.
Copyright 2009-2021 by Codility Limited. All Rights Reserved. Unauthorized copying, publication or
disclosure prohibited

Answers

You did not specified the language, so I did my program in python.

Hope it helps!!!

The given SQL creates a Movie table with an auto-incrementing ID column. Write a single INSERT statement immediately after the CREATE TABLE statement that inserts the following movies:
Title Rating Release Date
Raiders of the Lost Ark PG June 15, 1981
The Godfather R March 24, 1972
The Pursuit of Happyness PG-13 December 15, 2006
Note that dates above need to be converted into YYYY-MM-DD format in the INSERT statement. Run your solution and verify the movies in the result table have the auto-assigned IDs 1, 2, and 3.
CREATE TABLE Movie (
ID INT AUTO_INCREMENT,
Title VARCHAR(100),
Rating CHAR(5) CHECK (Rating IN ('G', 'PG', 'PG-13', 'R')),
ReleaseDate DATE,
PRIMARY KEY (ID)
);
-- Write your INSERT statement here:

Answers

Answer:

INSERT INTO Movie(Title,Rating,ReleaseDate)

VALUES("Raiders of the Lost ArkPG",'PG',DATE '1981-06-15'),

("The Godfaher",'R',DATE '1972-03-24'),

("The Pursuit of Happyness",'PG-13',DATE '2006-12-15');

Explanation:

The SQL statement uses the "INSERT" clause to added data to the movie table. It uses the single insert statement to add multiple movies by separating the movies in a comma and their details in parenthesis.

what are the cleaning solutions used in cleaning gas stove, refrigerator and kitchen premises?​

Answers

Answer:

Detergents. Soaps, liquid or paste. Solvent cleaners. Acid cleaners. Abrasive cleaners. Applying heat. Exposing to radiant energy. Chemical sanitizers. Natural cleaning materials.

Explanation:

what is ergonomic in computer science​

Answers

Answer:

Ergonomics is the science of fitting jobs to people. One area of focus is on designing computer workstations and job tasks for safety and efficiency. Effective ergonomics design coupled with good posture can reduce employee injuries and increase job satisfaction and productivity.

A local real estate company can have its 25 computers upgraded for $1000. If the company chooses only to upgrade 10 systems, how much will the upgrade cost if the same rate is used?

Answers

Answer:

it is

Explanation:

400 dollars for 10 systems and 200 dollars for 5 systems

explanation

first

find the price of 1 system or computer which is done by dividing 1000 by 25

25)1000(40

100

____

00

00

__

0

then multiple it by 10 =40 ×10=$400

Answer:

400!!

Explanation:

Can someone tell me how to get rid of the the orange with blue and orange on the status bar

Please and thank you

Picture above

Answers

Answer:

Explanation:

i'm not sure how tho

Hover over it then you will see an X click that and it should go away, if that doesn’t work click with both sides of the of the mouse/ touch thingy and it should say close tab!

What is one way to use proper netiquette when communicating online? Ask permission before posting private information. Post a message when you are angry Use CAPS when sending a message. Use unreliable sources.

Answers

Answer: A

Explanation:

Being a responsible netizen you must respect anyone using internet. Be mindful of what you share which include fake news, photos and video of others. Watch you're saying, if you wouldn't say something in real life dont say it online. You must think before you click not to hurt others.

Answer:

Ask permission before posting private information.

Explanation:

Just the most logical answer

algorithm and flowchart of detect whether entered number is positive, negative or zero​

Answers

What is this how many times are you going to say that unless it’s a visual glitch on my part?

2. It is the art of creating computer graphics or images in art, print media, video games.
ins, televisions programs and commercials.

Answers

the answer is CGI :)

To copy an item, you would:
O Highlight the item, right click, and select copy
O Press Ctrl + X
O Press Ctrl + Z
O Highlight text​

Answers

The first one (Highlight the item, right click, and select copy)
You would highlight the item, right click, and select copy to copy an item which is the first option!

Computers has done more harm than good​

Answers

Explanation:

Teueeeeeeeeeeeeeeeeeee

Nolur acil lütfen yalvarırım sana

Binary is a base-2 number system instead of the decimal (base-10) system we are familiar with. Write a recursive function PrintInBinary(int num) that prints the binary representation for a given integer. For example, calling PrintInBinary(5) would print 101. Your function may assume the integer parameter is non-negative. The recursive insight for this problem is to realize you can identify the least significant binary digit by using the modulus operator with value 2. For example, given the integer 35, mod by 2 tells you that the last binary digit must be 1 (i.e. this number is odd), and division by 2 gives you the remaining portion of the integer (17). What 's the right way to handle the remaining portion

Answers

Answer:

In C++:

int PrintInBinary(int num){

if (num == 0)  

 return 0;  

else

 return (num % 2 + 10 * PrintInBinary(num / 2));

}

Explanation:

This defines the PrintInBinary function

int PrintInBinary(int num){

This returns 0 is num is 0 or num has been reduced to 0

if (num == 0)  

 return 0;  

If otherwise, see below for further explanation

else

 return (num % 2 + 10 * PrintInBinary(num / 2));

}

----------------------------------------------------------------------------------------

num % 2 + 10 * PrintInBinary(num / 2)

The above can be split into:

num % 2 and + 10 * PrintInBinary(num / 2)

Assume num is 35.

num % 2 = 1

10 * PrintInBinary(num / 2) => 10 * PrintInBinary(17)

17 will be passed to the function (recursively).

This process will continue until num is 0

State and give reason, if the following variables are valid/invalid:
Variables defined in Python
Valid/Invalid
Reason
daysInYear


4numberFiles


Combination-month_game


Suncity.school sec54


Answers

Answer:

See Explanation

Explanation:

Variable: daysInYear

Valid/Invalid: Valid

Reason: It begins with a letter; it is not a keyword, and it does not contain a hyphen

Variable: 4numberFiles

Valid/Invalid: Invalid

Reason: It begins with a number

Variable: Combination-month_game

Valid/Invalid: Invalid

Reason: It contains a hyphen

Variable: Suncity.school sec54

Valid/Invalid: Invalid

Reason: It contains a dot and it contains space

What is Software Packages​

Answers

[tex]{\fcolorbox{red}{black}{\white {Answer}}}[/tex]

A software package is an assemblage of files and information about those files. ... Each package includes an archive of files and information about the software, such as its name, the specific version and a description. A package management system (PMS), such as rpm or YUM, automates the installation process.

A customer comes into a computer parts and service store. The customer is looking for a device to provide secure access to the central server room using a retinal scan. What device should the store owner recommend to accomplish the required task?

Answers

Answer:

The owner should recommend facial ID or retinal scanner

In comparison to other biometric methods like fingerprint or retinal scans, it is quicker and more practical. Comparing facial recognition to typing passwords or PINs, there are also fewer touchpoints. Multifactor authentication is supported for a second layer of security check.

What secure access to central server room, a retinal scan?

The topic of facial recognition has always caused controversy. The technology, according to its proponents, is a useful tool for apprehending criminals and confirming our identities. Critics argue that it violates privacy, may be inaccurate and racially prejudiced, and may even lead to unjustified arrests.

Simpleness of use and implementation. Once put into practice, both approaches are simple to utilize. However, facial recognition is basically possible with any camera (although a higher quality camera will be more accurate). Iris scanning is impossible with a standard camera, and the technology can be very expensive.

Therefore, The owner should recommend facial ID or retinal scanner.

Learn more about scan here:

https://brainly.com/question/24319849

#SPJ2

Other Questions
PLEASE ANSWER!!! the sepoys of india had served as soldiers for the British East India Company for years. what caused them to rise up against British rule in India?a. The British wanted to sepoys to fight against their own family membersb. The British passed laws that require non-Indians to become sepoys. c. The British became too disrespectful of the sepoys boys culture and religious beliefs. d. The British had decided to force the sepoys to convert to Christianity. Which incident from Lord of the Flies is used to develop the growing divide between Ralph and Jack?Ralph announces Piggy's nickname to the boys.Ralph and Jack discover a coral reef.Jack protests that he should be chief.Simon walks between Ralph and Jack. _______ the economic and social status of individuals A: socioeconomicB: Social StudiesC: Trade BarriersD: Quota 2. A lunar eclipse can occur when the Moon is in......in its orbit. Help me this is from amplify Need some help with this, please. : ) What is the measurement of angle D HELP PLS To save time, we often count the pulse for 30 seconds instead of a minute. If weIf wedo this, what must we multiply by to obtain an accurate pulse rate?only count for 15 seconds, what do we multiply by? URGENT!!!!!!Use scientific notation to estimate the number of inches in 1,225 miles. Include all calculations in your final answer.1 inch 1.578 10 -5 miles. Emxpress the fractions 3/4, 7/16, and 5/8 with the LCD find x and y intercepts. write ordered pairs representing the points where the line crosses the area axes. 2x+5y-11=0x intercept- (_,0)y intercept- (0,_) It's urgent, Please answer, Make Sure you Round itThe first three terms of a sequence are given. Round to the nearest thousandth (if necessary).460, 451,442Find the 37th term. which European countries have dependencies in the west indies Imari went on a hike and recorded the number of each type of bird he saw. The circle graph shows the results of his count.Imari saw 42 sparrows.How many birds did he count in all?Enter your answer in the box. what is the flvs spanish 1 module 5 dba questions? What is the area of a rectangle with a length of yard and width of yard? how it is done technique in writing historical What is the solution to the equation 1/3 n =6 write the following decimals in the form of p\ q= 0 and p,q are con-primes 1) 15.265 could someone help me with this please Select the equivalent expression.3-5 = ?