Questions
Email 1 Subject: Awk Utility Assessment 1 File: awk-utility-assessment-1.awk Create awk commands to remove all occurrences...


Email 1
Subject: Awk Utility Assessment 1
File: awk-utility-assessment-1.awk
Create awk commands to remove all occurrences of the word "PCC" from the input
stream. Your output should be a copy of each input line, with the word PCC
removed wherever it occurs.
      
Email 2
Subject: Awk Utility Assessment 2
File: awk-utility-assessment-2.awk
Create awk commands to remove the first and last words from each line of the
input (assume all lines contain 3 or more words). Your output should be a
copy of each input line, with the first and last words removed.

Email 3
Subject: Awk Utility Assessment 3
File: awk-utility-assessment-3.awk
Create awk commands to count the number of digits in the input.
Your output should be a single number.

Email 4
Subject: Awk Utility Assessment 4
File: awk-utility-assessment-4.awk
Create awk commands to calculate the sum of all digits in the input.
For example, if the input contains the number 123 in the first line,
and the number 456 in the last line, the output should be 21.
Your output should be a single number.

In: Computer Science

Write a modularized, menu-driven program to read a file with unknown number of records. Input file...

Write a modularized, menu-driven program to read a file with unknown number of records.

  • Input file has unknown number of records of inventory items, but no more than 100; one record per line in the following order: item ID, item name (one word), quantity on hand , and a price
  • All fields in the input file are separated by a tab (‘\t’) or a blank ( up to you)
  • No error checking of the data required
  • Create a menu which allows to
    • print inventory unsorted
    • search for an item by ID or name
    • sort by any field in ascending order (smallest to largest): item ID, item name (one word), quantity on hand , or price. Write one function, that can sort by any field. Do not copy and paste sort code five times into the same function. Tip: use bubble sort. It is easier to modify.
    • quit the program
  • A user should be able to run many as many times as user wants
  • NO goto, continue, break (except for switch)
  • Clearly label the output
  • Well document your code (comments)
  • Include your test data
  • All items are unique

Record sample:

997196478 Stroller 25 134.78

In: Computer Science

Regular expressions are used in Python for describing and identifying specific patterns. In Python, we use...

Regular expressions are used in Python for describing and identifying specific patterns. In Python, we use “re” or “Regex” to denote regular expressions.

  1. Write the Python Code to return matching analytics word in the following given text.
  2. Write the Python Code to return how many times analytics word is provided in this text.

Definitions are useful to the extent they serve a purpose. So, is defining analytics important?

Yes and no. It’s not likely that we’ll ever arrive at a conclusive definition of analytics, but discussing what is and isn’t within its realm provides cohesive boundaries; boundaries that can help analytics emerge as an academic discipline, a field of business or a career. We cogently talk about mathematics even though it covers many varied topics. Analytics hasn’t quite reached that point. Understanding its boundaries can help people considering analytics appreciate what they’re getting into. In particular, it can help companies wanting to pursue analytics understand what will work best in their business. This is especially important given that the growth of analytics is leading consultants and software vendors, many of whom don’t fully grasp what analytics can offer, to jump into the fray.

Source: http://analytics-magazine.org/profit-center-what-is-analytics/

In: Computer Science

A study was done to explore the number of chocolate bars consumed by 16-year-old girls in...

A study was done to explore the number of chocolate bars consumed by 16-year-old girls in a month's time. The results are shown below. Number of Chocolate Bars Consumed 56 46 12 62 39 24 59 51 39 52 28 41 10 64 27 0 34 5 55 32 42 24 14 63 1 63 52 58 52 26 Use the data from the chocolate bar study to answer the following questions. Use SPSS for all calculations. Copy and paste the SPSS output into the word document, highlighting the correct answer. Additionally, type the correct answer into your word document next to the corresponding question. 1. Identify the level of measurement used in this study. 2. Using SPSS, run descriptive statistics on the data: a. Find the mean, median, and mode of the number of chocolate bars consumed by 16-year-old girls in a month. b. Find the variance and standard deviation of the number of chocolate bars consumed by 16-year-old girls in a month. 3. Create a frequency distribution table with six intervals/classes. 4. Create a histogram based on the Frequency table in problem 3.

In: Math

Java: The goal is to find the number of unique words found in a story file...

Java:

The goal is to find the number of unique words found in a story file text.txt but there some conditions

1. each such word must be found in the dictionary WordList.txt file,

2. each such word should not be among the commonly used ones such as a, it, etc. Such forbidden words are listed in a separate file called stopwords.txt.

Output will be the single number which is the number of unique words in the story file. Use only ArrayLists or arrays as data structures for your coding and eliminate anything other than a-z,A-Z, lowercasing each, removing empty strings.

text.txt:

Louisa May Alcott's novel brings to life vividly the life of New England during the nineteenth century. A life that was tranquil, secure, and productive. It is little wonder, for she drew on her own and on her family's experiences for her work. As one of four daughters growing up in Boston.

WordList.txt:

i
we
did
sometimes
oh
travels
here
there
but
now
it
you
not
alone
serves
neighboring
disk
digitized
aardvark
aardwolf
tranquil

secure

productive.
abandon
abandoned
abandonment
abandons

stopwords.txt:

i
me   
my   
myself
we
our
ours   
ourselves
you
your   
yours
yourself   
yourselves   
he   
him
his

In: Computer Science

Instructions Today, all input and output has been taken care of for you. All you need...

Instructions

Today, all input and output has been taken care of for you. All you need to do is finish off the function wordCount that calculates the number of words in a string.

Function Details

Input

  • Input has been handled for you. A string will be read in.

Processing

  • Complete the wordCount function. Note that you have been given Java comments describing its expected parameters and return value.
