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
AlekseyPX
4 years ago
12

Write a program that creates an array called temperatures and then add five temperatures input from the keyboard. Then, print th

e array.
Sample Run
Enter a temperature: 45
Enter a temperature: 67
Enter a temperature: 89
Enter a temperature: 47
Enter a temperature: 89
[45, 67, 89, 47, 89]
Computers and Technology
2 answers:
levacccp [35]4 years ago
8 0

Answer:

x=[]

i=0

for i in range(0,5):

   x.append(input("Enter the temperature"))

print(x)

   

Explanation:

The above is the required program in python. Here, we have used a list and added to it five temperatures, and then printed it out, as mentioned. Its the plus point of python, that we are not required to give the dimensions of the list. Not all programming languages provide this facility. Remember in Java we are required to make use of the ArrayList and not array fo dynamic output.

Vesnalui [34]4 years ago
4 0

Answer:

temperatures = []

number1 = int(input("Enter a temperature: "))

number2 = int(input("Enter a temperature: "))

number3 = int(input("Enter a temperature: "))

number4 = int(input("Enter a temperature: "))

number5 = int(input("Enter a temperature: "))

temperatures.append(number1)

temperatures.append(number2)

temperatures.append(number3)

temperatures.append(number4)

temperatures.append(number5)

print ("Enter a temperature: " + str(number1))

print ("Enter a temperature: " + str(number2))

print ("Enter a temperature: " + str(number3))

print ("Enter a temperature: " + str(number4))

print ("Enter a temperature: " + str(number5))

print (temperatures)

Explanation:

You might be interested in
How should students approach the decision to take the SAT or the ACT?
Vikentia [17]

Answer:

I believe that the only way to really make an informed decision as to which test is a better fit for you is to take a full-length diagnostic exam for both the ACT and the SAT before doing any prep. I also would look at the pros and cons for each test.

I personally took the ACT because there is <em>NO PENALTY </em>for guessing on the test. An educated guess won't hurt your score on the ACT.

6 0
3 years ago
A group of developers for a startup company store their source code and binary files on a shared open-source repository platform
Jet001 [13]

Answer: AWS CodeCommit

Explanation:

The AWS service that the developers can use to meet the requirements that are illustrated in the question is the AWS CodeCommit.

The AWS CodeCommit is refered to as a fully-managed source control service which can be used in the hosting of Git-based repositories which are secure.

AWS CodeCommit makes it easy for the collaboration on code for teams in a secure ecosystem. CodeCommit can securely store binaries, source code etc.

8 0
3 years ago
Complete the following method named replaceEvens that receives the parameter numbers which is an array of integers. The method m
Taya2010 [7]

Answer:

Following are the method definition to this question:

public class Neg //defining class Neg

{  

public static void replaceEvens(int[] numbers) //defining a method replaceEvens that accepts array

{

int i; //defining integer variable

for(i = 0 ; i < numbers.length; i++) //defining foop to counts number

{

if(numbers[i]%2 == 0) //defining condition to check number is even  

{

numbers[i] = numbers[i] * -1; //multiply the number by -1

}

}

for(i = 0 ; i < numbers.length; i++) // defining loop print array

{

System.out.print(numbers[i] + " "); //print array

}

}    

public static void main(String[] as)//defining main method  

{

   int[] numbers = {12, 10, 18, 5, 2,22}; //defining array numbers and assign value

   System.out.println("Elements of array: "); //print message

   for(int i = 0 ; i < numbers.length ; i++)  //defining loop to print message

   {

   System.out.print(numbers[i] + " "); //print array

   }

  System.out.println("\n After replaceEvens"); //print message

   replaceEvens(numbers); //calling method replaceEvens

  }

}

Output:

please find the attachment.

Explanation:

  • In the given program a static method replaceEvens is declared, in which array numbers pass as the parameter, inside the for method loop is declared, which counts array number in this loop if block is defined, that check-in array there is an even number.
  • In the condition is true it will multiply the number by -1, and output side the loop it will define another loop to print its value.
  • Inside the main method, a number array is declared, that first prints its value then call the method to print its change value.    

3 0
3 years ago
A picture drawn in 3 d is called?​
Varvara68 [4.7K]

Answer:

autostereogram

Explanation:

that^

6 0
3 years ago
Read 2 more answers
Tablets combine the features of which two types of devices?
VikaD [51]
A tablet<span> is a wireless, portable personal computer with a touchscreen interface. The </span>tablet<span> form factor is typically smaller than a notebook computer, but larger than a smartphone.
</span>
5 0
3 years ago
Other questions:
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    5·1 answer
  • Is the cell phone changing our views about polite and impolite behavior? For example,
    15·2 answers
  • A 10-foot ladder must make an angle of 30° with the ground if it is to reach a certain window. What angle must a 20-foot ladder
    9·2 answers
  • How is a ink pen better than a digital pen.
    8·1 answer
  • A Silicon Valley billionaire purchases 3 new cars for his collection at the end of every month. Let a_n denote the number of car
    8·1 answer
  • A(n) _______________ is a collection of configuration and security settings that an administrator has created in order to apply
    14·1 answer
  • Sierra owns a small business and handles many responsibilities, from logistics to marketing. She's seen a lot of success with Go
    11·1 answer
  • What is social media ​
    13·2 answers
  • Ten examples of an interpreter
    8·1 answer
  • - A blacksmith is shoeing a miser's horse. The blacksmith charges ten dollars for his work. The miser refuses to pay. "Very well
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!