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
8_murik_8 [283]
4 years ago
14

When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be

done by normalizing to values between 0 and 1, or throwing away outliers. Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integers that follow. Then, adjust each integer in the list by subtracting the smallest value from all the integers.
Computers and Technology
1 answer:
pshichka [43]4 years ago
7 0

Answer:

import java.util.Scanner;

public class Normalization {

public static void main(String[] args) {

                //Create an object of the Scanner class to allow for user's inputs

 Scanner input = new Scanner(System.in);

 // 1. Create a prompt for the user to enter the list of integers

 System.out.println("Enter the list of integers separated by space : ");

 // 2. Get the first integer being input by user and store in an

 // integer  variable, fnumber. The first integer determines the  

               //length of the list

 int fnumber = input.nextInt();

 // 3. Create an array of integers to hold the other elements in the  

 // list. The array has a size denoted by the first number (stored in

               // fnumber) in the user's input.

 int[] list = new int[fnumber];

 // 4. Create a while loop to populate the array with the rest of the  

               // user's  input.

 int j = 0;

 while (j < fnumber) {

  list[j] = input.nextInt();

  j++;

 }

 // 5. Create another loop to print out the elements in the list.

 // This is an optional step. This is just to check the elements in the

 // list  before normalization.

 System.out.println("List before normalization");

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

  System.out.print(list[i] + " ");

 }

 // Print a new line after printing the list. This is just for formatting

 // purpose.

 System.out.println();

 // 6. Find the smallest element in the list.

 // First get the first element in the list and store it in a variable

 // called  smallest. This is to tentatively assume that the first

 // element in the list is  the smallest

.

 int smallest = list[0];

 // Loop through the list to check if there is any element smaller

 // than the  assumed element.

 // If there is, replace the assumed element with such.

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

  if (list[i] < smallest) {

   smallest = list[i];

  }

 }

 // 7. Print out the smallest element. This is an optional step. This is

 // just to  be double check if the program actually got the smallest

              // number in the list

 System.out.println("Smallest element : " + smallest);

 // 8. Loop through the list once again.

 // At every cycle, deduct the smallest number, gotten above, from

 // each list  element.

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

  list[i] = list[i] - smallest;

 }

 // 9. Print out the resulting elements in the list

 System.out.println("List after normalization");

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

  System.out.print(list[i] + " ");

 }

}

}

Explanation:

The source code file for this program has also been attached to this response. Kindly download it and go through the comments in the code to get a better understanding of the code. The comments explain every segment of the code. Using comments is a better way of explaining every line of the code.

Hope this helps!

Download java
You might be interested in
Create a set of functions that compute the mean, median, and mode of a set of
zepelin [54]

Refer to the attachment.

Language used=Python

5 0
3 years ago
Read 2 more answers
Which language paradigm interacts well with database systems in business environments that use SQL?
HACTEHA [7]
The answer is C, can you mark me brain
6 0
3 years ago
A business wants to centralize its administrative tasks. At the same time, it wants the existing systems to manage and sustain t
qwelly [4]

Answer:

real-time analytics

Explanation:

Real time analytics is a type of data analysis that is done immediately the data for analysis is available. This can allow users to draw conclusion or acquire new insights swiftly and immediately the data enters their system. Businesses use real time analytics when there is a need to make and execute new decisions without hesitation.

A business that wants to centralize its administrative tasks and simultaneously wants the existing system to manage and sustain the growing amount of work in a capable manner would use real-time analytics.

7 0
4 years ago
A Python function cannot under normal circumstances reference a module variable for its value.
marishachu [46]
This is false because
6 0
3 years ago
Read 2 more answers
100 POINTS!!! PLEASE HELP ME
Ronch [10]

Answer:

1 web

2- invintory

3- spreadsheet

4-survey

Explanation:

hope it helps

5 0
2 years ago
Read 2 more answers
Other questions:
  • Which Of The Following Is A College Major For Which IT Courses Would Most Likely Be Required?
    9·1 answer
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • Your traffic light changes to yellow as you approach an intersection. In most cases, what action should you take?
    15·2 answers
  • A _________________ operating system accepts random enquires from remote locations and provides an instantaneous response
    5·1 answer
  • You would like to narrow your search on this topic.
    15·2 answers
  • L00000000000000000000000000000000000000000000000000000000l they b00ty tickled
    6·2 answers
  • If you are running a server , which of the follow operating system would be best suited ?window 10 or macOS
    8·1 answer
  • When all the system testing and bugs correction has done, the software product will be delivered to the user for __________.
    15·1 answer
  • Explain the three schemes via which the binding of instructions and data to memory addresses can be done. In each scheme, how th
    13·1 answer
  • Snippet 1: check_file_permissions.c #include
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!