954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How do I do this???

[INDENT]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 [EMAIL="martineye_13@hotmail.com"]martineye_13@hotmail.com[/EMAIL] .

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.
[/INDENT]Your code for performing the tasks should be located in a Java class NumberHelp.

TinchoXVI
Newbie Poster
3 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 
[INDENT]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 [EMAIL="martineye_13@hotmail.com"]martineye_13@hotmail.com[/EMAIL] . 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.
[/INDENT]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?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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??

TinchoXVI
Newbie Poster
3 posts since May 2006
Reputation Points: 10
Solved Threads: 0
 

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.

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You