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 {
...
Type: Posts; User: m7abraham
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 {
...
no one?
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
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...
I tried a lot of things i keep getting nothing
any other advises
--- Update ---
Got it!!
I forgot to add:
this.newFile.addActionListener(this);
I have another class to test the code I just dont have it included in here
idk if thats what you was asking
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.*;
so instanceof is suppose to be as i understood from this :
getSocialSecurity and getAnnualSalary
am I correct?
: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;
...
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! :-??
Sorry for the late respond...
by values you mean the result?
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...
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 ...
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...
is this correct?
public Pizza(Pizza pi) {
diameter = pi.diameter;
price = pi.price;
}
ok sorry... :confused:
just one question
whats "this" in the program
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();
...
thanks :)
got this one fixed
public double calculateArea() {
double radius = diameter / 2;
double area = Math.PI * radius * radius;
return area;
}
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:
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;
}
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:
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...
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
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...
how can I make it loop after each specific case