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
nata0808 [166]
3 years ago
9

Implement the function charCnt. charCnt is passed in a name of a file and a single character (type char). This function should o

pen the file, count the number of times the character is found within the file, close the file, and then return the count. If the file does not exist, this function should output an error message and then call the exit function to exit the program with an error value of 1.
Computers and Technology
1 answer:
SVEN [57.7K]3 years ago
7 0

Answer:

Answered below

Explanation:

//Program is written in Python programming language

def charCnt( fileName, char){

if not fileName.exists( ):

return sys.exit(1)

else:

openFile = open("$fileName.txt", "r")

readFile = openFile.read( )

fileLength = len (readFile)

count = 0

for character in range(fileLength):

if readFile[character] == char:

count++

openFile.close( )

return count

}

You might be interested in
What tab should you choose if you want to practice presenting with your PowerPoint slides?
dezoksy [38]

Answer:

i think its slideshow tab

Explanation:

tell me if im right

6 0
3 years ago
Read 2 more answers
The new tag in HTML 5 means that it explanation or pronunciation of characters for Asian typography O sets a container for an ex
Eddi Din [679]

Answer:

yes very correctExplanation:

5 0
3 years ago
Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil
zvonat [6]
Define variables
left is l
right is r

Ask input
left or right

Ask input value

Equate l or r to the input value

Show ladder with steps equal to input value and in the side of input variable
7 0
3 years ago
Lisa manages incident response for a bank. The bank has a website that’s been attacked. The attacker utilized the login screen,
kari74 [83]

Answer:

The answer is C) SQL Injection

Explanation:

Cross-Site Scripting (XSS) attacks are a type attacks that occur when an attacker uses a web application to send malicious code, generally in the form of a browser side script, to a different end user.

Cross-Site Request Forgery (CSRF) is a type of attacks specifically target state-changing requests, not theft of data, since the attacker has no way to see the response to the forged request.

SQL Injection is a type of cyber security attack where an attacker inputs a malicious input into an SQL statement., and the SQL server reads it as programming code.

Address Resolution Protocol poisoning (ARP poisoning) is a form of attack in which an attacker changes the Media Access Control (MAC) address and attacks an Ethernet LAN by changing the target computer's ARP cache with a forged ARP request and reply packets.

From the above brief definition; it is seen that the answer is C) SQL Injection.

3 0
3 years ago
what type of internet monitoring technique records information about a customer during a web surfing session, such as what websi
ASHA 777 [7]

The <u>clickstream </u>is a type of internet monitoring technique records information about a customer during a web surfing session, such as what websites were visited and how long the visit was, what ads were viewed, and what was purchased.

<h3>What is the meaning of clickstream?</h3>

The clickstream data is known to be a kind of information that is said to be obtained about a user if and when they browse via a website or they are known to have used a web browser.

Note that the Clickstream analytics is seen as the act  of tracking, evaluating and reporting data on a given pages that a said  user visits and user behavior that is done when they were on a webpage.

Hence, The <u>clickstream </u>is a type of internet monitoring technique records information about a customer during a web surfing session, such as what websites were visited and how long the visit was, what ads were viewed, and what was purchased.

Learn more about internet monitoring technique  from

brainly.com/question/14723222

#SPJ1

8 0
2 years ago
Other questions:
  • What is computer engineering?
    11·1 answer
  • Insert a row above the selected row
    11·2 answers
  • Which partitioning method must you use for a 4-tb hard drive?
    13·1 answer
  • How many instructions can the microprocessor execute each second if the assembly line is present?
    12·1 answer
  • Which type of financial institution typically has membership requirements?
    14·1 answer
  • Code the function definition for aNonclassFunction, picking up co. aNonclassFunction has no return value.
    8·1 answer
  • "Rights and duties are two sides of the same coin." Explain with examples​
    5·1 answer
  • 1. What are the advantages and disadvantages of technology in communication?
    9·2 answers
  • An independent penetration testing company is invited to test a company's legacy banking application developed for Android phone
    13·1 answer
  • O How basic blocks are identified and how the blocks are used to construct control flow graphs
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!