All Questions

Tagged with
-1
votes
1answer
4k views

Compare two text files - spellchecking program in C

I'm writing a spellchecking program that will compare a user's text file with a dictionary to see if the words they entered are in the dictionary. If not, an error message is printed to tell the user ...
1
vote
2answers
715 views

C Concatenate string in while loop

I'm trying to concatenate part of a struct with hex values. I run over every byte in the loop and convert to hex, then I want to concatenate all the hex into one long string. However, I only end up ...
1
vote
1answer
431 views

How to open a file using ifstream and keep reading it until the end

I simply would like to open a file named "test.txt" that contains:catdogmooserabbitI then want to read from the file and convert its contents into strings for things that I will do later in the ...
1
vote
2answers
44 views

Exiting a method with a specific string

I'm still relatively new at Java and am working on a program for class. I have everything coded up and it's working great, but I need to exit a method when I type the string "exit". My current code ...
0
votes
3answers
18k views

While loop to check character input

I am trying to accept input from the user in the form of a character. I have that working but I need to check and make sure it is one of 6 characters (H, h, S, s, L, l). I have a while loop but as ...
0
votes
3answers
83 views

Total not adding up

I'm working on a classwork in high school comp sci classand i have come across this problem.the total is not adding.can someone tell me why?import javax.swing.*;public class TimeSheets {...
0
votes
2answers
54 views

print the result as soon as user input “done”

largest_so_far=Nonesmalest_so_far=Nonevalue=float(raw_input(">"))while value !=ValueError:value=float(raw_input(">"))if value > largest_so_far: ...
0
votes
2answers
3k 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 ...
-2
votes
4answers
327 views

Wrong output from a while loop using indexOf [duplicate]

I'm trying to find out how many times one string appears in another. For my testing, I'm using "ea" for wordOne and "Ilikedthebestontheeastbeachleast" for wordTwo. My output is returning 2 for my "...
-2
votes
5answers
2k views

How to make a loop to print the following pattern?

I want to write a program that prints out the following pattern by using loop. Right now I am able to print it by using only system.out.println. I have no idea which loop I should make.The pattern ...

angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,