User Profile

Collapse

Profile Sidebar

Collapse
blazzer
blazzer
Last Activity: Apr 12 '08, 03:44 AM
Joined: Mar 16 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • blazzer
    replied to HELP on while loops problems
    in Java
    this is the current output:

    How many items the customer is purchasing:
    2
    Starting new customer...
    Enter description of product #1 :
    bread
    Enter price of bread :
    12
    Enter description of product #2 :
    Enter price of :
    12

    I'm expected the output will ask for the description first and jump to price.

    but the actual output is..when reach to...
    See more | Go to post

    Leave a comment:


  • blazzer
    replied to HELP on while loops problems
    in Java
    apperantly i've changed using "for" loops
    but it doesn't change at all..

    for (int i = 1; i <= input; i++){
    System.out.prin tln("Enter description of product #" + i + " : ");
    item = keyboard.nextLi ne();

    System.out.prin tln("Enter price of " + item + " : ");
    price = keyboard.nextDo uble();...
    See more | Go to post

    Leave a comment:


  • blazzer
    replied to HELP on while loops problems
    in Java
    if i start from zero, the product # will start from 0 too..
    it will print product #0 instead of 1.

    i'm confused that why it doesnt ask for the first input first then jump to second one..
    i cant enter product describtion..it will jump to price right away...
    any idea?

    many thanks......
    See more | Go to post

    Leave a comment:


  • blazzer
    started a topic HELP on while loops problems
    in Java

    HELP on while loops problems

    Hi,
    I'm beginner at Java. I'm confused with my simple program of using while loops

    int i = 1;
    while (i <= input){
    System.out.prin tln("Enter description of product #" + i + " : ");
    item = keyboard.nextLi ne();

    System.out.prin tln("Enter price of " + item + " : ");
    price = keyboard.nextDo uble();...
    See more | Go to post

  • blazzer
    replied to set the double value using Random class
    in Java
    Thx A LOT!! It workss!!
    See more | Go to post

    Leave a comment:


  • blazzer
    started a topic set the double value using Random class
    in Java

    set the double value using Random class

    Hi,

    I need help. I just wondering whether i can set the double value using random class..i even use if statement to set it..but nothing..i wanna set between 0.5 n 0.7 value..

    double planetMass = 0.0;
    double sunMass = 0.0;
    Random rdm = new Random();
    double rand = rdm.nextDouble( );

    if (rand >= 0.5 && rand <= 0.7){
    likeliHood = (rand * planetMass) / sunMass;
    ...
    See more | Go to post
No activity results to display
Show More
Working...