Questions
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

Using SHA 256 in Cryptool find the hash values (hash digests) for the following messages: (Show...

Using SHA 256 in Cryptool find the hash values (hash digests) for the following messages: (Show your work by capturing screen images)

  1. Character 0 (note the word Character is not included)
  2. Character 1 (note the word Character is not included)
  3. Fort Valley State University is where talented students come simply for the opportunity to be brilliant. Located in the heart of Georgia, FVSU combines the personal attention and family feel of a small, private college with the resources and research found at large public universities. Located on the second largest acreage of any Georgia university, it is the only university in the world which at once is a University System of Georgia institution, a historically black university, and an 1890 land-grant institution, with a directive to use knowledge to improve the lives of students and non-students alike. Leveraging the reputation for excellence FVSU has built since 1895, the university is preparing students to embrace their genius as future global leaders and enabling discovery which will make real that only now imagined.
    That’s why our motto and tagline is “empower the possible.
  4. Change the message in 3 by 1 bit and find the hash of it. You need to explain how you change the message by a single bit

In: Computer Science

Identify the separation of powers between the three branches of government. Then, discuss how each branch checks and balances the other branches.

Write a 1,050- to 1,400-word essay that addresses the following:

Identify the separation of powers between the three branches of government. Then, discuss how each branch checks and balances the other branches.

Select and discuss a current event or issue from the past 5 years (possible areas include: health care reform, presidential appointments, and national security, for example). Then, discuss 1) how the separation of powers affects this issue and 2) how the checks and balances affects this issue.

In: History

The purpose of this assignment is discuss the importance of standards in the delivery of health care in the United States.


The purpose of this assignment is discuss the importance of standards in the delivery of health care in the United States. Write a 750-1,000 word paper summarizing the following criteria:

  1. Discuss the top five reasons standards are vital in the U.S. health care system.

  2. Chose one of most vital standards for your current or previous organization. Discuss how the standard influences the organization.

  3. Chose a standard that you believe needs improvement. Discuss the impact of the standard and propose a solution for its improvement.


In: Nursing

The law of demand is the first and primary law of economics. Do you agree? Explain...

  1. The law of demand is the first and primary law of economics. Do you agree? Explain the law of demand with the help of a clearly labelled diagram.              [Answer in 150 – 200 words]

[Draw in paper; take photo and paste/Use MS Word/add screenshot]

  1. Though, the law of demand is the primary law of economics, it is subject to certain limitations in the form of exceptions. Discuss any five such exceptions to law of demand with valid examples.

[Answer in 150 – 200 words]

microeconomics

In: Economics

I hvave assigment Dysrhythmia case study Each student to submet a case study that shows: a...

I hvave assigment

Dysrhythmia case study

Each student to submet a case study that shows:

  • a patient with any cardiac emergencies regarding dysrhythmias
  • treatment done to the patient, and the results if available
  • an ECG strip that shows the type of the dysrhthmia

Rules:

  • Submission with Word file
  • At least one paper count of work
  • Clear images
  • Due date: April 7th Tuesday
  • Mark deduction for LATE turn in.

Any type of dysrhythmia like heart block or asystole

In: Nursing