Create an array of size 10 and name RandArray populate the RandArray with random integer from 1 to 20. Every element in the RandArray must be changed as follows: If the value of the element is less than the array index, the element must be replaced with the index plus 10. If the value of the element is equal to the index, the element must be doubled. If the value of the element is greater than the index, the element must be replaced by the index squared. Print the original number and the changed number of the RandArray

Answers

Answer 1

Answer:

int[]RandArray = new RandArray[10];

for(int x =0; x< RandArray.length;x++){

RandArray[x] = random.nextInt(10 - 1 + 1) + 1;

}

for(int x =0; x< RandArray.length;x++){

int og = RandArray[x];

if(RandArray[x]<x){

RandArray[x] = x + 10;

}

else if(RandArray[x] == x){

RandArray[x] =RandArray[x] * 2;

}

else if(RandArray[x] > x){

RandArray[x] =Math.pow(x,2);

}

System.out.println("Original: " + og +"New: "+ " RandArray[x])

}

Explanation:

Answer 2

Following are the python program for calculating the array values by using the random array function:

Python Program:

import random as R#import package of random

R1 = R.sample(range(1, 20), 10) #Generating 10 random numbers from 1 to 20

RandArray  = R1.copy() #Copying the elements of R1 in to RandArray

print("Original Array: ",RandArray)#defining the print method that prints RandArray value

for e in range(len(RandArray)):#defining a loop that calculates

   if(RandArray[e] < e):#defining if block that checks index of list that stores random number  

       RandArray[e] = e+10#adding 10 in numbers

   elif(RandArray[e] == e):#defining if block that checks index of list that stores random number  

       RandArray[e] = e*2#multiplying by 2 in number

   elif(RandArray[e] > e):#defining if block that checks index of list that stores random number  

       RandArray[e] = e**2#calculating the square value of RandArray

   print("Changed Array: ",RandArray)#print RandArray value

for i in range(10):#defining loop that prints Array value

   print("Original Number:",R1[i], "Changed Number:",RandArray[i])#print RandArray value

Output:

Please find the attached file.

Program Explanation:

import package of random. Defining the "R1" variable that uses a random function to generate 10 random numbers from 1 to 20.Declaring the "RandArray" that Copying the elements of R1 into RandArray.Defining a loop that calculates the length of the array and uses a conditional block that checks and calculates the random array values.In the last step, another loop is declared that prints the array "RandArray" value.

Find out more information about the random number here:

brainly.com/question/16403687

Create An Array Of Size 10 And Name RandArray Populate The RandArray With Random Integer From 1 To 20.

Related Questions

Select all of the true statements about navigating the Internet.
Enter a URL and press Enter to visit a new Web page.
Refresh your browser anytime you want the computer to remember a URL.
You cannot reset your home page.
Use tabs at the top of the browser window to move between several pages that you have opened.
Click on the x in the upper right corner to close the browser window.
m Press the arrow that points to the right to go to the last Web page that you visited

Answers

Answer:

1, 4, and 5

Explanation:

2 is false because refreshing your browser doesn't mean that the url is memorized, it means that something is wrong or something isn't working, and you can try reloading that tab again.

3 is false because you can reset your home page.

6 is false because going to the right isn't going to a previous page you visited, it goes back to present tabs. Think of the left arrow as going to the past, and the right as going back to the present.

ASAP PLEASE... An employee of an organization is facing Internet issues. What should this employee do to troubleshoot this issue?A.
check for free disc space on the computer
B.
disconnect the Internet cable from the computer
C.
check the server
D.
check whether the computer has an IP address

Answers

C. check the server

Why do guys get jealous when u hangout with another guy that's not them

Anyways what's 1+1 just putting this to not get reported by a mod​

Answers

Answer:

pootin

Explanation:

yotub search terms:

putin behind putin assassination

__________________ is a technique can be beneficial when driving next to parked vehicles or approaching signal lights or intersections.

Covering the brake
Using your handbrake
Slipping the clutch
Drifting

Answers

Answer:

Covering the brakeis a technique can be beneficial when driving next to parked vehicles or approaching signal lights or intersections

Covering the brakes is a beneficial driving technique for driving next to parked vehicles o while approaching the signal lights.

What is driving technique?

The appropriate and standard ways keeping the legal functions in mind while driving a vehicle is known as an ethical driving technique.

While driving, when a parked vehicle is in the way or at the time of approaching the signals or intersections on the roads, it is the best advisable to cover the brakes of the vehicles.

Hence, option A holds true regarding the driving technique.

Learn more about driving technique here:

https://brainly.com/question/9854106

#SPJ2

What is ed-tech? Because we are doing a project in computers.

Answers

Answer:

"Educational technology is the combined use of computer hardware, software, and educational theory and practice to facilitate learning. When referred to with its abbreviation, EdTech, it is often referring to the industry of companies that create educational technology."

Explanation:

To qualify as a professional Android developer, you need to get _____
certification.

Answers

Answer:

proficiency

Explanation:

Logo Game:name the 10 social media logos you see in the picture below​

Answers

1 twitter

2 Insta  

4 g o o g le  drive

5 Pinterest

6.Tumbir  

7.WordPress  

8.Reddit\

hope this helps i dont know a couple

What is a social media?

Social media is an internet base platform that allows interactions among people while creating and sharing data.

The Logo in the picture is as follows:

1. T--witter

2. Ins--tagram

3. Friend--star

4. Go--ogle drive

5. Pin--terest

6. Tum--bir

7. Word--Press

8. Red--dit

Read more about Social media

brainly.com/question/3653791

I was designed to meet the computing needs of an individual. I was originally referred to as ___________________.
a) Servers
b) Supercomputers
c) Microcomputers
d) Mainframes

