1. Atestharnessprogramfortestingsortingmethodsisprovidedwiththeprogram iles.ItisintheileSorts.javainthech11.sortspackage.Theprogramincludes aswapmethodthatisusedbyallofthesortingmethodstoswaparrayelements. a. Describeanapproachtomodifyingtheprogramsothataftercallingasorting methodtheprogramprintsoutthenumberofswapsneededbythesorting method. b. Implementyourapproach. c. TestyournewprogrambyrunningtheselectionSortmethod.Yourprogram shouldreport49swaps.

Answers

Answer 1

Answer:

Following are the code to this question:

//import package

import java.util.*;

import java.text.*;

public class Main//defining a class

{

static final int t = 50;//defining an integer constant variable

static int[] ele = new int[t];//defining an array

static int tS = 0;//defining integer variable

static void initelements()//defining a static method

{

Random r= new Random();//creating Random class Object

for (int i = 0; i < t; i++)//use loop to add value in array

ele[i] = Math.abs(r.nextInt()) % 100;//add value in array

}

static public boolean isSorted()//defining a method isSorted

{

boolean x = true;//defining boolean variable

for (int i = 0; i < (t - 1); i++)//use for loop to count array values

if (ele[i] > ele[i + 1])//use if to compare array values

x = false;//use boolean variable to hold false value

return x;//return boolean value

}

static public void swap(int x1, int x2)//defining swap method

{

tS++;//increment variable value by 1

//performing swapping

int te = ele[x1];//defining te variable that holds array values

ele[x1] = ele[x2];//exchanging array values

ele[x2] = te;//holding te values

}

static public void disp()//defining a method disp

{

int v1;

DecimalFormat f = new DecimalFormat("00");//creating DecimalFormat class Object

System.out.println("The elements array is:");//print message

for (int i = 0; i <t; i++)//defining for loop  

{

v1 = ele[i];//holding array value in v1 variable

if (((i + 1) % 10) == 0)//use if to check i value

System.out.println(f.format(v1));//print value

else//else block

System.out.print(f.format(v1) + " ");//print value

}

System.out.println();//print space

}

static int getMinimum(int st, int en)//defining a method getMinimum

{

int iMi = st;//defining variable that holds parameter value

for (int i = st + 1; i <= en; i++)//use for loop compare array value

if (ele[i] < ele[iMi])//compare array value

iMi = i;//use iMi to hold loop value

return iMi;//return iMi value

}

static void selectionSort()//defining a selectionSort method

{

int e = t - 1;//defining e variable that holds total array count value

for (int i = 0; i < e; i++)//use for loop to call swap method  

swap(i, getMinimum(i, e));//calling the swap method

}

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

{

initelements();//calling initelements method

disp();//calling disp method

System.out.println("elements is sorted: " + isSorted());//calling is isSorted method with the message

System.out.println();//for space

selectionSort();//calling selectionSort method

System.out.println("No of swaps :" + tS);//print totalswap value with the message

disp();//calling disp method

System.out.println("elements is sorted: " + isSorted());//calling is isSorted method with the message

System.out.println();//for space

}

}

Output:

Please find the attached file.

Explanation:

In this code inside the Main class, 5 static methods "initelements, isSorted, swap, disp, getMinimum and selectionSort" is declared, in which the first method holds random values in arrays, in second array it sorts its values, in the third method it swap the array, in the disp method it shows array values.

In the "getMinimum and selectionSort"  it sorts array values and inside the main method, it calls all methods and prints their values.

1. Atestharnessprogramfortestingsortingmethodsisprovidedwiththeprogram Iles.ItisintheileSorts.javainthech11.sortspackage.Theprogramincludes

Related Questions

Scanning devices translate information processed by the system unit and present the information
on paper

Answers

Answer:

True

Explanation:

It is TRUE that Scanning devices translate information processed by the system unit and present the information on paper.

This is because the scanning device otherwise referred to as a scanner uses Optical Character Recognition software to capture the scanned document which is then processed into files accessible by predefined application, such as image viewer

top secret mission lolz

Answers

Answer:

whats the mission about??

Explanation:

~evita

Type the correct answer in the box. Spell all words correctly.
Alan maintains the efficiency of a printing plant by supervising plant operations and implementing safety procedures. What does he work as?
Alan is working as a _____________.

Answers

Answer:

Alan is a Maintenance Supervisor.

Explanation:

Answer:

printing plant manager

Explanation:

A computer is set up to copy DVDs overnight and have them ready the next morning when employees come into work. This would be an example of _____.

buffering
link-loading
multitasking
batch processing

Answers

Answer:

batch procressing

Explanation:

This is when something is scheduled to be done.

In this example, the computer is scheduled to copy DVD's and have them ready the next morning.

