Help With My Java Project?

Help With My Java Project?

Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign it to a two-dimension array where the first dimension contains exactly what they type and the second dimension contains the first non-whitespace character of what they type, in lowercase. If they enter a blank line, it is acceptable to skip that line. When they type done, do these steps: display: As Entered for each entry in the array, display the index of the first dimension, the second dimension's value, and the first dimension's value on a single line separated by : (colon). display: Bubble Sorted using a bubble sort, for each entry in the array, display the original index of the first dimension, the second dimension's value, and the first dimension's value on a single line separated by : (colon) sorted by the second dimension. display: Selection Sorted using a selection sort, for each entry in the array, display the original index of the first dimension, the second dimension's value, and the first dimension's value on a single line separated by : (colon) sorted by the first dimension. Grading Notes:

Example:

User types: apple Apple Zone apple done

You display: As entered 0:a:apple 1:a:Apple 2:z:Zone 3:a:apple Bubble Sorted 0:a:apple 1:a:Apple 3:a:apple 2:z:Zone Selection Sorted 1:a:Apple 0:a:apple 3:a:apple 2:z:Zone

Here is what i got and i cant seem to put it all together to make it work. please help

import java.util.Scanner;
import java.util.*;
public class A4A
{
    public static void main(String[] args) { 
        Scanner input=new Scanner(System.in);
        System.out.print("Enter value of i: ");
        int a=input.nextInt();

System.out.print("Enter value of j: "); int b=input.nextInt(); int[][] a2 = new int[a][b]; System.out.println("Enter elements of your choice: "); for(int i=0 ; i < a2.length ; i++){ for(int j=0 ; j < a2[i].length ; j++){ a2[i][j] = input.nextInt(); } } for(int i=0 ; i < a2.length ; i++){ System.out.println(); for(int j=0 ; j < a2[i].length ; j++){ System.out.print(a2[i][j]+" "); } } } } static class bubbleSort{ { int i; int array[] = {12,9,4,99,120,1,3,10}; System.out.println("Values Before the sort:\n"); for(i = 0; i < array.length; i++) System.out.print( array[i]+" "); System.out.println(); bubble_srt(array, array.length); System.out.print("Values after the sort:\n"); for(i = 0; i public static void bubble_srt( int a[], int n ){ int i, j,t=0; for(i = 0; i < n; i++){ for(j = 1; j < (n-i); j++){ if(a[j-1] > a[j]){ t = a[j-1]; a[j-1]=a[j]; a[j]=t; } } } } } public static void selection_srt(int array[], int n){ for(int x=0; xofmin = x; for(int y=x; yofmin]ofmin = y; } } int temp = array[x]; array[x] = array[indexofmin]; array[indexofmin] = temp; } } }
View Answers









Related Tutorials/Questions & Answers:
PLEASE HELP WITH MY JAVA
Help With My Java Project?
Advertisements
Help Me in My Java Work
ModuleNotFoundError: No module named 'project2'
ModuleNotFoundError: No module named 'projectq'
ModuleNotFoundError: No module named 'projectq'
ModuleNotFoundError: No module named 'projectq'
hello. can anyone help me with my java project, using jcreator?
Need help with my project
ModuleNotFoundError: No module named 'pytket-projectq'
ModuleNotFoundError: No module named 'pytket-projectq'
ModuleNotFoundError: No module named 'pytket-projectq'
ModuleNotFoundError: No module named 'hiq-projectq'
Please help me to modify my java code from php code
Please help me to modify my java code from php code
I need help on my Java code.... please please help me out!?
please help.. this my importtant project..!!!!!
Please Help To Solve My Problem
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
Help me please with my final homework
My screen EPAD is broken ...please help
help me about to solve my qustion
pls i need help with my assignment
pls help its eating my time:(
Not sure whats wrong with my code HELP PLEASE?!?!
Help on JDBC and my SQL 5 database - JDBC
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
HELP! Design Review & Risk Management topics (in Java projects) required - Development process
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
this is my javascript code and i am not understanding the mistake in this,please help me?
java help!
Help With Java...
My name, java project
My name, java project
help in java
plz help - Java Interview Questions
help in java
java help?
java help
help for java
help in java
help in java

Ads