- Strength to Increase Rep
- +3
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
when i do... [ICODE]String menu; Scanner keyboard = new Scanner(System.in); menu = keyboard; if (menu = "D"){ .... }[/ICODE] there is error sign under "menu = "D"" <can't convert String to boolean> why menu is boolean? I stated in String.... | |
hopefully its easy. in main class I have got method from proff [CODE=java] private class AddBBQChips implements ActionListener { public void actionPerformed(ActionEvent ae) { addChips( BagOfChips.Flavor.BBQ ); } } private void addChips(final BagOfChips.Flavor flavor){ BagOfChips bag = new BagOfChips( flavor ); System.out.println(bag.toString()); }[/CODE] and from my class "BagofChips" [CODE=java] public … | |
I'm suppossed to create a code that user only inputs 1 and 2 OR 99 to exit the program. if user had put wrong number, then gently ask them again... However, when i put 1, it keeps displaying "you've selected 1" and never ends. Also, when i press wrong number … | |
I need to creat a method something like... when the user inputs test1 test2 haha test3 end and display that should contain exact same one as above except "end": test1 test2 haha test3 so the "end" is the keyword to finish the inputing... [CODE] String s = new String(""); String … | |
I'm suppose return a change to user. Initially, the machine has Bills - 0 quarters - 5 dimes - 5 nickels - 5 user puts a money to machine(each coins are sum up to only maxium $1 i.e, user can only put 10 dimes maximum, or 20 nickels) but only … | |
the function, IsPalindrome is recursive. it checks character array from 0 to end of it. i have warning message control reaches end of non-void function... whats wrong with this code? [CODE=C]int main() { length = strlen(string); boolean = IsPalindrome(string, 0, length); ... } int IsPalindrome (char* string, int left, int … | |
in my function OpenData, it corrupts error on memory allocation when I compile and run it. in main, i need to creat an int array and pass it to other function lator.. I take 4 command-line arguments ie, a.out 7 100 lychrels.dat 7 is seed number 100 is number of … | |
in doing C, in my function OpenData, it takes a point to array in main, take command-line argument name, and arraysize pointer. i get warning passing arg of 'function' makes integer from pointer OR pointer from intgeger without a cast... what does it mean? and i get con [CODE=C]int main(int … | |
i get command-line arguments argv[3], but i need to pass it to function... the sample input would be a.out 7 100 lychrel.dat [CODE=C]int main(int argc, char*argv[]) { int *array, randomNb, arraySize; int i, judge, counter = 0, iteration = 0; int total; if (argc !=4) { fprintf (stderr, "This program … | |
when I call this function in main, I need to convert the 'longlong num' into string and RETURN the string... so in main [code=c] main() { char string[20]; ........ string = LongLongToString(random); } char LongLongToString(long long num) { int counter = 0, i; char string[20]; while(num !=0) { num = … |