Answers

c) microcomputers
explanation: designed for computing needs of an individual

example of hand held computer​

Answers

Answer:

Examples of Handheld PC devices are the NEC MobilePro 900c, HP 320LX, Sharp Telios, HP Jornada 720, IBM WorkPad Z50, and Vadem Clio. Also included are tablet computers like the Fujitsu PenCentra 130, and even communicators like the late Samsung NEXiO S150.

Use the factorial operation to evaluate 4!.
10
O 24
04
0 1

Answers

Answer:

24

Explanation:

factorial operation 4! = 4×3×2×1 = 24

Keli is unable to find a shape that meets her needs. Which feature in Power Point should she use to create shapes that are completely customized?

Answers

Answer:

I just use the search bar in the app and type in shapes. Then you right click on the shape and click on edit points to shape it into whatever shape you want.

Explanation:

I went into the PowerPoint and did it myself.

What is the use of comma and semicolon with print statement ?​

Answers

Answer:

The use of a comma and semicolon with print statement tells the computer that the program or specific line is ending.

Explanation:

So for example, with a python program if you write print("Hello, World"); the semicolon tells the computer that, that command ends at the semicolon.

Which of the following is an example of an application ?

Answers

The third one I think
The 3rd one cause all the others are brands pretty much


5 Which one of the following refers to printed versions of documents
a) Scanned documents
b) Hardcopy documents
c) Compressed documen
d) Zipped documents​

Answers

Answer:

Explanation:

Option B is the correct answer

How does a computer program use pixels to display an image?

Answers

Every image on your computer's screen is made up of pixels. A pixel is a tiny dot of color. ( proper ans: When the pixels are small enough, your brain merges them together into a single image.)

Answer:

Every image on your computer's screen is made up of pixels. A pixel is a tiny dot of color. When the pixels are small enough, your brain merges them together into a single image.

for more information please visit http://coredogs.com/lesson/how-computers-show-images.html#:~:text=Every%20image%20on%20your%20computer's,together%20into%20a%20single%20image.

I need help please, this is python. Please write out answer in comment.

Answers

Answer:

I would need to see the program to be able and solve your numeral error

What is piracy? (1 point)
A.the use of copyright in federal court
B.copying, downloading, reproducing, or distributing materials without permission
C.exercising your intellectual property rights
D.giving others permission to use your tangible property

