1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zarrin [17]
4 years ago
15

Complete the getNumOfCharacters() method, which returns the number of characters in the user's string. We encourage you to use a

for loop in this function. (3) In main(), call the getNumOfCharacters() method and then output the returned result. (1 pt) (4) Implement the outputWithoutWhitespace() method, which outputs the string's characters except for whitespace (spaces, tabs). Note: A tab is '\t'. Call the outputWithoutWhitespace() method in main().
Computers and Technology
1 answer:
photoshop1234 [79]4 years ago
5 0

Answer:

The Java code is given below with appropriate comments

Explanation:

//Program

//Import the necessary libraries

import java.util.Scanner;

//Define the class

public class CountStringCharacters

{

//Start the main method

public static void main(String[] args)

{

//Prompt the user to enter the input line

Scanner scan = new Scanner(System.in);

System.out.println("Enter a sentence or phrase: ");

String s = scan.nextLine();

 

//Take the number of characters and keep the count

int numOfCharacters = getNumOfCharacters(s);

System.out.println("You entered: "+s);

System.out.println("Number of characters: "+numOfCharacters);

 

//Call the method outputWithoutWhitespace

outputWithoutWhitespace(s);

}

//The method getNumOfCharacters

public static int getNumOfCharacters(String s)

{

int numOfCharCount = 0;

for(int i=0; i<s.length();i++)

{

numOfCharCount++;

}

return numOfCharCount;

}

//Definition of the method outputWithoutspace

public static void outputWithoutWhitespace(String s)

{

String str = "";

for(int i=0; i<s.length();i++)

{

char ch = s.charAt(i);

if(ch != ' ' && ch != '\t')

str = str + ch;

}

System.out.println("String with no whitespace: "+str);

}

}

You might be interested in
Five varieties of software​
Georgia [21]

Answer:

accounting software

project management software

time tracking software

communication software

product pricing software

Explanation:

8 0
3 years ago
Hamish has created a website with an online booking system for his salon appointments. He wants to engage more with his customer
zubka84 [21]

Answer:

  1. Gather customer feedback: Email Survey
  2. Tell customers about the extended opening hours: Social Media Page
  3. Show customers Hamish’s latest hair looks: An online gallery
  4. Help customers find the new salon: A map

Explanation:

1. By sending a questionnaire or survey via email, Hamish can gather customer feedback. Customers can answer these questionnaires directly in attached questions. They can also give feedback over email. Email survery is an economical way to collect feedback and can be sent to a many customers at the same time.

2. Hamish can tell customers about opening hours by a Social Media Page is a mean to assist social media accounts through QR Codes. He can update with his salon information via this web page. When customers scan can see salon's logo, information etc on this page in order to follow.

3. Hamish can display his latest hair looks through an online gallery by sharing his photos to many people. These images are stored, organized  displayed and shared on the website (online gallery). This is a better option than using expensive albums and hard copies.

4. Hamish can help customers to find a new salon by providing a map on his website. This makes easier for customers to locate the new salon as map provides with the navigation information. Customers can get a route  from their current location to the salon.

5 0
3 years ago
A ________ provides quick access to context indicators, email, secure instant messaging, voice and video calling, conference cal
e-lub [12.9K]

Answer:

Universal dashboard

Explanation:

Universal dashboards is a web framework that help people manage their unified communications, providing quick access to context indicators, email, secure instant messaging, voice and video calling, conference calling, corporate RSS feeds, and more. The Mitel Unified Communicator Advanced is a software client that integrates all these features thereby making it possible for employees and co-workers to communicate. This software can also be used to integrate both a company’s ERP and customer relationship management system launching the customer information on the screen any to time a call is been made  such as customer name and location.

5 0
4 years ago
Tumblr, Jaiku is an example of _____________ website.
adelina 88 [10]

Answer:

<h3><u>Microblogging </u></h3>

  • <u>One of the best-known channels in the microblogging world. Twitter is a quick and convenient way to share short posts, GIFs, article links, videos and more. Pinterest: Companies on Pinterest link to products, articles and other useful information for </u><u>audiences </u><u>.</u>

Explanation:

<h2>Hope this helps you !! </h2>
3 0
2 years ago
java Consider the following problem statement. A cookie recipe calls for the following ingredients: 1.5 cups of sugar 1 cup of b
Veronika [31]

Answer:

Explanation:

The following code is written in Java. It creates a program that asks the user how many cookies they want to make. Then it adjusts the original recipe based on the ratio of the original amount of cookies it makes to the amount the user wants. Finally, passing the output of the new adjusted recipe to the user. Due to technical difficulties, I have added the code as a txt file attached below.

4 0
3 years ago
Other questions:
  • 2.Consider the following algorithm and A is a 2-D array of size ???? × ????: int any_equal(int n, int A[][]) { int i, j, k, m; f
    12·1 answer
  • Use a colon before a list and put one space after a colon. True False
    15·2 answers
  • What is the main piece of computer software on which every other piece of software relies?
    15·1 answer
  • You will be administratively suspended if you have a breath or blood alcohol level of.... or above or refuse to submit to a chem
    12·1 answer
  • You are the manager and two employees are having issues with each other. These issues are affecting their happiness and producti
    11·1 answer
  • Using computers in place of paper to design components, products, and processes is referred to as ______.
    11·1 answer
  • An adiabatic capillary tube is used in some refrigeration systems to drop the pressure of the refrigerant from the condenser lev
    15·1 answer
  • The most common threats to your computer and your online safety come from what is called ____
    11·2 answers
  • 4. In a relational database, entities are defined by
    6·1 answer
  • Which of the following can you use to judge source legitimacy?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!