Search:

Type: Posts; User: m7abraham

Page 1 of 2 1 2

Search: Search took 0.36 seconds.

  1. Replies
    1
    Views
    214

    can i do this with switch statement?

    So i have this code and out of curiosity I was wondering if it would be better to use "switch statement"


    import java.util.Random;
    import javax.swing.JOptionPane;

    public class Main {

    ...
  2. Replies
    2
    Views
    334

    Re: Java practice help?

    no one?
  3. Replies
    2
    Views
    334

    Java practice help?

    So I'm a computer science student and im trying to figure out a way of how i can
    practice programming
    is there any good websites that have projects for all programming levels?

    Thanks
  4. Replies
    1
    Views
    221

    Change the circles to start

    Im trying to change the circle in the flag to stars
    tried every possible way i know nothing worked


    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import...
  5. Replies
    5
    Views
    385

    Re: "New" not clearing textarea!

    I tried a lot of things i keep getting nothing
    any other advises

    --- Update ---

    Got it!!
    I forgot to add:


    this.newFile.addActionListener(this);
  6. Replies
    5
    Views
    385

    Re: "New" not clearing textarea!

    I have another class to test the code I just dont have it included in here
    idk if thats what you was asking
  7. Replies
    5
    Views
    385

    "New" not clearing textarea!

    When I click on "new" the text in the textarea is suppose to be cleared but nothing is happening




    import javax.swing.*;

    import java.awt.*;

    import java.awt.event.*;
  8. Re: Inheritance and Polymorphism assignment!!

    so instanceof is suppose to be as i understood from this :
    getSocialSecurity and getAnnualSalary
    am I correct?
  9. Inheritance and Polymorphism assignment!!

    :confused::confused::confused:
    I think i got most of this done but im stuck on one thing right now:
    this is what i have so far:



    public class Employee {

    private String name;
    ...
  10. Replies
    5
    Views
    921

    Re: Small airline company assignment

    So I tested the variables...
    the variables change based on what my input is
    if I say i wanna check 1A
    it shows row 1, seat A
    and thats how it supposed to be! :-??
  11. Replies
    5
    Views
    921

    Re: Small airline company assignment

    Sorry for the late respond...
    by values you mean the result?
  12. Replies
    5
    Views
    921

    Small airline company assignment

    Back again with another assignment...
    everytime i chose a seat is says that the seat is taken, couldn't figure out where the problem is at:


    public class Plane {

    char[][] chart;
    int...
  13. Replies
    17
    Views
    708

    Re: writing a class

    this is the output:


    run:
    Diameter of Pizza Area of Pizza Price Price/SQ Inch
    12.00 113.10 $4.00 0.0354
    12.00 113.10 ...
  14. Replies
    17
    Views
    708

    Re: writing a class

    haha yeah took a lot of brain storming!!!
    but i still get the same output for some reason
    this is what my program looks like now:


    /* This class calculates the area of a pizza and
    * the...
  15. Replies
    17
    Views
    708

    Re: writing a class

    is this correct?


    public Pizza(Pizza pi) {

    diameter = pi.diameter;
    price = pi.price;
    }
  16. Replies
    17
    Views
    708

    Re: writing a class

    ok sorry... :confused:
    just one question
    whats "this" in the program
  17. Replies
    17
    Views
    708

    Re: writing a class

    based on the example i think this is how it should be done... but its still giving me the same output :/


    public Pizza(Pizza pi) {

    pi.getDiameter();
    pi.getPrice();

    ...
  18. Replies
    17
    Views
    708

    Re: writing a class

    thanks :)
    got this one fixed


    public double calculateArea() {
    double radius = diameter / 2;
    double area = Math.PI * radius * radius;
    return area;
    }
  19. Replies
    17
    Views
    708

    Re: writing a class

    did i get it right this time? haha


    public Pizza(Pizza pi) {

    pi.getDiameter();
    pi.getPrice();
    }

    and i think i got this one right too:
  20. Replies
    17
    Views
    708

    Re: writing a class

    for the first part... are the two fields(diameter, price)?
    is this what i'm suppose to do?


    public Pizza(Pizza pi) {
    diameter = 12.0;
    price = 4.00;
    }
  21. Replies
    17
    Views
    708

    Re: writing a class

    for this part the instruction is: "copy constructor the creates an exact copy of the passed pizza object pi."


    public Pizza(Pizza pi) {
    }


    the error message that im getting is this:
  22. Replies
    17
    Views
    708

    writing a class

    I wrote almost the entire class other than one thing that i'm confused about which is this:


    public Pizza(Pizza pi) {
    }


    the rest of the coding is done. when i test it it says that...
  23. Re: How to make program ask for options again

    Yeah I used netbean's format tool to format it
    and yeah that solved one of my problems
    thanks soo much for all of you
  24. Re: How to make program ask for options again

    import java.util.Scanner;
    public class LabAssign3 {

    public static void main (String [] args) {
    int x , y, o, p, pp, cps, pico, co; // x: is there a customer in line?
    // y: are you a...
  25. Re: How to make program ask for options again

    how can I make it loop after each specific case
Results 1 to 25 of 42
Page 1 of 2 1 2