112 Archived Topics

Remove Filter
Member Avatar for COKEDUDE

Can someone tell me why my compiler won't compile this code and how to fix it? [CODE]void gcd(int x, int y) { if (x > y) { int c; while(1) { c = x % y; return y; x = y; y = c; } if (y > x) { …

Member Avatar for COKEDUDE
0
184
Member Avatar for COKEDUDE

Can someone please explain the meaning of these return 1 vs return 0 vs break. I know 1 generally means true and 0 generally means false but how would they effect a return statement? Also when would you wanna use a return statement instead of a break statement and vice …

Member Avatar for WaltP
0
255
Member Avatar for COKEDUDE

Can you please give me a list of all of the % letters that go with int, floats, and doubles in printf and scanf.

Member Avatar for COKEDUDE
0
83
Member Avatar for COKEDUDE

I have two different parts to my program. My FundRaising.java is my problem. I'm having problems with my print statements. Why are the correct numbers not showing up? I keep getting 0. System.out.println (booster1); System.out.println (booster2); I ask the question to get the numbers and I keep on getting 0 …

Member Avatar for Ezzaral
0
354
Member Avatar for COKEDUDE

Can someone please tell me why "int can not be dereferenced" here. contents += cart[i].toString() + "\n [CODE]// ********************************************************************** // ShoppingCart.java // // Represents a shopping cart as an array of items // ********************************************************************** import java.text.NumberFormat; public class ShoppingCart { private int itemCount; // total number of items in the …

Member Avatar for javaAddict
0
202
Member Avatar for COKEDUDE

After I ask the user to enter a number here System.out.println("Enter a number"); number = scan.nextInt(); I would like print the id of each salesperson that exceeded that value and the amount of their sales. I Also want to print the total number of salespeople whose sales exceeded the value …

Member Avatar for gunjannigam
0
3K
Member Avatar for COKEDUDE

Can someone please explain why this division is not working. This is very simple division but for some reason it won't work. double Percent = Correct / Questions; [CODE]//**************************************************************** // Quizzes.java // // Calculates quizz scores. // // // **************************************************************** import java.util.Scanner; public class Quizzes { public static void main(String[] …

Member Avatar for COKEDUDE
0
2K
Member Avatar for COKEDUDE

Why is this an illegal start on an expression? public Account consolidate(Account accnt1, Account accnt2) In my if statement It says name has private access in account. What does that mean and how do i fix it? if((accnt1.name).equals(accnt2.name)) [CODE]//*********************************************************** // TestConsolidation // A simple program to test the numAccts method …

Member Avatar for Ezzaral
0
154
Member Avatar for COKEDUDE

Can someone please explain what both of these mean and the good details about them. Please also explain the parameters of how to use it.

Member Avatar for llemes4011
0
459
Member Avatar for COKEDUDE

Could anyone tell me what is wrong this code please. I'm trying to do this. Add a static method Account consolidate(Account acct1, Account acct2) to your Account class that creates a new account whose balance is the sum of the balances in acct1 and acct2 and closes acct1 and acct2. …

Member Avatar for skoiloth
0
209
Member Avatar for COKEDUDE

I'm trying to do some consolidation but I'm not sure on the specific rules of consolidation so I'm having A LOT of difficulty on it. Here's what I'm trying to do. Write a program that prompts for and reads in three names and creates an account with an initial balance …

Member Avatar for COKEDUDE
0
116
Member Avatar for COKEDUDE

Right now my code runs just the way I want it to. I would like the [CODE]Enter a sentence or phrase[/CODE] part to continue until the user enters "quit". I would like to use a while statement. Every way I have tried to enter phrase not equal to "quit" has …

Member Avatar for COKEDUDE
0
199

The End.