112 Archived Topics
Remove Filter 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) { … | |
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 … | |
Can you please give me a list of all of the % letters that go with int, floats, and doubles in printf and scanf. | |
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 … | |
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 … | |
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 … | |
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[] … | |
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 … | |
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. | |
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. … | |
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 … | |
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 … |
The End.