Answers

Answer:

B

Explanation:

Classroom content transaction
examples use of IT

Answers

Answer:

1. Online classes

2. Presentation

3. Account of books

What happens when a user clicks the question mark at the top of the Backstage view?
O It shifts the view to the main window.
It makes the Tell Me text box appear.
O It opens the PowerPoint Help interface.
O It opens the Microsoft Help website online.

Answers

Answer:

D

Explanation:

Access to recent opened files, information about the permissions, sharing, and versions of the open file, the ability to create a new file, and printing are all available from the backstage view. Along with other details (properties), the Backstage View offers the following about the file. .file size Thus, option D is correct.

What question mark at the top of the Backstage view?

You may save, open, print, and share your presentations in a number of ways using the backstage view. Click the File tab on the Ribbon to see Backstage view. When you select the Info option in the Backstage View, additional details about the file are also made available, including the following.

The Microsoft Office Backstage view appears when a Microsoft Office program is launched or when you click the File tab. Backstage is where you should go if you need to make a new file, open an existing file, print, save, change options, or do anything else.

Therefore, It opens the Microsoft Help website online.

Learn more about Backstage view here:

https://brainly.com/question/27362542

#SPJ2

How do I delete the Chrome apps folder, because I tried to remove from chrome but it won't let me

Answers

Answer:

Explanation:

1. Open your Start menu by selecting the Windows logo in the taskbar and then click the “Settings” cog icon.

2. From the pop-up menu, click “Apps.”

3.Scroll down the “Apps & Features” list to find  g00gle chrome

4. Click “G00gle Chrome” and then select the “Uninstall” button.

Hope this help!

Helped by none other than the #Queen herself

Help FAST PLS in complete sentences discuss the process used to determine your credit score. Do you think it is fair? Why or why not? Make sure to use complete sentences.

Answers

Answer:

A fair credit score just means that the credit reference agencies think you're doing an okay job of managing your credit history. ... This means lenders could reject you for some of the best credit cards or loans

arrange the following devices pendrive , hard disk , compact disc in descending order of storage capacity​

Answers

Answer:hard disk compact disc

Explanation:

If we follow the guidelines for creating a good, strong password, should we ever be worried about our information being stolen?

Answers

No because people will still find a way to hack into it

no we should not unless you give your password away

9.4 Code Practice: Your task is to determine whether each item in the array above is divisible

by 3 or not. If an item is divisible by 3, then leave that value as-is in the

array, but if it is not divisible by 3, then replace that value in the array with a

o. Remember that you will need to use modular division from Unit 2 to

determine if a value is divisible by 3. Finally, print out the array in the

format as seen in the sample run below.

(Can someone please help me?)

Answers

Answer:

Explanation:

The following Python code is a function that takes in an array as a parameter, it then loops through the array determining if the element is divisible by 3. If it is it leaves it alone, otherwise it changes it to a 0. Then ouputs the array. A test case is shown in the attached image below using a sample array.

def divisible_by_three(array):

   for x in array:

       if x % 3 == 0:

           pass

       else:

           array[array.index(x)] = 0

   return array

In this exercise we have to use the knowledge of computational language in python to describe the code, like this:

We can find the code in the attached image.

What is an array for?

After wondering what an array is, you might wonder what it's for. The main purpose is to store information in an orderly way, that is, for each line, one piece of information. An example of an array is when storing names of people present in a classroom.

The code can be written more simply as:

def divisible_by_three(array):

  for x in array:

      if x % 3 == 0:

          pass

      else:

          array[array.index(x)] = 0

  return array

See more about python at brainly.com/question/26104476

write a program that asks length,breadth and height of a room and calculate its volume​

Answers

Answer:

cls

Input"enter length";l

Input"enter breadth";b

Input"enter height";h

v=l*b*h

print"the volume is";v

end

Explanation:

hope you got it

The limitations placed on employees in accordance with the company's policies and procedures

Conflict Management

regulatory control

Autocratic Leadership

Copyright

Answers

Answer:

Answer is B!

Explanation:

