User Profile
Collapse
-
how to read char array in a line?
im trying to output several words but for some reason, (via char of arrays) its outputting a letter a line..can some one help me -
oh..okay..never learned this before but watever..thx -
i forgot how stubborn the forums are wen it comes to spacing
apple-------------------------1@1.06
fresh baked bread...... 1@12.06.
any way to solve this?Leave a comment:
-
its just that if i put something like 12.46, its not aligned
apple 1@1.06
fresh baked bread 1@12.46
see the problem?Leave a comment:
-
um all i kno how to do is to make numbers with two decimal places..im usin that in this code like if the person puts 1.0695, it outputs as 1.07Leave a comment:
-
since there's supposed to be aligned at the right side so im trying adding spaces but it doesnt workLeave a comment:
-
k...there's only one problem..let me show u..
item------ quantity@1.0
item-------quantity@2.06
the problem here is that if the price has two decimals, (eg 12.46), the alignment is off..how do i solve thisLeave a comment:
-
-
k im almost there..its almost aligned
output:
apple 1@1.0
fresh baked bread1@1.0
i just need to solve this problem (dont ask why i put fresh baked bread..laughs)Leave a comment:
-
-
-
no problem...i used string out instead..
String out = "";
int space = 0;
int spaces = 50 - item.length();
out = ""; //declare the variable space
for(int i = 0 ;i < 27; i++) {
out += " "; //
}Leave a comment:
-
i think u misunderstood wat im supposed to do...im supposed to align the prices to the right regardless the length of the itemLeave a comment:
-
-
it works a little but there's still some problem..appara ntly items with larger names arent jusitifed..subt raction sign is space
item---------------------------- quantity@price. ..
item------------------------------------------------------------quantity@price. ..
see the problem?Leave a comment:
-
-
+ if i declare a space as 17-1, the output shows 17, i kno its an int but there should be a way to solve this..Leave a comment:
-
-
my code doesnt seem to work...let me show u..
String out = "";
int space = 17-1;
for(int i = 0 ;i < 17; i++) {
out = " ";
}
is this rite?Leave a comment:
-
u kno where u put space as the output, am i supposed to put a number there or space..cause i declared space and it doesn't workLeave a comment:
No activity results to display
Show More
Leave a comment: