944,191 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1304
  • Java RSS
Jun 7th, 2006
0

How do I do this???

Expand Post »
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 martineye_13@hotmail.com .

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
TinchoXVI is offline Offline
3 posts
since May 2006
Jun 7th, 2006
0

Re: How do I do this???

Quote originally posted by TinchoXVI ...
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 martineye_13@hotmail.com .

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?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 7th, 2006
0

Re: How do I do this???

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jun 8th, 2006
0

Re: How do I do this???

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??
Reputation Points: 10
Solved Threads: 0
Newbie Poster
TinchoXVI is offline Offline
3 posts
since May 2006
Jun 8th, 2006
0

Re: How do I do this???

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.
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: java and MSaccess
Next Thread in Java Forum Timeline: Swings





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC