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
Sort short_names in reverse alphabetic order.
tangare [24]

lst = short_names.split()

print(sorted(lst,reverse = True))

6 0
3 years ago
Write a method that takes a RegularPolygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclus
Sergio [31]

Answer:

import java.lang.Object

import java.lang.Math

public class RegularPolygon  extends java.lang.Object{

  public void randomize(RegularPolygon c){

       int min = 10, max1 = 20;

       double  min1 = 5, max1 = 12;

       double range = (max - min) + 1;

       double range1 = (max1 -min1) + 1

       int side = (Math.random() * range) + min;

       double len = (Math.random() * range1) + min1;

       c.setNumSides(side);

       c.setSideLength( len);

 }

 public static void main(String[] args) {

    RegularPolygon r = new RegularPloygon();

    randomize(r);

 }

}

Explanation:

The randomize method accepts a regular polygon class as its only parameter and assigns a random number of sides and the length of these sides with the 'Math.random' function.

5 0
3 years ago
Tumblr, Jaiku is an example of _____________ website.
adelina 88 [10]

Answer:

<h3><u>Microblogging </u></h3>

  • <u>One of the best-known channels in the microblogging world. Twitter is a quick and convenient way to share short posts, GIFs, article links, videos and more. Pinterest: Companies on Pinterest link to products, articles and other useful information for </u><u>audiences </u><u>.</u>

Explanation:

<h2>Hope this helps you !! </h2>
3 0
2 years ago
____________________ is like a set of instructions that helps hardware process data into information.
Arte-miy333 [17]

Answer:

Program

Explanation:

Program is like a set of instructions that helps hardware process data into information.

Every hardware needs a program to process data into information.

For example take the example of a data processing software like MS Excel.

You open a spreadsheet and enter some data into your sheet. and then ask the program to do some calculations with this data and give you output results. The spreadsheet software does this processing in the background for you and provides you the results.

Without program a hardware doesn't know what to do with the data. Therefore, a program is like a instruction set that guides the hardware what to do with the data.

Note: The terms software and program are usually used together but there is a difference between software and program

A software is a generalized term and program is more like a specific term.

software can be made up of several different programs which performs many different tasks. On the other hand, a program only carry out a specific task or set of instructions.

3 0
4 years ago
Help please and thank you :)
Fynjy0 [20]
Answer:First one net is the answer ........
5 0
3 years ago
Other questions:
  • You accidentally find someone's password and use it to get into a system. this is hacking.
    15·1 answer
  • If you see ##### in a cell, you should
    10·1 answer
  • Describe how to manipulate artwork in a presentation.
    13·1 answer
  • Why is it important to protect people's intellectual property online?
    10·1 answer
  • What does my name look like in binary code, btw my mane is Wendy Alexis Morales
    10·2 answers
  • Why would you use quotation marks in a search string when conducting an internet search?
    12·1 answer
  • How to bypass a Lightspeed and Rocket Filter blocked website without being a admin and without downloading extensions? Must incl
    15·1 answer
  • Counselors do NOT provide which service during treatment?
    12·2 answers
  • Create a program that simulates a race between several vehicles. Design and implement an inheritance hierarchy that includes Veh
    11·1 answer
  • How do I do this??? (Im in 9th)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!