regg jones

Greenhorn
+ Follow
since Oct 26, 2020
regg likes ...
Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by regg jones

I finally fixed the code now, here's my result


2 weeks ago
Alright, I used the NextInt code but now I want to make int number= 0 and also = scan3.nextInt()

Here's my updated code below

2 weeks ago
Is there any way I can convert the scanner input to integer?
2 weeks ago
I think that because I try running the code and I get the following error.

Main.java:77: error: incompatible types: String cannot be converted to int
   number = scan3.next();
                      ^
1 error
compiler exit status 1
2 weeks ago
I have changed my code a bit more and now I cannot seem to figure out a way to make the number variable equal to the scanner input. Here's my code.


2 weeks ago
Ahh, I have figured out the problem now. But for my prompt 3, I am trying to check if the number is divisible by 2 and it keeps popping up with an error.
3 weeks ago
I want the code to be able to ask the user to type in another input. But my code doesn't do that. It just asks it infinitely.
3 weeks ago
Alright I tweaked my code a bit, apparently I deleted some code at the bottom of the project file that my teacher provided for me. Now I have an endless while loop.

// #2
   // Write a flag controlled while loop that will convert an input word to pig
   // latin. The flag should be set to false when the word “end” is entered and no
   // pig latin word displayed. You may assume that the statement pigLatin =
   // translate(word); will convert the input word to pig latin correctly. The
   // code for the input of the initial word is provided. You may assume that at
   // least one word will be translated.

3 weeks ago


Ah there we go, I just had trouble placing the exclamation mark, I have one more question now. This code is part of a bigger project. After the pig latin code has run, it doesn't run again nor does it run the next set of code. Here is my project code below.

#2
   //Write a flag controlled while loop that will convert an input word to pig latin.  The flag should be set to false when the word “end” is entered and no pig latin word displayed.  You may assume that the statement pigLatin = pl.translate(word); will convert the input word to pig latin correctly. The code for the input of the initial word is provided. You may assume that at least one word will be translated.
   
   
 // #3
   //Write a while loop that will count the number of even numbers entered.  The loop should stop when 0 is entered and 0 should not be counted.  You may use any form of while loop you desire. The code for the input of the initial number is provided.
 
4 weeks ago
I have to use the != because I need to make sure the code checks that pigword doesn't equal to end. If I use the equal method, I won't be able to run the code in my while loop.

4 weeks ago
Hello, I am trying to convert input to pig latin but after the word has been translated, the loop will not restart.

4 weeks ago
Oh I see, thanks to everyone who replied in this thread!!  
Edit - (I figured out the problem, the code now runs as it's supposed to.
1 month ago
Oh I see, I have changed my code now.

It doesn't seem to be registering whenever I put in a 1000 for the input.


   
1 month ago
I have removed the second scanner and tweaked different parts of my code. The scanner still won't run after the first one.

Updated code:

1 month ago
It seems I am down to one more problem. As I enter the input, I want the program to run the temperature scanner again until the temp input is 0.

Here is my code

1 month ago