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
Write MVCTester.java. When the program starts, the initial screen displays a button labeled "add", a blank text area, and a text
Debora [2.8K]

Answer:

Kindly note that, you're to replace "at" with shift 2 as the brainly text editor can't take the symbol

Explanation:

import java.awt.event.*;  

import java.awt.geom.Area;

import javax.swing.*;

class MVCTester implements ActionListener{

JButton b; //button

JTextField t1; //textfiled

JTextArea area; //text area

MVCTester(){

JFrame f=new JFrame("Button Example");

//button

b=new JButton("add");  

b.setBounds(0,0,125,27);  

f.add(b);  

b.addActionListener(this);  

//textfiled

t1=new JTextField();  

t1.setBounds(0,161,125,24);  

f.add(t1);

//textarea

area=new JTextArea();  

area.setBounds(0,28,123,130);  

f.add(area);

area.setColumns (17);

area.setLineWrap (true);

area.setWrapStyleWord (false);

f.setSize(125,225);

f.setLayout(null);  

f.setVisible(true);

}

"at"Override

public void actionPerformed(ActionEvent arg0) {

Control c=new Control(area,t1,b);

}  

}  

class Control {

Control(JTextArea area,JTextField t1,JButton b){

//simple logic getting text of text area adding text of textfiled and setting the text to text area

area.setText(area.getText()+t1.getText()+"\n");

t1.setText("");

}

}

public class Modal{

public static void main(String[] args) {  

MVCTester be=new MVCTester();

}

}

8 0
1 year ago
Read 2 more answers
1. Discuss why it is so important for all application builders to always check data received from unknown sources, such as Web a
Ivan

Answer:

1. It is so important for all application builders to always check data received from unknown sources before using that data. This is because of the Security related reasons and vulnerabilities .For example the data received might contain harmful hidden viruses.  Web applications are accessed by internet and these are the most vulnerable to attacks by hacker or intruders using harmful data containing malware. This can cause security breaches due to the security flaws or bugs in Web applications. So to overcome such security risks which can cause damage in the Web applications, data from unknown sources should be checked.

Explanation:

2. When the Website is being used and running, there is a room for possible glitches or other bugs and issues. To understand, handle and address  issues successfully, the website operators carefully and consistently patch and configure their systems. The administrators collect the user data which enables them to have enough data in order to make the requisite alterations or improvements in the website. This also helps to improve the website performance. The patching and configuring of systems fix problems in the website which reduces the risk of website damage and the website works smoothly this way. Moreover it identifies vulnerabilities, solve configuration issues and upgrades in website features provide additional capabilities to the website.

8 0
2 years ago
Simon wants to use an invoice template created by Office.com. The first step after selecting the File tab is to select
wlad13 [49]
The type of file which can be PNG, Jpg, etc.
4 0
2 years ago
Edhesive 6.5 code practice question 4
Jlenok [28]

This question is incomplete. The complete question is given below:

Write a program that asks the user to enter ten temperatures and then finds the sum. The input temperatures should allow for decimal values.

Sample Run

Enter Temperature: 27.6

Enter Temperature: 29.5

Enter Temperature: 35

Enter Temperature: 45.5

Enter Temperature: 54

Enter Temperature: 64.4

Enter Temperature: 69

Enter Temperature: 68

Enter Temperature: 61.3

Enter Temperature: 50

Sum = 504.3

Answer:

# Program in Python

sum = 0.0

for i in range(0, 10):

t = float( input("Enter the Temperature: "))

sum = sum + t

print("Sum: {0:0.1f}".format(sum))

Explanation:

  • Initialize the sum variable to hold the sum of input temperatures .
  • Iterate from 0 to 9, Get the input and compute the sum .
  • Print the result  by formatting the sum so that value is printed with precision to single decimal place .
4 0
2 years ago
Read 2 more answers
_________ is a term used to describe the process of recording movement of an object and translating it into a digital format..
Sidana [21]
Mocap <span>is a term used to describe the process of recording movement of an object and translating it into a digital format</span>
5 0
2 years ago
Read 2 more answers
Other questions:
  • What might be one reason why a stock becomes more valuable over time
    5·1 answer
  • An administrator has initiated the process of deploying changes from a sandbox to the production environment using the Force IDE
    5·1 answer
  • In the context of a global information system (gis), _____ offer electronic data interchange standards, encryption, secure e-mai
    15·1 answer
  • Which of the following facts determines how often a nonroot bridge or switch sends an 802.1D STP Hello BPDU message?
    14·1 answer
  • Implement a class MyInt() that behaves almost the same as the class int, except when trying to add an object of type MyInt. Then
    11·1 answer
  • What technology gets its name from the notion that it ignores the traditional A, B, and C class designations for IP addresses?
    14·1 answer
  • "online privacy alliance (opa) is an organization of companies dedicated to protecting online privacy. members of opa agree to c
    15·1 answer
  • If Mark is developing a website to be optimized for mobile devices, what would be the top-level domain?
    10·1 answer
  • The function below takes two integer parameters: low and high. Complete the function so that it prints the numbers from low to h
    14·1 answer
  • Write a flowchart and C code for a program that does the following: Within main(), it asks for the user's annual income. Within
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!