| | |
How do I do this???
![]() |
•
•
Join Date: May 2006
Posts: 3
Reputation:
Solved Threads: 0
Well, this is one project away from my AP Exam.Your code for performing the tasks should be located in a Java class NumberHelp.
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.
•
•
•
•
Originally Posted by TinchoXVI
Well, this is one project away from my AP Exam.Your code for performing the tasks should be located in a Java class NumberHelp.
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.
*Voted best profile in the world*
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.
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.
•
•
Join Date: May 2006
Posts: 3
Reputation:
Solved Threads: 0
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??
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??
![]() |
Other Threads in the Java Forum
- Previous Thread: java and MSaccess
- Next Thread: Swings
| Thread Tools | Search this Thread |
2dgraphics 3d @param affinetransform android api applet application arc arguments array arrays automation banking binary bluetooth byte chat chatprogramusingobjects class client code color compare component count database design detection eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide if_statement image input integer interface j2me java java.xls javadesktopapplications javaprojects jni jpanel julia keytool keyword linux list loop macintosh map method methods mobile netbeans newbie object os pong problem producer program programming project projectideas read recursion reference replaysolutions rim scanner server set size sms sort sql string swing terminal threads transforms tree ui unicode validation web windows