n
How does an informal outline usually organize information?
A. With letters
B. With bullet points
C. With numbers
D. With Roman numerals

Answers

The answer is (B. With bullet points) have a good day :)

PLEASE ANSWER ALL QUESTIONS CORRECTLY FOR 50 POINTS AND A BRAINLIEST!!!! IT ALSO INCLUDES ENGLISH, PLEASE KEEP IN MIND THIS IS ALSO IMPORTANT JUST AS THE OTHERS (NO SPAMMING OR LINKS)

Which stage of the problem-solving process involves identifying the inputs, process, and output for each solution? *

Definition of the problem
Develop the algorithm
Propose and evaluate possible solutions
Determine the most efficient solution.

Software used for professional print publications such as posters, books, and email newsletters is called a: *

Professional software
Word processing software
Desktop program
Desktop publishing software

Which of the following criteria does NOT determine the credibility of a source? *

How current the information is
The reputation the publisher
The article covers (speaks about) the topic being researched
The gender of the author

The process of finding a solution to a difficult or complex issue to make it easier is known as *

problem
problem-solving
input

A series of actions taken in order to solve a particular problem is known as the____________ *

process
problem
input
output

A finite set of unambiguous (no uncertainty, clear) instructions that can be performed in a prescribed sequence to achieve a certain goal is called a/an *

problem
output
algorithm
input

Which is the third step in the problem-solving process? *

Propose possible solutions
Test and evaluate the solution
Select the most effective solution
Defining the problem

A list of sources you used when writing a scholarly article on a specific subject is known as a: *

intellectual-property
credibility
bibliography
trademark

Which of the following are you able to create with the use of desktop publishing software? *
1 point
E-Book
Banner
All of the above
Newsletter

Which of the following is NOT a writing style format for academic purposes? *

Times New Roman
American Psychological Association
Modern Language Association

The right by an individual to protect his/her literary work such as poems, songs, and drawing is known as *

plagiarism
copyright
industrial property
trademark
Through the use of technology we can easily: *

SELECT ALL THAT APPLY. HINT: ONLY TWO OF THE 4 ARE CORRECT.

say more traditional jobs being available
agree that there are fewer emerging jobs
sell goods and services as we’ve never been able to
produce more jobs which will create growth and development in the country.

Answers

Answer:

finding a suitable solution for issue can be accomplished by following the basic four-step problem solving process and methodology outlined.

PLEASE HELP WILL GIVE BRAINLIEST

Answers

Answer:

Explanation: answer is b) the row comes first  in the  element of an index

Software is:

A. storage-related information technology.

B. programs that help hardware accomplish tasks.

C. the opposite of firmware.

D. all of the above.

Answers

I think the answer is A

High-level programming languages are (5 points)
O a
closer to human languages
Ob
less time consuming to run
ос
much more in control over the hardware
Od
similar to native machine code

Answers

The answer is A. Closer to human languages

The Quick Access Toolbar is typically
located in the top-right corner of the
window, above the ribbon.
True
False

Answers

Answer:

False

Explanation:

It is on the left

it is false hey a so it’s a

Mecanismo que permite conocer si la persona que esta ingresando a un sistema es realmente quien deba y no un intruso

Answers

Answer:

Sistemas de autenticación y seguridad de la información.

Explicación:

La seguridad de la información es un mecanismo que permite saber si la persona que está ingresando a un sistema es realmente quien debería y no un intruso. La seguridad de la información básicamente ayuda a prevenir el acceso no autorizado y permite que la única persona autorizada ingrese al sistema. Los sistemas de autenticación son el mecanismo de seguridad que se utiliza para proteger los datos y los sistemas. Estos sistemas de autenticación también ayudan a garantizar que los usuarios sean la persona autorizada o no.

Which of the following is a programming language that translates code one line at a time? (5 points)
a
C:
b
Java
с
Machine
d
Python

Answers

Answer:

Python!

Its the only programming language that is an interpreted language

Hope it helped <3

Briefly explain the main difference between how to connect a new office computer in the SHSS office to the internet and how to connect a standalone computer in your house to the internet

Answers

Answer:

Once you've set up your computer, you may want to purchase home Internet access, up a home wireless network, commonly known as Wi-Fi, so you can connect multiple. Now that you know about the different types of Internet service, you can do. The primary piece of hardware you need is a modem.

The first step to keeping your home safe is to minimize the overall amount of _______________ materials you store in your home. (9 letters)

Answers

Answer: Hazardous

Explanation: Hazardous materials should be kept somewhere safe.

Answer:

i believe it would be dangerious

Explanation:

In which phase of website design does the designer create a mock-up aimed at the target user? A. learning B. planning C. design D. development E. testing and delivering

