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...
User Profile
Collapse
-
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();...Leave a comment:
-
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......Leave a comment:
-
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();... -
-
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;
...
No activity results to display
Show More
Leave a comment: