Explain the differences among the frictional, structural and cyclical forms of unemployment.
Word Limit: Maximum 250 words
In: Economics
Explain in your own word the concepts of viscous damping, coulomb damping and stiffness force in a vibration system.
In: Physics
AP Psychology Chapter 1: History and Approaches
What are word examples of Empiricism, experimental psychology, and psychiatry.
In: Psychology
Master thesis on :
Blockchain technology and its uses on today's on today's business life. [at least 4000 word ]
In: Computer Science
what are the effects of leveling income inequality on developing states in the 21st century?
(answer in 200 word paragraph)
In: Economics
Provide a 250-400 word description of the issues DirectAccess addresses related to the use of VPNs within an organization.
In: Computer Science
Researchers conducted a study to investigate the effects of color on cognitive tasks. Words were displayed on a computer screen with background colors of red and blue. Results from scores on a test of word recall are given below:
|
Red Background: n = 35 |
15.89 |
s = 5.90 |
|
Blue Background: n = 36 |
12.31 |
s = 5.48 |
In: Statistics and Probability
In: Nursing
Create a class Sentence with an instance variable public Word[] words.
Furthermore: The class should have a constructor Sentence(int size), where size determines the length of the sentence field of a given Sentence.
The class should have an instance method public boolean isValid() that determines the validity of a sentence according to the rules detailed below.
Also create a public nested class Word, with instance variables String value and Type type.
Within this class, you must create: A public enum type Type that contains NOUN, ADJECTIVE, and VERB. The constructor Word(String value, Type type).
RULES FOR SENTENCE VALIDITY:
1.A sentence must have a length of at least 1.
2. A NOUN must be followed by a VERB (unless it is at the end of a sentence).
3.An ADJECTIVE must be followed only by another ADJECTIVE or a NOUN.
4.A sentence must have one and only one VERB.
5. A sentence must end in a NOUN or in a VERB.
In: Computer Science
In C++
For this assignment, you will write a program to count the number of times the words in an input text file occur.
The WordCount Structure
Define a C++ struct called WordCount that contains the following data members:
Functions
Write the following functions:
int main(int argc, char* argv[])
This function should declare an array of 200 WordCount objects and an integer numWords to track the number of array elements that are in use.
If no input file name is specified as a program argument when the program is run, then argc will be equal to 1. If so, print an error message similar to the following and exit the program:
Usage: assign1 [file-name]
Call the function countWords() passing argv[1] as the file name parameter. Store the value returned by the function in numWords.
Call the function sortWords() to sort the array.
Print a header line as shown in the sample output, then call printWords() to print the words and their counts.
int countWords(const char* fileName, WordCount wordArray[])
Parameters: 1) A C string that will not be changed by the function and that contains the name of an input file; 2) an array of WordCount objects.
Returns: The number of distinct words that the function stored in the array (i.e., the number of array elements filled with valid data).
This function should declare a file stream variable and open it for the file name passed in as the first parameter. If the file fails to open successfully, print an error message and exit the program.
Declare an integer numWords to keep track of the number of distinct words stored in the array of of WordCount objects. This variable should be initialized to 0.
The function should then read words from the file as C strings using the >> operator until end-of-file is reached. For each word read, the function should do the following:
Once all words have been read from the file, the file should be closed and numWords should be returned.
void stripPunctuation(char* s)
Parameters: 1) A C string that contains a word to be stripped of punctuation.
Returns: Nothing.
This function should remove any punctuation characters at the beginning and end of the C string s. For example:
It is possible (although rare) for a string to contain nothing but punctuation characters. In that case, the result of executing this function should be an empty string.
There are a number of valid approaches to solving this problem.
You will need to be able to distinguish between punctuation characters and non-punctuation (or alphanumeric) characters; the C library functions isalnum() and ispunct() can help you do that.
Performing the required modifications to the string "in place" may be difficult, so feel free to use a local temporary character array to make your changes and then copy the final result back into s at the end of the function.
void stringToUpper(char* s)
Parameters: 1) A C string that contains a word to be converted to uppercase.
Returns: Nothing.
This function should loop through the characters of the C string s and convert them to uppercase using the C library function toupper().
int searchForWord(const char* word, const WordCount wordArray[], int numWords)
Parameters: 1) A C string that will not be changed by this function and that contains a word to search for; 2) an array of WordCount objects to search that will not be changed by this function; 3) the number of elements in the array filled with valid data.
Returns: If the search was successful, returns the index of the array element that contains the word that was searched for, or -1 if the search fails.
This function should use the linear search algorithm to search for the C string word in wordArray.
void sortWords(WordCount wordArray[], int numWords)
Parameters: 1) An array of WordCount objects to sort; 2) the number of elements in the array filled with valid data.
Returns: Nothing.
This function should sort the array of WordCount objects in ascending order by account number using the selection sort algorithm.
The sort code linked to above sorts an array of integers called numbers of size size. You will need to make a number of changes to that code to make it work in this program:
Change the parameters for the function to those described above.
In the function body, change the data type of temp to WordCount. This temporary storage will be used to swap elements of the array of WordCount objects.
In the function body, change any occurrence of numbers to the name of your array of WordCount objects and size to numWords (or whatever you called the variable that tracks the number of array elements filled with valid data.
The comparison of numbers[j] and numbers[min] will need to use the C string library function strcmp() to perform the comparison. The final version of the if condition should look something like this:
if (strcmp(wordArray[j].word, wordArray[min].word) < 0)
...
It is legal to assign one WordCount object to another; you don't need to write code to copy individual data members.
void printWords(const WordCount wordArray[], int numWords)
Parameters: 1) An array of WordCount objects to print that will not be changed by this function; 2) the number of elements in the array filled with valid data.
Returns: Nothing.
This function should loop through the array and print each word and its corresponding count, neatly formatted into columns similar to the sample output. It should also print the number of words in the file (which is equal to the sum of the counts) and the number of distinct words (equal to numWords).
Text File:
Text Files - A Brief Description (Wikipedia, 2019) A text file (sometimes spelled "textfile"; an old alternative name is "flatfile") is a kind of computer file that is structured as a sequence of lines of electronic text. A text file exists stored as data within a computer file system. The end of a text file is often denoted by placing one or more special characters, known as an end-of-file marker, after the last line in a text file. Such markers were required under the CP/M and MS-DOS operating systems. On modern operating systems such as Windows and Unix-like systems, text files do not contain any special EOF character. "Text file" refers to a type of container, while plain text refers to a type of content. Text files can contain plain text, but they are not limited to such. At a generic level of description, there are two kinds of computer files: text files and binary files.
In: Computer Science