Well, this is one project away from my AP Exam.
Unfortunately I am taking this course idependently. (Independent School of Nebraska, I live in Africa :eek: ) I just need someone to put me on the right track for the following. Anything will be cosidered. My e-mail is .

Well thanks for at least taking a look at it....

Program will need to be able to:

1. Accept an integer input from the console and determine how many numbers are created and stored. Create the list of numbers using the Math.random() function.
2. Display a text menu in the console containing the following options:

  • Display the numbers (in their current stored order).
  • Sum the numbers.
  • Modify a number: enter the index of the element you wish to change and the number you wish to change it to.
  • Sort the list of numbers (may choose from all of the following: Bubble Sort, Selection Sort, Insertion Sort, and Merge Sort) and display the number of swaps when completed.
  • Search for a number in the list, (sequential required, binary if possible) and display the number of comparisons that were needed when the search is completed.
  • Exit the program.

Your code for performing the tasks should be located in a Java class NumberHelp.

Recommended Answers

All 4 Replies

Member Avatar for iamthwee

Well, this is one project away from my AP Exam.
Unfortunately I am taking this course idependently. (Independent School of Nebraska, I live in Africa :eek: ) I just need someone to put me on the right track for the following. Anything will be cosidered. My e-mail is .

Well thanks for at least taking a look at it....

Program will need to be able to:

1. Accept an integer input from the console and determine how many numbers are created and stored. Create the list of numbers using the Math.random() function.
2. Display a text menu in the console containing the following options:

  • Display the numbers (in their current stored order).
  • Sum the numbers.
  • Modify a number: enter the index of the element you wish to change and the number you wish to change it to.
  • Sort the list of numbers (may choose from all of the following: Bubble Sort, Selection Sort, Insertion Sort, and Merge Sort) and display the number of swaps when completed.
  • Search for a number in the list, (sequential required, binary if possible) and display the number of comparisons that were needed when the search is completed.
  • Exit the program.

Your code for performing the tasks should be located in a Java class NumberHelp.

So where's the problem, what have you tried? Have you looked at the java class NumberHelp?

less Martineyes and more Java and you would figure it out easily enough (maybe you're too young to know the joke here).

What you're asking for is all dirt standard functionality which you MUST be able to do almost with your eyes closed.

Well so far, i have this which i think i could do it.

But im stuck here...

import java.io.*;
class numberHelp
{
private static String[] triTypes = { "", "scalene", "isosceles", "equilateral",
"not a valid triangle"};
private static String instructions = "1.Display the numbers (in their" +
"current stored order).\n2.Sum the numbers./n";

public static void main (String[] argv)
{
int A, B;

System.out.println (instructions);
System.out.println ("Enter choice number: ");
A = getN();
B = getN();

System.out.println ("You choose ");
}

private static int getN ()
{
int inputInt = 1;
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
String inStr;
try
{
inputInt = Integer.parseInt(inStr);
}

catch (NumberFormatException e)
{
System.out.println ("Entry must be a number.");
}
return (inputInt);
}

}

what should i use with this? Or should i find a complete different way??

stuck on what? I certainly dont want to sit here and analyze your code to figure out what you haven't done on your HW yet. How about you tell us specifically where you're stuck at.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.