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
are the network administrator for your company. You are installing a new printer in the network. When you check the print server
melamori03 [73]

Answer:

Will have to run the net start spooler command.

Explanation:

  • The printer spooler seems to be accountable for overseeing incoming faxes that have been in effect intended for handling by the printer. Whether this device stops operating, your printer won't publish documentation as well as the machine may not notice it either.
  • To solve these problems, you'll need to run the net start spooler command using the least administrative effort.
5 0
3 years ago
Match the appropriate color mode with the correct definition
Gemiola [76]

Answer:

1.RGB: Best for projects intended to be used on the web or video

Explanation:

On websites or making project RGB combination of colors is used. This combination of colors is used to store images in electronic components.

2. CMYK: best for professional printing projects using process colors

Explanation:

Printing professional use CMYK combinations of color for better printing results.

3.) indexed:The only colors saved are the colors used in the image

To manage digital images we use Indexed mode of colors.

Explanation:

4.) bitmap: uses black and white

Explanation:

bitmap is the combination of the black and white colors. As the images are large in size so that, to reduce the size of the image we store image in bitmap to reduce the size.

5.) gray scale: uses different shades of grey

Explanation:

The different shades of gray colors are found in the gray scale. These shades are used to produce images.

4 0
3 years ago
What does "CYBER-COCKROACH" mean??
katrin2010 [14]

Answer:

The cyber cockroach is the presented external anatomy of a cockroach, with labeled views of photographs from diverse angles in place of diagrams. The cyber cockroach can be navigated around the head, thorax and abdomen with possible close up views of the legs and the images are downloadable

Cyber cockroach is a useful tool for the study of insects of the Blattodea order

Explanation:

3 0
3 years ago
How can a PowerPoint user add a shadow to a table
damaskus [11]
Https://wordribbon.tips.net/T010192_Drop_Shadows_for_Tables.html
8 0
3 years ago
Can someone pls answer this question within 30 min <br> Will give extra points
balandron [24]

Answer:

whats the question

Explanation:

wont show anything on the doc

7 0
3 years ago
Other questions:
  • G=D+(A+C^2)*E/(D+B)^3 Rewrite the above formula in terms of doing concurrent processing using cobegin and coend to identify thos
    12·1 answer
  • Which of the following describes a hash algorithms ability to avoid the same output from two guessed inputs?A. Collision avoidan
    12·1 answer
  • Customer A with a Bronze service level package calls in a Critical System Failure at 9:00 AM. Customer B with a Silver service l
    15·1 answer
  • Grandma Ester normally gives you hugs for your birthday - one for every year old you are. When you turned 15, she squished you w
    8·1 answer
  • Write a program to compute answers to some basic geometry formulas. The program prompts the user to input a length (in centimete
    7·1 answer
  • What do you think is the most fascinating aspect of the internet?
    7·2 answers
  • Who can add entries to value log
    8·1 answer
  • Write the difference between left-sentential form and <br> right-sentential form
    13·1 answer
  • Anyone who do bug bounty hunt ?​
    10·1 answer
  • What are the value and data type (float, int, bool, or str) of this expression:<br> 5 // 2
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!