Tagged Questions
-1
votes
4answers
450 views
Can't get out of my while loop
I was wondering if someone can tell me why my while loop is acting funny. When I input a 3 word phrase it should create an acronym. For a reason beyond my java understanding the while loop executes ...
2
votes
3answers
209 views
C++: Confusion on converting integers to roman numerals
I'm working on a program for my C++ course. The guidelines are to create a converter that turns integers to roman numerals, the specifications being that I must use at least one while statement, do ...
1
vote
3answers
97 views
Organizing list of strings by '>names' and 'sequences'. Python
So I have a list of strings read from a file (query). I want to append all the lines that start with ">" to a list called name_list and all of the alphabetical characters following it (but before the ...
1
vote
3answers
482 views
java.lang.StringIndexOutOfBoundsException and showInputDialog
this is a homework problem.. I'm working on a program that uses JOptionPane to count votes, until Q or q is entered and the vote count stops. It then launches a showConfirmDialog which asks the user ...
0
votes
3answers
302 views
compare 2 strings and return the number of letters that aren't equal
I'm trying to compare 2 strings for equality and return the number of any different letters in different places if there are any e.g. bob and buy would return 2.
I've not found any other examples of ...
0
votes
2answers
45 views
Compare word to Text file Java
we are supposed to create a program that reads a word from a JTextField and compare it to a list, then we have to count how many lines to the word if it exist and display the same line from another ...
0
votes
2answers
31 views
Loop through string until it reaches a specific character
I am trying to increment an integer by 1 every-time the letter in a string isn't equal to the specific character (e.g. a),
For example a string of dfla, would count 3. Because the loop will break at ...
0
votes
2answers
34 views
How to add elements from string added from console to a list in java
How I can add elements to a list from a input in java.
Like if i put:
Scanner reader = new Scanner("a,b,c,d,e);
I want to Have it like String[] a = {a,b,c,d,e];
Using any Scanner Methods with ...
0
votes
2answers
182 views
Java String New Line Loop
I wrote a method that loops through a string and adds '/n' to create a line length that was given in the parameters. That description is not the best but it's hard to describe so look at the code ...
0
votes
2answers
144 views
Ajax iFrame: PHP will not add my different strings from SQL in my loop (to rebuild HTML code).
I have an error with my PHP code below. I try to rebuild a list of depending on some choices of the visitor and put it back in my HTML through an Ajax iframe.
The issue comes from this line when I ...
0
votes
2answers
1k views
In C: How do I terminate while loop when comparing string output to external file
(This is for C, Unix in tcsh.)
I'm trying to write a string to an external file (output), then compare my output to the file input. If the output exists in that file, I want to print "Record found." ...
1
vote
1answer
25 views
While Loop Print List formatting
I wanted to create a list of factors from any given number only using the formula below. I am not allowed to use list therefore, I have imitate using strings as follows:
for example and lets say we ...
1
vote
1answer
45 views
Shellscript Ubuntu Find out if a user entered a specific character
I want to do a while loop until the user enters ab "@", this is my code but its not working:
echo -n "username(email): "
read username
checkEmail $username
checkEmail () {
username=$1
echo ...
0
votes
1answer
42 views
Declare a constant class field
I'm supposed to declare a class field for a federal tax rate, which is a constant, with a value .07. How can I achieve this?
0
votes
1answer
46 views
Pulling lines out of a file Matlab
I want to pull every line in a file that has a certain word in it and format it a certain way using matlab. I have started to do this but all my code keeps doing is pulling out the first line and ...
0
votes
1answer
12 views
Is their a way for a user to input a word and have that word be (turn into) a #?
I am trying to create program that roles 2 dice. Then the user and say Yes to role the dice again or say No to stop rolling the dice.
import java.util.*;
public class Dice
{
public ...
0
votes
1answer
193 views
Create variable in whileloop and use out of the loop
I would like to use a variable that's created in the while loop outside of it.
It's because I have different variables that I would like to put after eachother (comma seperated) and put in into a ...
0
votes
0answers
30 views
print string from command line in random order until original string is recreated
I wrote the following code to print string at random from command line,
however I have difficulty with implementing continuous printing with the while loop.
I need it to recreate original sentence ...
0
votes
0answers
88 views
while loop: data dont be save in the string var (JAVA)
i programming a tool which makes a dynamic xml data file to a static one.
At moment i have the problem, in my while loops the string var doesnt save.
In Debug Mode i see, the data would be order ...