How do I do this???

Reply

Join Date: May 2006
Posts: 3
Reputation: TinchoXVI is an unknown quantity at this point 
Solved Threads: 0
TinchoXVI TinchoXVI is offline Offline
Newbie Poster

How do I do this???

 
0
  #1
Jun 7th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: How do I do this???

 
0
  #2
Jun 7th, 2006
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?
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: How do I do this???

 
0
  #3
Jun 7th, 2006
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3
Reputation: TinchoXVI is an unknown quantity at this point 
Solved Threads: 0
TinchoXVI TinchoXVI is offline Offline
Newbie Poster

Re: How do I do this???

 
0
  #4
Jun 8th, 2006
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??
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: How do I do this???

 
0
  #5
Jun 8th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC