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
Which success factor or reward of IS implementation enables you to see the real-time status or availability of a process or prod
trasher [3.6K]

Answer:

efficiency ( A )

Explanation:

Information systems ( IS ) implementation in business helps to create a competitive advantage for the business in the market where its products or services are sold .

A good/successful information system will be bring to light the real time status of a product by showcasing the products efficiency in real time to the potential/ returning customers who needs the product. showcasing the efficiency of a product over another similar products is a very good way to gain a very good advantage over other similar products.

The quality and productivity of the product cannot be affected  via the information systems. while the visibility of the product is done by the marketing department. the information systems give a real time detail of a product mentioning its composition and efficiency in real time.

7 0
4 years ago
Write an algorithm that describes the second part of the process of making change (counting out the coins and bills).
Alenkasestr [34]

An Algorithm that describes the second part of the process can be written as listed below :

<h3>Algorithm describing the second part of the process of making change (counting out the coins and bills ) </h3>

<u>First step</u> : Initialize the required variables to zero to determine the number of coins and bills.

<u>Second step</u> : Prompt and read the amount to convert. amount to Hundreds

<u>Third step</u> : Compute hundred bill note as 100 amount equal to  ( amount% * 100 fifties - amount )

<u>Fourth step </u>: Compute fifty bill notes as :  ( amount% * 50 fifty bill notes )

<u>Fifth Step</u> : Compute Twenty bill notes as amount equal to ( amount% *20 Twenties - amount )

<u>Sixth Step</u> : Compute Tens bill notes as : ( amount% * 10 Tens bill notes )

<em>Note : continue the process for fives, Quarters, Dimes, Nickels, and Pennies. </em>

<em />

Learn more about Algorithm : brainly.com/question/13800096

#SPJ1

<u>Attached below is the missing part of the question </u>

<em>Write an algorithm that describes the second part of the process of making change (counting...</em>

3 0
2 years ago
Which image shows organic shapes? <br> A. image 1 <br> B. image 2 <br> C. image 3 <br> D. image 4
solniwko [45]
Image 3.

Hope this helps!!
4 0
3 years ago
Read 2 more answers
A _____ is a description that involves "telling" the database management system (DBMS) the logical and physical structure of the
alexandr402 [8]

Answer:

the right answer to the question is schema

Explanation:

The database schema of a database is its structure described in a formal language supported by the database management system (DBMS). The term "schema" refers to the organization of data as a blueprint of how the database is constructed

5 0
3 years ago
Which of the following statements is true regarding how Wireshark works? a. Where packets are captured and how they are captured
I am Lyosha [343]

Answer:

b. By running the Wireshark software on the same computer that generates the packets, the capture is specific to that machine.

Explanation:

By running the Wireshark software on the same computer that generates the packets, the capture is specific to that machine. is true regarding how Wireshark works.

4 0
3 years ago
Other questions:
  • Which of the following sentences is most appropriate for written communication at work or with a customer?
    12·2 answers
  • Check
    15·1 answer
  • Right click on a spot of your desktop that is not covered by an icon, window, or menu. when the menu comes up, play with the opt
    7·1 answer
  • What is the Java source filename extension? What is the Java bytecode filename extension?
    14·1 answer
  • Write a program that uses an "if" statement to determine if the number is greater than one. If the number is greater than 1, the
    9·1 answer
  • What was Pike's objective on his first expedition in 1805?​
    9·1 answer
  • A gui allows you to interact with objects on the screen such as icons and buttons true or false
    7·1 answer
  • Two friends can share 100 songs from their Bluetooth enabled mobile devices
    13·1 answer
  • Write a program to play an automated game of Rock, Paper, Scissors. Two players make one of three hand signals at the same time.
    9·1 answer
  • How dose computers it use the information to solve problems
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!