in java (just a line of code will do)
Your program will read in the text file, word by word. You are to ignore leading and trailing punctuation and capitalization (i.e., "Castle", "castle?", and "CASTLE" are all equivalent to castle). Convert all words to lower case on input, or you can use case-insensitive comparisons - your choice. You will be putting the words into several implementations of linked lists and comparing the results. If, after trimming punctuation, a "word" consists of no letters, then discard the word. Such a case might arise if your word-reading strategy assumes that every word is delimited by spaces, in which case, a dash would constitute a "word", but would not contain any letters, so it would be discarded (for example, "comparisons - your choice" should be three words, though your space-delimited parser might identify "-" as a fourth "word", but the “-“ should be discarded).
In: Computer Science
In: Economics
Write a C++ program that inputs (cin) a word from the keyboard and generates several different scrambles of the word without using vectors. The input word can be from 4 to 10 letters in length. The number of scrambles produced depends on the number of letters in the word. e.g. the 4 letter word “lose” would have 4 different scrambles produced and the seven letter word “edition” would have seven different scrambles.
Here is a candidate example:
Input: FLOOR
Scrambles: ROOLF, OOLFR, OLFRO, LOORF, OORFL
Your program must use the same block of code for each input word. There is also the rand() random number generator available.
Test you program with these words:
salt
asteroid
manipulate
In: Computer Science
I wrote this code and it produces a typeError, so please can you fix it?
import random
def first_to_a_word():
print("###### First to a Word ######")
print("Instructions:")
print("You will take turns choosing letters one at a time until a
word is formed.")
print("After each letter is chosen you will have a chance to
confirm whether or not a word has been formed.")
print("When a word is formed, the player who played the last letter
wins!")
print("One of you has been chosen at random to initiate the
game.")
print()
print("Note: Words must be longer than a single letter!")
print()
#inputs / randomNumGen
player1 = input("Enter player 1's name: ")
player2 = input("Enter player 2's name: ")
random_number = random.randint(0, 1)
#output function
def output_func(player1, player2, random_number):
if random_number == 0:
word = input(player1, 'please enter a character: ')
print(player1, 'input:', word)
else:
word = input(player2, 'please enter a character: ')
print(player2, 'input:', word)
return word
#initial variables
word_confirm = ''
counter = 0
word_array = []
#character input loop
while word_confirm != 'yes':
#function call
word = output_func(player1, player2, random_number)
#append
word_array.append(word)
#alternate players turns
if random_number == 0:
random_number = 1
else:
random_number = 0
#check for exit after >=3 letters formed
if counter >= 2:
print('You have formed the letters:') #three letters
word_confirm = input('Has the word been formed? (type "yes" or
"no"): ')
word_confirm = word_confirm.lower()
counter += 1
complete_word = ''
i = 0
while i < len(word_array):
complete_word += word_array[i]
i += 1
if random_number == 1:
print(player1, 'Wins!')
print('The word was:', complete_word)
else:
print(player2, 'Wins!')
print('The word was:', complete_word)
first_to_a_word()
In: Computer Science
In: Computer Science
Write a spell checking program (java) which uses a dictionary of words (input by the user as a string) to find misspelled words in a second string, the test string. Your program should prompt the user for the input string and the dictionary string. A valid dictionary string contains an alphabetized list of words.
Functional requirements:
In: Computer Science
Computer Architecture
1. Define what a "word" is in computer architecture:
2. What is the difference between a register’s width and a register’s address? (choose all that apply - there may be more than one correct answer)
3. Which of the following is NOT implemented by the Program Counter?
4. What is the relationship between the size of the address (number of bits) and the word size for memory registers?
In: Computer Science
Write a Java program that prompts the user to input a word (String).
The program must print the reversed word with all consecutive duplicate characters removed.
The program must contain the following classes: -
The StackX class (you can use the Java Stack class). - The Reverse class which must contain a private data field called “word” of type string, a constructor, and a void method called revNoDup(). The revNoDup() method must reverse the word and remove the consecutive duplicate characters. The revNoDup() method must print the new word (i.e. reversed with consecutive duplicate characters removed). The revNoDup() method must use a Stack to reverse the word and remove the duplicate characters. - The Test class which must contain the main() method. In the main() method, you must prompt the user to input a word (String), create an object from class Reverse, and call the revNoDup() method.
Here is a sample run:
Enter a word:
Tomorrow
woromoT
In: Computer Science
17) Refer the previous question: The following table gives the common disorders, problems and complaints associated with each body system and its components relevant to the nursing care you might provide for your clients in the Australian health care system. Complete the following table with regard to its definition, pathophysiology, signs and impact of specific health procedures(in 10-20 words each). DISEASES AFFECTING THE MUSCULOSKELETAL SYSTEM Gout Gout
17.1) Definition Minimum word required : 10 Word count
17.2) Briefly outline the pathophysiology Minimum word required : 10 Word count
17.3) List four specific signs Minimum word required : 10 Word count
17.4) Impact of allopurinol on patients with gout. Minimum word required : 10
In: Nursing
Pig Latin is a language constructed by transforming English words. The following rules are used to translate English into Pig Latin:
*If the word begins with a consonant, then all consonants at the beginning of the word, up to the first vowel are removed then added to the end of the word, followed by “ay”. For example, “computer” becomes “omputercay” and “think” becomes “inkthay”.
*If the word begins with a vowel, then “way” is added to the end of the word. For example, “algorithm” becomes “algorithmway” and “office” becomes “officeway”.
*If the word ends in a punctuation mark, then the punctuation mark should remain at the end of the word after the transformation has been performed. For example, “science!” should become “iencescay!”. You can assume that the punctuation mark is only a single character. The program reads a line of text from the user and translates it into Pig Latin and displays the result.
This is in python.
In: Computer Science