Answers

Answer:

C. design

Explanation:

HTML is an acronym for hypertext markup language and it is a standard programming language which is used for designing, developing and creating web pages.

Generally, all HTML documents are divided into two (2) main parts; body and head. The head contains information such as version of HTML, title of a page, metadata, link to custom favicons and CSS etc. The body of the HTML document contains the contents or informations that a web page displays.

In the design phase of a website design, the website designer create a mock-up aimed at the target user. A mock-up is a graphical representation or illustration of a graphic design and as such isn't responsive.

This ultimately implies that, a mock-up or model can be used by a website designer to illustrate or show the target user the look and feel of a website, so as to help these users have a better understanding of the specific elements and structure associated with it.

What is one difference between low- and high-level programming languages? (5 points)
O a
Ob
Low-level programming languages are challenging for humans to read, while high-level programming languages are easier.
Low-level programming languages are more human-friendly, while high-level programming languages are more challenging for
humans to understand.
Ос
Low-level programming languages require interpreters and compilers, while high-level programming languages do not.
Od
Low-level programming languages use program code to communicate with computers, while high-level programming languages
use machine code.

Answers

Answer: Low-level programming languages are computer code at its most basic. They are difficult or sometimes impossible for humans to read, while high-level languages are designed to be easy for humans to understand. I believe the answer is A.

Answer:

Low-level programming languages require interpreters and compilers, while high-level programming languages do not.

Explanation: I AM SURE IT IS CORRECT 100% CORRECT

Drag the tiles to the correct boxes to compete the pairs. Identify the types of chemical reactions occurring in the chemical equations.

Answers

The question is incomplete. The complete question is :

Drag the tiles to the correct boxes to compete the pairs. Identify the types of chemical reactions occurring in the chemical equations.

combustion reaction , photosynthesis , respiration

water + carbon dioxide + sunlight → oxygen + glucose

methane + oxygen → water + carbon dioxide + heat

glucose + oxygen → carbon dioxide + water + energy

Solution :

The chemical reactions that is occurring in the following chemical equations are :

Photosynthesis

water + carbon dioxide + sunlight → oxygen + glucose

Plants uses the light energy from the sun in the presence of water and carbon dioxide produces food by the process of photosynthesis. It produces glucose and oxygen.

Respiration

glucose + oxygen → carbon dioxide + water + energy

The cellular respiration process produces ATP with the breakdown of the glucose and oxygen. During respiration process, carbon dioxide is obtained along with water and energy.

Combustion reaction

methane + oxygen → water + carbon dioxide + heat

Combustion reaction is a chemical reaction in which methane is the main ingredient. Combustion takes place as things burn in the presence to methane and oxygen to form carbon dioxide, water and heat.

Graphics created within Illustrator CC are always vector graphics true or false

Answers

True we use illustrator to draw vectors and vectors only

why? they are infinitely  scalable

Hope this helps.

-scav

Complete the sentence with the correct response.

The central core of an operating system is called the .

Answers

Answer:

Kernel

Explanation:

The Kernel is the program that constitutes the central core of the operating system kernel is the first part of operating system to load into memory during booting kernel is made of various modules which can not be loaded in running operating system kernel remains in the memory during the entire computer session

Computer programmers must be fluent in every programming language. (5 points)
O True
O False

Answers

Answer:

False, its true that they need to know some programming languages but they do not need to be fluent in all of them.


what is the answer???​

Answers

Answer:

I think it should be C

Explanation:

A group of two or more computers that are link together.

Kim is creating a PowerPoint presentation about the life cycles of different organisms. Knowing that her file will include a number of images, technical terms, and scientific names, she decides to customize the ribbon to make her work more efficient. To do this, she must access the PowerPoint Options dialog box.

How should Kim begin this task?
by clicking the Home tab and selecting Editing
by clicking the File tab and selecting Options
by clicking the View tab and selecting Master Views
by clicking the Help tab and selecting Help & Support

Answers

Answer: Clicking on file tab and selecting options, if she has issues contact Help & Support.

Hope it helped!

Answer:

by clicking the File tab and selecting Options

Explanation:

the main work area of the computer is the

Answers

Answer:

Desktop

Explanation:

The desktop is the main work area of your computer, and will likely be the most visited area of your computer. Your desktop appears every time you log into your account, and contains icons and shortcuts to your most used programs and files.

QUESTION 9 / 10
What is the problem with paying only your minimum credit card balance each month?
A. It lowers your credit score
B. You have to pay interest
C. The bank will cancel your credit card
D. All of the above

Answers

Answer:

The answer is C. the bank will cancel your credit card.

Explanation:

100 points!! What should you click on to relocate broken link files?

