I have a Product class that is the parent of 3 other classes; Books, Movies, Music. And the Product class connects to the Store class that holds the Store's location.
If I need to find a certain...
Type: Posts; User: Usoda
I have a Product class that is the parent of 3 other classes; Books, Movies, Music. And the Product class connects to the Store class that holds the Store's location.
If I need to find a certain...
Still unsure how to implement what you said; however, I am going to try and make sense of what I am misunderstanding. If you need more code I can provide it.
My first pass would take in a Store...
Hello, I am trying to add String objects into a linked list alphabetically. However, when I put multiple strings in and go to print it it will only print the first thing I input; losing the rest of...
I am not strongly familiar with ArrayList. As for what I mean as top and bottom I am looking at it as a playing deck of cards sitting on a table. 52 total. Where the top of the deck; if set on the...
It would be taking away from the top or beginning (index 0) which is in my Draw() method. Then if needed adding cards to the bottom of a deck of cards which could contain x amount
I understand that i need a counter to do that; however, I don't know where to set the counter so that it can determine that empty spot. Where exactly it should be pointing within the method, class,...
Hello, I am having trouble with a few methods in one of my classes (Deck)
I have 2 classes; Deck & Cards
Two methods in Deck that I am unsure how to create is;
"add" which is suppose to...
Sorry guys it isn't suppose to RETURN anything.. However it is suppose to have print statements for the user inside the method as requested by the instructor. This quote below, as posted before - I...
This is my working code. It works for what I have tested it for, but I am not sure if I have ran all the conditions for it too pass. Other than that I believe this is solved. Unless you guys see...
All i need to do is somehow stop the loop from printing my else statement if IF is true. It will run through both if and else and print them and will print only my IF when it finds the index?
I have a method that is SUPPOSE to prompt the user to enter the name of the item to search for. If it exist then say it was found and return the index number. if it doesn't then tell them it doesn't....
Alright I finished my program however, I need a counter for words. The program below counts words that end with a space.
I need to do an || statement or a different loop to count words that also...
I didn't know you had to assign it. I thought char currentChar; would be all you had to do to initialize it. I guess I was wrong though.
Hey man I feel yeah. I got another error:
The local variable currentChar may not have been initialized
I am going to take a break because I am becoming frustrated, and can't stand to stare at...
Sorry to be so bothersome, but now it is saying:
The method isWhitespace(char) in the type java.lang.Character is not applicable for the arguments ()
I don't understand why it is trying to...
Tjstretch with your method I get an error "Cannot invoke isDigit on the primitive type char?" on both isDigit and isWhitespace
Tjstretch I have not read your post yet. I just now created this which counts everything, but it doesn't combine the values.
while (input.hasNextLine()) {
last = input.nextLine();
...
I am still unsure how to increment a counter to tell me how many characters, digits, and blank spaces. Also, is there a way to do this with methods from class Character?
I am reading a file from the user and now I have to count the number of characters, blank spaces, digits, "other characters", words, and lines in a text file using a loop.
I am having trouble...
Output:
I love ____, but hate ____:
[DrJava Input Box]
Original line of text:
i love cats but hate dogs
The word hate is replaced with love:
i hate cats but love dogs
First word of...
import java.util.Scanner;
class Hate
{
public static void main (String args[])
{
String Original;
String Modified;
int love;
This is a program to change the first word in a user input sentence with the last.
I am extremely sorry if this is a simple fix but I either get a repeated String or a printout error. I have...