I'm almost there. I decided to use my own class to sort but it's not working. It might be the placement.
Take a look...
import java.util.Random;
import java.io.*;
public...
Type: Posts; User: Java Neil
I'm almost there. I decided to use my own class to sort but it's not working. It might be the placement.
Take a look...
import java.util.Random;
import java.io.*;
public...
Well I corrected my code to print and write 100 integers. On the other hand I'm completely stumped about how to sort it. Help me please!
Do I need an array? Where should that code go if I do? If...
Hi all...I have this program that I wrote that creates a random number, writes it to a file and scans it back to the system. That part alone took me forever to hash out. Now I stuck. I would like to...
Check me...
I have two codes that both work. One code based off of the example in my book, and the example you gave me.
Book example:
import javax.swing.JOptionPane;
public class...
Now see...That was very helpful! Thanks for setting up the form.
I'll get it. I just started objects. No need to doom me before I apply the concepts.
OK, I don't understand. As I said I work better with "seeing the logic" rather than being told. Never built an object . No nothing of how constructors work. You're naming parts of an object that I...
Like I said before. My teacher has only covered about 30 minutes worth of material for the last part of the last class. I have not grasped the material fully yet.
I applied you code suggestion...
OK, I changed the variables to just public.
import javax.swing.*;
public class TestRectangle {
public static void main (String[] args) {
Rectangle rectangle1...
Well after about 3 hours, I need some help with something I haven't learned yet.
Here is my first attempt at this program. My main goal was just to have it compile and show me the fields.
...
For my hardest assignment in this chapter I am supposed to create a "class Rectangle" to represent a rectangle. The class needs to have the following...
1. Two double data fields named width and...
They are just strings for input.
Here is the corrected code
class code
public class Employee {
private String fname;
private String lname;
private String id;
private...
OK, I see what you mean.
I feel kinda dumb.
Ah! Cool.
Now it compiles but when I run it no values are being stored in the salary field. It just displays 0.0?
Once I get some of these basics down I should be able to truck along.
I'm starting on a very simple program dealing with classes and objects and I'm confused about what's going on here...
Class file
public class Employee {
private String fname;
...
The good news is my teacher checked off this assignment. He didn't even look at whether or not the students were being sorted with the grades. The bad news is I now need to figure this out to satisfy...
Well I've tried everything time will allow, but it's time for class. When I get to school I'll check back to see if you have come up with something. Even if you can't, I value everything you have...
Yeah, That's the code I'm messing with but I'm running out of time fast!
import javax.swing.JOptionPane;
public class GradeExam2 {
public static void main(String[] args) {
...
This is the code with the methods. As you can see I have a few problems with it!
Thanks for the tips. I've posted so many codes, I'm not sure which one you're referring to. About three posts ago I posted code that had separate methods.
Could you maybe show me what you had in...
Here is one without all the methods...
import javax.swing.JOptionPane;
public class GradeExam {
public static void main(String[] args) {
char[][] answers = {
...
Wow, my brain hurts!
Well this is the combination of the codes.
import javax.swing.JOptionPane;
public class GradeExam {
public static void main(String[] args) {
...
I'm not sure if this helps, but here is some code that will sort two values.
public class SortTwoDimensions {
public static void main(String[] args) {
int m[][] = { { 4, 2 }, { 1, 7 }, {...
Yes, each student has a unique grade and needs to sort with their perspective student.
I now see what you mean about the brackets.
Here is the fixed code
import javax.swing.JOptionPane;
...
Well I am not seeing the students switch with the correctCount. The students are not being sorted.
Should I use
int[][] student = new int[8][8];
to store the two values?
Also I'm not...
OK...let me mess with this logic