EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
Expert Solution & Answer
Book Icon
Chapter 7, Problem 3PE

a.

Explanation of Solution

Program:

File name: “CountSpaces.java

//Define a class named CountSpaces

public class CountSpaces

{

    //Define main method

    public static void main(String[] args)

    {

        //Read a String that holds an inspirational quote

        String aString =

        "The best and most beautiful things in the world " +

"cannot be seen or even touched - they must be felt with the heart.";

        //Declare the variables and initialize the value

        int numSpaces = 0;

        int stringLength = aString...

b.

Explanation of Solution

Program:

File name: “CountSpaces2.java

//Import necessary header files

import java.util.*;

//Define a class named CountSpaces2

public class CountSpaces2

{

    //Define main method

    public static void main(String[] args)

    {

        //Create an object for the Scanner class

        Scanner in = new Scanner(System.in);

        //Declare the variables and initialize the value

        String aString;

        int stringLength;

        int numSpaces = 0;

        //Prompt the user to enter an inspirational quote

        System.out.print("Enter an inspirational quote >> ");

        aString = in.nextLine();

        //Read the length of the string

        stringLength = aString...

Blurred answer
Students have asked these similar questions
The FKGLF is:  0.39(totalWords/totalSentences) + 11.8(totalSyllables/totalWords) - 15.59Using the FKGLF and your knowledge of how to input and output text files with Java, write an application that will: Take in a text file (anyText.txt), Correct the spelling then save to another file (anyTextCorrected.txt), Calculate the grade level.  Outputs.  Your solution needs to return: the number of words in the text, the number of spelling errors corrected with the misspelled words listed, the number of sentences in the text, the number of syllables in the text, and the Flesch-Kincaid Grade Level. One assumption you can make is the accuracy of SpellChecker().  You have access to the Java method SpellChecker that takes in a string, assumed to be a word, and returns a correctly spelled word.  (Note: If the word returned is different than the word input, then there was a spelling error.)   One Constraint:  This program requires two classes:  GradeLevel and GradeLevelTest.  GradeLevel will be the…
This question comes from the textbook:Starting out with Visual C# 5th Edition - Chapter 14 Programming Problem 2 Create an application that reads the contents of two text files and uses LINQ extension methods to perform the following: • It should display a list of all the unique words contained in both files.• It should display a list of the words that appear in both files.• It should display a list of the words that appear in the first file but not the second.• It should display a list of the words that appear in the second file but not the first.• It should display a list of the words that appear in either the first or second file but not both. Hint: Use set operations to perform these analyses. Also, see Chapter 8 for a discussion of string tokenizing.
Now three isn't going to the loop. How can I prompt the user to enter the college and city five times. Enter the cost and ticket price together. What is the best way?#include "stdafx.h" #include <iostream>#include <cstdlib>#include <ctime>#include <string>#include <vector>#include <cctype>#include <string> using namespace std; string FBTeam;string College;string location; int Price_of_Ticket;int choice;     int main(){cout << "--------------------------------------------------------------------------------" << endl;cout << " Texas Colleges " << endl;cout << "--------------------------------------------------------------------------------" << endl;cout << endl << endl;vector<string> CULIST;vector<string> FBTEAM;{repeat:; cout << "\n\n1. Add Colleges and City" << endl;cout << "2. Add Football Team and Ticket Price" << endl;cout << "3. Calculate Total…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,