A. search
B. Locate
C. Find
D. Browse

It’s not C

Answers

Answer:

im pretty sure its browse

Explanation:

Three types of common program errors are syntax, runtime, and logic. (5 points)
O True
O False

Answers

Answer:

True

Explanation:

True,My good sir/maam

To register your content with the US Copyright Office, visit copyright.gov to get started. Online
registration usually costs between _____ and _____, and you'll have to send a copy of your completed
work to the U.S. Copyright Office either through the mail or via its website. Once your work is
registered, it will be added to the Library of Congress.
$35 and $55
O $25 and $65
O $15 and $35
O $85 and $105

Answers

Answer:

$35 and $55

Explanation:

Online registration usually costs between $35 and $55 , and you'll have to send a copy of your completed work to the U.S. Copyright Office either through the mail or via its website. The correct option is 1.

What is Copyright?

Copyright is a legal concept that grants creators of original works, such as literary, artistic, musical, and other types of intellectual works, exclusive rights.

These rights give the creators the ability to control how their works are used, distributed, and reproduced, as well as receive monetary compensation for their use.

Depending on the type of work and the filing option selected, online registration with the United States Copyright Office typically costs between $35 and $55 for a single work.

It should be noted that these fees are subject to change, and that additional fees may apply for specific services such as expedited processing or special handling.

Thus, the correct option is 1.

For more details regarding copyright, visit:

https://brainly.com/question/22399852

#SPJ6

Your question seems incomplete, the probable complete question is:

To register your content with the US Copyright Office, visit copyright.gov to get started. Online

registration usually costs between _____ and _____, and you'll have to send a copy of your completed

work to the U.S. Copyright Office either through the mail or via its website. Once your work is

registered, it will be added to the Library of Congress.

$35 and $55$25 and $65$15 and $35$85 and $105

You are the network administrator for a city library. Throughout the library, there are several groups of computers that provide public access to the internet. Supervision of these computers has been difficult. You've had problems with patrons bringing personal laptops into the library and disconnecting the network cables from the library computers to connect their laptops to the internet. The library computers are in groups of four. Each group of four computers is connected to a hub that is connected to the library network through an access port on a switch. You want to restrict access to the network so only the library computers are permitted connectivity to the internet. What can you do to fix this problem

Answers

Answer: Configure port security on the switch

Explanation:

Since there need to be a restriction on access to the network so that the library computers will be the only ones that are allowed connectivity to the internet, the thing that can be done to fix the problem is to configure a port security on the switch.

When a port security is configured, it helps in securing the network and this will in the prevention of unknown devices from being connected to the network.

essence of radio program​

Answers

Answer:

Radio has the ability to reach across borders and can become a valuable source of information where reliable news is scarce. Radio has proved its worth in times of emergency such as when access to the mobile network is down as a result of an overload, or phone lines are cut.

Explanation:

Multitasking systems _____.

are easier to develop than single programming systems
execute each job faster
execute more jobs at the same time
are used only in large mainframe computers

Answers

Answer: Multitasking systems are able to execute multiple jobs at the same time, hence the name "multitasking systems".

Other Questions
Case #1 - An elderly man is found deceased in his apartment. His bodytemperature is 33.1C. Calculate TOD (Hours since death). *8 poir10 hours5 hours22 hoursO 17 hours how would uranus not be classified as a dwarf planet and what i mean by that is there anything that could happen that would just make it a dwarf planet Please Help...Why is it important for people to know about Reconstruction?A short response Pablo wants to enter the science fair. Which question could be answered through scientific investigation? Determine the volume of the product containing carbon produced when 15.0 g of C2H2 are reacted with an excess of oxygen gas For those fluent in Spanish Answer number 37 Watch help vileWrite an explicit formula for an, the nth term of the sequence 19, 25, 31, ..... PLS HELP ASAPi dont understand the question and i cant leave this test to go look at the answer Plz help me I am timed!! On the map of Africa, the star is marking which of the following countries?1) Sudan 2) Somalia 3) Libya 4) South Africa How should I come out to my parents as lesbian? I'm low-key scared they won't support me, any techniques on how to get over that? :') A man spend 24% of his salary on transportation,25% of the rest on rent and the balance left is 1710 how much was spent on the rent what does Risk Management mean Find the missing angle. Please help, test due in 2 hours! Will give good review and brainliest. :) True or False: You cannot beam more than 2 eighth notes together. the non verbal messages of a culture is worth learning or are worth learning Discuss the cause, course and result of the Great Rebellion. how did the shogun tokugawa ieyasu prevent europeans from conquering japan (HELP I BEG U THERE IS 20 MIN LEFT I NEED SLEEP AND I WILL GIVE BRAINLY )