| | |
May you code these programs?
![]() |
•
•
Join Date: Sep 2009
Posts: 7
Reputation:
Solved Threads: 0
I'm having Java course and I have to submit the following programs by the coming Wednesday for what I am not skilled enough till now. Please may you code those for me for this time?
PART 1
P1. Write a java program to calculate the roots of a quadratic equation f(x) = ax^2 + bx + c.
Take the equation coefficient input a, b, and c from the keyboard. Check for normal, equal and imaginary roots.
Sample Output
Two roots are equal and x = 5
The complex roots are, x1 = 1 + 2i and x2 = 1 - 2i
Roots are, x1 = 3.2 and x2 = - 1.5
P2. Write a program that takes two integers x, y as input and prints the sum result in the screen.
Version 1: (task-based program)
Use code for console input and output
Version 2: (GUI program)
Use code for GUI input and output (JOptionPane)
P3. Write a program that takes three integers s, y, z as input and prints the maximum and minimum numbers in the screen. Use only grapical I/O.
PART 2
P4. Write a java program to design the following method that can ve used to find the sum of surrounding row and columns in a two dimensional square array of size n*n.
/*
Input: A two difmensional square array of integers.
Output: Returns the sum of surrounding rows and columns.
*/
int surroundingSum ( int [][] array){
}
P5. Write a program to allocate differing sized 2nd dimensions of a two-dimensional array and assign the following pattern. Allocation code should follow the pattern; no manual allocation will be allowed.
55 45 36
28 21
15
10 6
3 1 0
P6. Generate the following diamond pattern (using 'loop' operation)
1
4 2 4
9 6 3 6 9
4 2 4
1
PART 1
P1. Write a java program to calculate the roots of a quadratic equation f(x) = ax^2 + bx + c.
Take the equation coefficient input a, b, and c from the keyboard. Check for normal, equal and imaginary roots.
Sample Output
Two roots are equal and x = 5
The complex roots are, x1 = 1 + 2i and x2 = 1 - 2i
Roots are, x1 = 3.2 and x2 = - 1.5
P2. Write a program that takes two integers x, y as input and prints the sum result in the screen.
Version 1: (task-based program)
Use code for console input and output
Version 2: (GUI program)
Use code for GUI input and output (JOptionPane)
P3. Write a program that takes three integers s, y, z as input and prints the maximum and minimum numbers in the screen. Use only grapical I/O.
PART 2
P4. Write a java program to design the following method that can ve used to find the sum of surrounding row and columns in a two dimensional square array of size n*n.
/*
Input: A two difmensional square array of integers.
Output: Returns the sum of surrounding rows and columns.
*/
int surroundingSum ( int [][] array){
}
P5. Write a program to allocate differing sized 2nd dimensions of a two-dimensional array and assign the following pattern. Allocation code should follow the pattern; no manual allocation will be allowed.
55 45 36
28 21
15
10 6
3 1 0
P6. Generate the following diamond pattern (using 'loop' operation)
1
4 2 4
9 6 3 6 9
4 2 4
1
1
#2 Oct 26th, 2009
•
•
•
•
I'm having Java course and I have to submit the following programs by the coming Wednesday
Does this mean that next time you will do it on your own?
But if you can't do this now, how will you be able to do the more advanced? Not to mention that you would not have learned how to think on your own, so even if you do understand the code that we would have given you, you would not be able to think the solution for the next assignment.
Check out my New Bike at my Public Profile at the "About Me" tab
•
•
Join Date: Sep 2009
Posts: 7
Reputation:
Solved Threads: 0
0
#3 Oct 26th, 2009
He gave those today.
Whatever, I usually solve problems by myself, I know how to work hard, but some times people need help and now its my turn.
Dont think that I'm doing nothing, I've arrived home and going to study books for necessary clues, then I'll try. But if I'd fail then its a big problem because I have to submit it day after tomorrow. Thats why I'm asking for help.
Ok, I can prove that I'm trying. If you code the programs in some way I may chance few or enough codes but output will be similar to prove that I can understand all your code.
Whatever, I usually solve problems by myself, I know how to work hard, but some times people need help and now its my turn.
Dont think that I'm doing nothing, I've arrived home and going to study books for necessary clues, then I'll try. But if I'd fail then its a big problem because I have to submit it day after tomorrow. Thats why I'm asking for help.
Ok, I can prove that I'm trying. If you code the programs in some way I may chance few or enough codes but output will be similar to prove that I can understand all your code.
0
#4 Oct 26th, 2009
Well I cannot do the whole thing for you, nor offer help without knowing your level.
And to see your level I will need to see some code.
For the Part 1 you will need the Math class. (search it at the net)
and the
JOptionPane class. Use the static methods (showInputDialog).
For component use null.
Don't bother with the input. First use variables with initial values to do correctly the calculations and then search this forum for the Scanner class and how to read input using that.
And to see your level I will need to see some code.
For the Part 1 you will need the Math class. (search it at the net)
and the
JOptionPane class. Use the static methods (showInputDialog).
For component use null.
Don't bother with the input. First use variables with initial values to do correctly the calculations and then search this forum for the Scanner class and how to read input using that.
Check out my New Bike at my Public Profile at the "About Me" tab
![]() |
Similar Threads
- Error code LP5 (Storage)
- Recursive binary search (C)
- Code Snippet: Pythagorean Theorem Calculator (Python)
- OOO-Microsoft Internet Explorer Pop up (Viruses, Spyware and other Nasties)
- Some general assembly questions (Assembly)
- cin.get issue (C++)
- help with getting soda machine program running (C++)
- Discrete Math or Data structure (Computer Science)
- Well I Found Out Why I Couldn't Log On To Hotmail/MSN (Web Browsers)
- Problems with classic mode (OS X)
Other Threads in the Java Forum
- Previous Thread: spring problem
- Next Thread: Video Segmentation & Summerization
| Thread Tools | Search this Thread |
add android api applet application applications array arrays automation bank binary bluetooth chat class clear client code codesnippet collections component converter database development dice digit eclipse equation error event formatingtextintooltipjava fractal functiontesting game givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jni jpanel julia linux list loop looping main map method methods mobile myregfun mysql netbeans newbie nonstatic openjavafx parameter pearl php print problem program programming project recursion repositories scanner scrollbar server set size sms sort sorting spamblocker sql sqlserver state storm string superclass swing swt text-file thread threads tree windows






