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
Vsevolod [243]
3 years ago
8

Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18

, 20}.
import java.util.Scanner;
public class StudentScores {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
final int NUM_Points = 4;
int[] dataPoints = new int[NUM_POINTS];
int minValue;
int i;
minValue = scnr.nextInt();
for (i = 0; i < dataPoints.length; ++i) {
dataPoints[i] = scnr.nextInt();
}
/* Your solution goes here */
for (i = 0; i < dataPoints.length; ++i) {
System.out.print(dataPoints[i] + " ");
}
System.out.println();
}
}
Computers and Technology
1 answer:
murzikaleks [220]3 years ago
3 0

Answer:

Following are the code to this question:

for(i=0;i<dataPoints.length;++i) //define loop to count array element  

{

if(dataPoints[i]<minValue) // define condition that checks array element is less then minValue

{

dataPoints[i] = dataPoints[i]*2; //double the value

}

}

Explanation:

Description of the code as follows:

  • In the given code, a for loop is declared, that uses a variable "i", which counts all array element, that is input by the user.
  • Inside the loop and if block statement is used, that check array element value is less then "minValue", if this condition is true.  
  • So, inside the loop, we multiply the value by 2.
You might be interested in
QUICK HELP ME PLEASE
Sholpan [36]

Answer: Cable Internet access requires the setting up of fiber cables. It is the fastest type of Internet access technology. that's the answer

4 0
3 years ago
Gross Domestic Product (GDP) is the economic report card for any country. What is the report card measuring?
GalinKa [24]
The answer is production.



6 0
4 years ago
If I wanted to repeat an action such as a heading for a paper, it would be helpful to _____. create a citation create a caption
salantis [7]
Um... Copy and paste
7 0
4 years ago
Read 2 more answers
What software sent bill gates on his way to becoming one of the richest men in the world?
just olya [345]
The software that launched Bill Gates to riches is Microsoft. The software company became available for public purchase of shares in 1986. The company was however launched in 1975 by himself and the co-founder Paul Allen. The company was instrumental in the launch of the personal computer revolution. 
5 0
4 years ago
The sender side of rdt3.0 simply ignores (that is, takes no action on) all received packets that are either in error or have the
Rom4ik [11]

Answer:

It might not work efficiently.

Explanation:

The function of the protocol rtd3.0 is to transfer data to a receiver from a sender.

As soon as the receiver received the packet transferred by the sender, we respond acknowledge (Ack) to the sender so that sender can confirm the receiver has gotten it.  

The receiver will not send any acknowledgment if the packet he receives are such that bits contain error or not in order.

After that timeout, the packet will be re-transmitted by the sender.

It is then possible the protocol might seem to be inefficient if a packet is sent many times, because other packets will have to wait to sent until the current packet is sent successfully.

The solution to prevent this kind of issue is to allow for the occurrence of premature timeouts.

7 0
3 years ago
Other questions:
  • A _______ file is a type of vector graphics file created specifically for Windows.
    13·2 answers
  • What is the name of the keyboard developed in the 1930s?
    13·1 answer
  • "You are setting up a new subnetwork on an existing network. Management has asked that you use existing cabling that the company
    14·1 answer
  • Which of the following information is most important to include in a timeline
    14·2 answers
  • If you have two pennies, the probability of both coming up heads when flipped
    13·2 answers
  • In order to view the permissions assigned to each type of user for all the files located in a directory, which of the following
    12·1 answer
  • Write code that prints: Ready! numVal ... 2 1 Go! Your code should contain a for loop. Print a newline after each number and aft
    14·1 answer
  • Computer hardware refers to: Group of answer choices the mechanism through which users interact with a computer. handheld comput
    13·1 answer
  • How exactly do you find the circumference by using C++ Programming? I really need a specific answer.
    14·1 answer
  • What is professional education? <br><br><br><br><br>Please help me to do this.​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!