I just took the quiz (:

The limitations placed on employees in accordance with the company's policies and procedures regulatory control. Thus, option B is correct.

Who is an employee?

An employer is an individual that hires employees to do their tasks and responsibilities, whereas an employer is a worker for a firm and receives a wage.

If processes are not followed, employees may file claims for wrongful discharge or intentional dismissal with the Court. this helped the company to make sure that they run in a smooth manner. As these rules are set to mark the company in a progressive manner.

A company policy is a set of guidelines and rules that employers can use to formalise their requirements and standards for the health and safety of employees, transparency, best practices, and internal business procedures.

Therefore, option B is the correct option.

Learn more about employee, here:

https://brainly.com/question/18633637

#SPJ6

the field names in a database are also known as__?

Answers

Answer:Here are some common database field types, which are called different names in accordance with the specific database design:

Text, Alphanumeric, Character, String

Byte

Short, Integer

Long, Integer

Single, Real

maybe more

Explanation:

Answer:

Column

Explanation:

I..d...k I’m not 100% sure

Click this link to view O*NET's Work Activities section for Actors. Note that common activities are listed toward the top, and less common activities are listed toward the bottom. According to O*NET, what are common work activities performed by Actors? Check all that apply. repairing and maintaining electronic equipment performing administrative activities thinking creatively controlling machines and processes performing for or working directly with the public establishing and maintaining interpersonal relationships​

Answers

Based on  O*NET, the common work activities performed by Actors are:

Scheduling work and activities. Getting information. Making decisions and solving problems. Coordinating the work and activities of others.

What is activity in the workplace?

An activity in the workplace is one that connote the way to promote strong work relationships and boast morale.

Note that Getting all actors to be involved in a team workplace activity is one that help develop a kind of personal bonds and also enhance the professional relationship of all actors.

Learn more about  Work Activities from

https://brainly.com/question/25530656

What are the parts of word?

Answers

Answer:

Explanation:

ASIA includes 50 countries, and it is the most populated continent, the 60% of the total population of the Earth live here.

AFRICA comprises 54 countries. It is the hottest continent and home of the world's largest desert, the Sahara, occupying the 25% of the total area of Africa.

NORTH AMERICA includes 23 countries led by the USA as the largest economy in the world.

SOUTH AMERICA comprises 12 countries. Here is located the largest forest, the Amazon rainforest, which covers 30% of the South America total area.

ANTARCTICA is the coldest continent in the world, completely covered with ice. There are no permanent inhabitants, except of scientists maintaining research stations in Antarctica.

EUROPE comprises 51 countries. It is the most developed economically continent with the European Union as the biggest economic and political union in the world.

AUSTRALIA includes 14 countries. It is the least populated continent after Antarctica, only 0.2% of the total Earth population live here.

Write an algorithm and corresponding flowchart for a program that prints multiple of 5 starting with 100 and ending with 180.

Answers

Answer:

The pseudocode is as follows:

1. Start

2. total = 0

3. for i = 100 to 180 step 5

3.1    total = total + i

4. print total

5. Stop

Explanation:

This begins the algorithm

1. Start

This initializes the total to 0

2. total = 0

This iterates from 100 to 180 with an increment of 5

3. for i = 100 to 180 step 5

This adds up all multiples of 5 within the above range

3.1    total = total + i

This prints the calculates total

4. print total

This ends the algorithm

5. Stop

See attachment for flowchart

Other Questions
Who made the starry night? True or false?When multiplying fractions, you flip the second fraction to solve. True - Keep the first fraction the same then flip to solve the MULTIPLICATION problemTrue - Only when the second number is a whole numberFalse - Only when the second number is a whole numberFalse - You ONLY flip the second fraction when you have a FRACTION DIVISION problem. Keep, change, flip. Which of the following statements is true?Group of answer choicesA.Only products made from plastic damage the environmentB.Products mostly of metal do the most damage to the environmentC.All products have some effect on the environmentD.Reducing the enciroment impact of products can be both dangerous and frustrating for users Help pls and no links 1. Imagine you played the game, and the results are as follows. Examine the tables below and questions (a) and (b) Sample Data for Stable Food Scenario for EAST SIDE (Wet). Season Large (AA) Medium (Aa) Small (aa) 1 2 2 2 2 3 2 2 3 4 4 4 4 5 5 6 Sample Data for Stable Food Scenario for WEST SIDE (Dry). Season Large (AA) Medium (Aa) Small (aa) 1 2 2 2 2 2 2 2 3 3 2 2 4 4 2 2 A) Describe what happens to the bird population for both the East and West sides of the Islands in terms of its composition of different size beaks when the food source is stable over several seasons. B) Are the initial populations maintained, explain?2. Imagine you played the game again, but under different conditions. Examine the tables below, and answers (a), (b), and (c).Sample Data for Natural Selection Scenario for EAST SIDE (Wet). Season Large (AA) Medium (Aa) Small (aa) 1 2 2 2 2 3 3 3 3 4 3 2 4 8 5 0 Sample Data for Natural Selection Scenario for WEST SIDE (Dry). Season Large (AA) Medium (Aa) Small (aa) 1 2 2 2 2 2 2 2 3 2 2 2 4 2 0 3 A) What happened to the composition of the original population over these four seasons for the East and the West? B) What factor(s) might have caused these changes? C) How was natural selection acting on this population? geometry question pls help!!!Find measure of angle BPDA-9 degrees B- 14 degrees C- 155 degrees D- 146 degrees How might doing math slowly help with problems that are difficult to understand or hard to solve? PLEASE PLEASE PLEASE HELP, AND SHOW WORK!!!! LOOK AT ATTACHMENT. How is quoting a source different from paraphrasing it? The Federal Reserve wants to change the nominal interest rate from 7% to 5%. What actionmust the Federal Reserve take?A) The Fed needs to increase the quantity of money by $0.4 trillion.B) The Fed needs to decrease the quantity of money by $0.4 trillion.C The Fed needs to decrease the quantity of money by $1.3 trillion.D) The Fed needs to increase the quantity of money by $1.3 trillion. Suppose the family wise error rate is 0.05, if there are ten levels of one factor but only 5 comparisons are of importance, what would the individual error rate need to be for each of those 5 comparisons? Group of answer choices 5 0.01 .05 0.10 Write a sentence in Spanish expressing that you have a headache. hi i know im crazy but can someone please do me a favor and write my essay for me if so ill give you my email and we can talk about it from there Riley found a source to learn more about human immunodeficiency virus (HIV)."HIV/AIDS Basics Prevention. Centers for Disease Control & Prevention,https://www.cdc.gov/hiv/basics/prevention.html. Accessed 6 Jan. 2017.What most likely made Riley feel confident about this source?It came from a government site.It came from a health magazine site.It came from a social media website.It came from a popular blogging site. A study of 420,027 cell phone users found that 133 of them developed cancer of the brain or nervous system. Prior to this study of cell phone use, the rate of such cancer was found to be 0.0414% for those not using cell phones. Complete parts (a) and (b). a. Use the sample data to construct a 90% confidence interval estimate of the percentage of cell phone users who develop cancer of the brain or nervous system. 1- Ernesto: "Necesitan llevar sus pasaportes al aeropuerto?" Carmen: "No, no ___ necesitamos llevar ahora."lolalaslos2-Por qu no ______ estadio t para ver el partido?ir a;vas alvas a elvas a la 3- It's 12:55 PM.Son las doce menos cinco de la tarde.Es la una menos cinco de la tarde.Son las doce y cincuenta de la tarde.Es las una menos quince de la tarde.4-___ de Atlanta es grande. la pasla ciudadel pasel ciudad Which of the following sentences demonstrates active voice?O 1. Lorena was shown a detailed map of the area.2. The map of the area was located immediately.O 3. Lorena located her map of the area immediately.4. The map was published by the Forest Service. Calculate6x20 divided by3Give your answer in the form ab where a and b are integers, and b is as small aspossible. what is the value of 7|H| + 4G? When an object is already in motion, why is energy required to stop it