Search:

Type: Posts; User: Ypmaha

Search: Search took 0.38 seconds.

  1. Re: Simple question about a ticketmachine assignment

    Thanks did that,



    class Book
    {
    // The fields.
    private String author;
    private String title;
    private String pages;
  2. Re: Simple question about a ticketmachine assignment

    nevermind i got it fixed:



    if (fullName.length() < 4 | studentID.length() < 3) {
  3. Re: Simple question about a ticketmachine assignment

    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");
    ...
  4. Re: Simple question about a ticketmachine assignment

    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...
  5. Re: Simple question about a ticketmachine assignment

    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...
  6. Re: Simple question about a ticketmachine assignment

    what if i want to add multiple tickets with each a different price to my machine?
  7. Re: Simple question about a ticketmachine assignment

    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...
  8. Re: Simple question about a ticketmachine assignment

    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...
  9. Re: Simple question about a ticketmachine assignment

    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 -...
  10. Simple question about a ticketmachine assignment

    /**
    * 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...
  11. Replies
    3
    Views
    494

    Re: I'm supposed to see text in this window

    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...
  12. Replies
    3
    Views
    494

    I'm supposed to see text in this window

    import javax.swing.*;
    import java.awt.*;

    public class HelloJava {
    public static void main( String[] args ) {
    JFrame frame = new JFrame( "Hello, Java!" );
    ...
Results 1 to 12 of 12