/**
 * wordCount (String) -> int
 * Calculates the number of words in a given string
 * @param ?? (str): String of words
 * @return Number of words in the string (int)
 */
  • The method takes in a string. It then calculates the the number of words in that string and returns that value.

    HINT: This can be done by first splitting the string into individual words using the String.split() method. Then you just need to count how many objects the array holds (and there is an array method for that as well!

Output

  • Output has also been taken care of for you.

Sample input/output:

use JAVA method complete this question

Input Output
I have really enjoyed teaching this class and all of you!

Word count: 11

I am designing a test and do not want to get bogged down in what the text actually says.

Word count: 19

In: Computer Science

For this lab you are going to practice writing method signatures, implementing if statements, manipulating Strings,...

For this lab you are going to practice writing method signatures, implementing if statements, manipulating Strings, and improve your skills with for loops. The methods you will write will be part of a short trivia game, feel free to try it out after you finish.  

import java.util.Scanner;

public class Trivia {

//TODO: isLeapYear

//TODO: isPrime

//TODO: aWord

//TODO: reverse

public static void main(String[] args){
Scanner answers = new Scanner(System.in);
int score = 0;
System.out.println("What year is a Leap Year?");
// if(isLeapYear(answers.nextInt())){
// System.out.println("Correct!");
// score++;
// }
// else{
// System.out.println("Incorrect");
// }

// System.out.println("What is a prime number between 100-300?");
// if(isPrime(answers.nextInt())){
// System.out.println("Correct!");
// score++;
// }
// else{
// System.out.println("Incorrect");
// }

// System.out.println("What is a five letter word with an 'a' in the middle?");
// if(aWord(answers.next())){
// System.out.println("Correct!");
// score++;
// }
// else{
// System.out.println("Incorrect");
// }

// System.out.println("What word is a palindrome?");
// if(reverse(answers.next())){
// System.out.println("Correct!");
// score++;
// }
// else{
// System.out.println("Incorrect");
// }

if (score == 0){
System.out.println("Oof, better luck next time");
}
else{
System.out.println("Nice! You got " + score + " out of 4 right!");
}
}
}

Program output displayed here

What year is a Leap Year? Oof, better luck next time

In: Computer Science

An alliteration is a stylistic device in which successive words begin with the same letter (or...

An alliteration is a stylistic device in which successive words begin with the same letter (or sometimes the same sound). In our case we will only consider alliterations that follow the "same letter" property. It is often the case that short words (three letters or less) are inserted to make the sentence make sense. Here are some examples of alliterations:

  • alliteration's artful aid

  • Peter parker's poems are pretty

  • Round the rugged rock the ragged rascal ran

  • Peter Piper picked a peck of pickled peppers

Your program will ignore words that are three letters or less when searching for alliterations. For this program, you may assume that the first word of the sentence is at least 4 letters long. For this part of your lab, you will write a java program that asks the user to enter a sentence, word or phrase, and respond by telling the user if the input is an alliteration.

An example of your program's interactions are shown below:

ALLITERATION DETECTOR

ease enter a sentence: Peter parker's poems are pretty

Your input was: "Peter parker's poems are pretty"

The input is an alliteration

ALLITERATION DETECTOR

Please enter a sentence: Able was I ere I saw Elba

Your input was: "Able was I ere I saw Elba"

The input is not an alliteration

In: Computer Science

using Matlab only please. function sail_boat x = linspace(0,100,2*pi); for x plot(x, sin(x),'b','LineWidth',3) axis([0,2*pi+.1,-1.05,1.05]) hold on...

using Matlab only please. 

function sail_boat
x = linspace(0,100,2*pi);
for x
    plot(x, sin(x),'b','LineWidth',3)
    axis([0,2*pi+.1,-1.05,1.05])
    hold on
    boat(x,sin(x))
    pause(.05)
end
 
function boat(x,y)
xc = [x-.1,x+.1,x+.2,x-.2,x-.1];
yc = [y,y,y+.1,y+.1,y];
plot(xc,yc,'k')

The function is supposed to plot a sine curve and an animation of a representation of a boat moving on top of the curve, but the code has several errors. Notice that the program uses modulization and it calls another function inside sail_boat. Correct the code and submit it with a new name sail_boat_correct.m Note that the code uses the function linspace(). We have seen it before but if you are not familiar with it, make sure to look it up. The pause() function is used in the animation, causing the plotting to pause for 0.05 seconds, aiding in the visualization. Also, submit a Word document providing a quick description of what edits you had to make and how you went about finding the errors. Name the Word document Debugging.docx.

In: Computer Science

You are the Production Department manager at Kibby and Strand, and last month there were complaints...

You are the Production Department manager at Kibby and Strand, and last month there were complaints from customers that the quality of the products shipped to them was lacking. Some shirts were labeled with incorrect sizes and girl’s shorts had weak stitching that did not meet specifications. The Operations Manager tasks you to prepare a plan for conducting a Root Cause Analysis (RCA) to identify the causes of these quality issues. In addition, he recently read the article 3 Ways to Manage Garment Quality Control and prepare a paper detailing how the quality inspections in the article can be implemented within Kibby and Strand.

The student is to create the RCA plan and paper based on knowledge learned in the scenario, and post it in the discussion. Note: it is not possible to actually conduct the RCA and document findings because the data is not provided in the scenario.

The RCA plan and paper should be prepared in a single Microsoft™ Word document, and then attached to the unit discussion thread. There is no minimum or maximum in terms of the word count; however, the response should explicitly address all required components of this discussion assignment. The document should be prepared consistent with the APA writing style (6th edition) and reflect higher level cognitive processing (analysis, synthesis and or evaluation).  

In: Operations Management