Thanks did that,
class Book
{
// The fields.
private String author;
private String title;
private String pages;
Type: Posts; User: Ypmaha
Thanks did that,
class Book
{
// The fields.
private String author;
private String title;
private String pages;
nevermind i got it fixed:
if (fullName.length() < 4 | studentID.length() < 3) {
i understand it a little better.
I came up with this:
if (fullName.length < 4) studentID.length <3) {
System.out.println("That not enough characters, brah");
...
I get it. I guess the main question is: "how can Ticketmachine tell me how much characters a string has? i copied the signature of the length method, so i doubt if i need to replace int with void. as...
I skipped that assignment, because it was incomplete.
Thanks alot for the help so far, everyone.
I have another one:
Add conditional statements to the constructor of Student to print an...
what if i want to add multiple tickets with each a different price to my machine?
Excercise 2.49: Write an assignment statement that will store the result of mulitplying two variables: price and discount, into a third variable, saving. How is price a saving? and how can i only...
really? a creditcard to buy a trainticket? I don't think that's very safe
Anyway, i've tried every possible i could think of, but i can't solve this one:
I need to implement a method to change...
Now i need to add an object to give a discount on a ticket:
/**
* Reduce price by the given amount
*/
public void discount(int amount)
{
amount = ticketcost -...
/**
* TicketMachine models a naive ticket machine that issues
* flat-fare tickets.
* The price of a ticket is specified via the constructor.
* It is a naive machine in the sense that it...
Actually, i get only 2 errors with this class. In the sideline, at the last line (frame.add( "hello" ) i see this:
http://i41.tinypic.com/119tmqg.png
If i understood it correctly, i should a...
import javax.swing.*;
import java.awt.*;
public class HelloJava {
public static void main( String[] args ) {
JFrame frame = new JFrame( "Hello, Java!" );
...