answer.
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
Delvig [45]
2 years ago
11

Write a loop that counts the number of space characters in a string. Recall that the space character is represented as ' '.

Computers and Technology
1 answer:
Jlenok [28]2 years ago
3 0

Answer:

I am writing Python program.

string = input("Enter a string: ")

print(string.count(' '))

Explanation:

The first statement takes input string from the user.

input() is used to read the input from the user.

The next statement uses count() function to count the number of times the specified object which is space ' ' here occurs in the string.

The print() function is used to return the number of times the space occurs in the string entered by the user.

Output:

Enter a string: How are you doing today?

4

The screenshot of program and its output is attached.

You might be interested in
Use the AND function with appropriate arguments in cell H11 to determine if there is a force out at third base. There is a force
Pie

Answer:

=AND($C11 = "Yes", $D11 = "Yes")

Explanation:

The AND function takes conditional inputs and tests if each of them are TRUE. If all of the inputs are TRUE, the function will output TRUE but if any one of them are not the function will output FALSE. This scales to multiple inputs but this example only has two conditions. It is important to remember that we want to compare a string so our condition must be "Yes", not just Yes.

We also use a relative cell reference, "$", on the columns C and D since we always want to use the "Runner on 1st" and "Runner on 2nd" columns.

6 0
2 years ago
The ________ program displays graphics and loading screens during the boot process.
Minchanka [31]
Booting would be complete if the normal, runtime environment has been achieved. A boot loader is a program that loads operating system for the computer after the completion of power on tests. The boot manager is a program that displays graphics and loading screens during the boot process.
3 0
2 years ago
When excel follows the order of operations the formula 8 * 3 + 2 equals?
Airida [17]
It follows the normal convention of BODMAS , which is the order of precedence of operations , so the answer equals to 26
3 0
2 years ago
In this exercise you will debug the code which has been provided in the starter file. The code is intended to take two strings,
vampirchik [111]

Answer:

Here is the corrected program:

import java.util.Scanner; //to accept input from user

public class 02_14_Activity_one { //class name

    public static void main(String[] args) { //start of main method

    Scanner scan = new Scanner(System.in); //creates Scanner class object

  System.out.println("Enter first string"); //prompts user to enter first string

          String s1 = scan.nextLine(); //reads input string from user

  System.out.println("Enter second string"); //prompts user to enter second string

          String s2 = scan.nextLine(); //reads second input string from user

    System.out.println("Enter number of letters from each word"); //enter n

          int n = scan.nextInt(); //reads value of integer n from user

          System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));

         } } //uses substring method to print a string made up of the first n letters of s1 and the last n letters of s2.

Explanation:

The errors were:

1.

Scanner scan = Scanner(System.in);

Here new keyword is missing to create object scan of Scanner class.

Corrected statement:

 Scanner scan = new Scanner(System.in);

2.

String s1 = nextLine();  

Here object scan is missing to call nextLine() method of class Scanner

Corrected statement:

String s1 = scan.nextLine();

3.

String s2 = Scanner.nextLine();

Here class is used instead of its object scan to access the method nextLine

Corrected statement:

String s2 = scan.nextLine();

4.

String n = scan.nextLine();

Here n is of type String but n is a whole number so it should be of type int. Also the method nextInt will be used to scan and accept an integer value

Corrected statement:

int n = scan.nextInt();

5.

System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));

This statement is also not correct

Corrected statement:

System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));

This works as follows:

s1.substring(0,n) uses substring method to return a new string that is a substring of this s1. The substring begins at the 0th index of s1 and extends to the character at index n.

s2.substring(s2.length() - n ) uses substring method to return a new string that is a substring of this s2. The substring then uses length() method to get the length of s2 and subtracts integer n from it and thus returns the last n characters of s2.

The screenshot of program along with its output is attached.

7 0
2 years ago
. Question 2 Fill in the blank: R Markdown notebooks can be converted into HTML, PDF, and Word documents, slide presentations, a
Levart [38]

R markdown notebook describes a notebook format in R programming which supports R programmers to run codes while also writing documents or explanation alongside. Hence, the missing option is Dashboard.

  • R markdown may be compared to jupyter notebooks which also supports writing in markdown language.

  • The R markdown notebooks can be created using the R studio, which allows the conversion notebooks of these notebooks into several different formats including the creation of dashboards.

Hence, R markdown notebooks can be converted to <em>HTML</em><em> </em><em> </em><em> </em><em>PDF</em><em>,</em><em> </em><em>word</em><em> </em><em>document</em><em>,</em><em> </em><em>slide</em><em> </em><em>presentation</em><em> </em><em>and</em><em> </em>dashboards.

Learn more :brainly.com/question/25575402

3 0
1 year ago
Other questions:
  • An asterisk (*) following a cell reference in a formula is the arithmetic operator that directs excel to perform the division op
    7·1 answer
  • A(n) _____ is the highest educational degree available at a community college. master bachelor associate specialist
    13·2 answers
  • A search box does all of the following EXCEPT ________.
    12·2 answers
  • The ________ method is based on simple arithmetic. The process involves dividing the bits of a frame into equal segments, adding
    11·1 answer
  • You have been tracking your exercise routine, which involves running, lifting weights, yoga, and stretching. You want to see wha
    15·2 answers
  • Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search.
    11·2 answers
  • Suppose that, when you arrive at the sale site for $50 Apple laptops (described in the text) at 1:45 A.M., you find more than 2,
    8·1 answer
  • Consider the following 3-PARTITION problem. Given integers a1; : : : ; an, we want to determine whether it is possible to partit
    10·1 answer
  • Why do agriculture and natural resource systems vary from state to state?
    8·1 answer
  • Describe the ways in which a computer-aided design (CAD) drawing makes the details of an image easier to understand.
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!