Purchase Solution

Java Application DblArray.java

Not what you're looking for?

Ask Custom Question

Write a Java application that can hold five doubles in an array, and display the doubles from first to last, and then display the doubles from last to first. Use the following logic for BubbleSort to sort and display the array in sequence.

Int comparisonToMake = someNums.length - 1;
for (a = 0; a < someNums.length - 1; ++a)
(
for(b = 0; < comparisonToMake; ++b)
(
if(someNums[b] > sp,eMi,s[b + 1])
(
temp = someNums [b];
someNums[b] > = someNums[b + 1]';
someNums[b + 1] = temp;
)
)
--comparisonToMake;
)

Purchase this Solution

Solution Summary

Attached Java program takes 5 double values as input from user and then displays the content of doubles array as asked. Solution also provides the output of a sample session for easier verification.

Solution Preview

Please rename attached 441198-DblArray.java as DblArray.java before compiling and running the program. It takes 5 double values as input from user and then displays them first to last and then last to ...

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Javscript Basics

Quiz on basics of javascript programming language.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.