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
Len [333]
2 years ago
6

A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a fi

le. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies. Below is an example file along with the program input and output: example.txt
Computers and Technology
1 answer:
neonofarm [45]2 years ago
3 0

Answer:

Python file with appropriate comments given below

Explanation:

#Take the input file name

filename=input('Enter the input file name: ')

#Open the input file

inputFile = open(filename,"r+")

#Define the dictionary.

list={}

#Read and split the file using for loop

for word in inputFile.read().split():

  #Check the word to be or not in file.

  if word not in list:

     list[word] = 1

  #increment by 1

  else:

     list[word] += 1

#Close the file.

inputFile.close();

#print a line

print();

#The word are sorted as per their ASCII value.

fori in sorted(list):

  #print the unique words and their

  #frequencies in alphabetical order.

  print("{0} {1} ".format(i, list[i]));

You might be interested in
Raj, a recent graduate, has recently joined your organization as a Junior Business Analyst. He has been asked to conduct a Feasi
kolezko [41]

Answer:

a. Availability of software licensing

Explanation:

With feasibility analysis, we take into consideration economic, technical, legal, and scheduling factors to make sure that our project completes successfully. Acquiring license for a software can be free of cost or paid subscription. So a business analyst needs to make an account of the cost of accessing the software services. Also while automating a software installation process, it would require automatic authentication which would again require details of licensing. So in my best knowledge, analyzing availability of software licensing is a must and foremost step for a feasibility study.

3 0
2 years ago
Write the definition of a function power_to, which receives two parameters. The first is a float and the second is an integer. T
Ber [7]

Answer:

  1.    public static double power_2(double num1, int num2){
  2.        if(num2<0){
  3.            return 0;
  4.        }
  5.        else{
  6.            double returnedVal = Math.pow(num1,num2);
  7.            return returnedVal;
  8.        }
  9.    }

Explanation:

  • This is implemented in Java programming language
  • Line 1 Is the method declaration which indicates that it will return a floating point number (type double) and accepts two parameters, the first a double and the second an int as required by the question
  • Line 2 Uses and if statement to check if the second parameter is negative (less than 0) and returns 0.0 if this is true
  • Lines 5-7 is the else condition that uses java's Math.pow method to raise the num1 to the power num2 and returns the value
3 0
2 years ago
True or false words spelling and grammar check is always %100
OverLord2011 [107]
I don't quite understand what you are asking but if you are asking if word, spelling and grammar checkers are always 100% accurate then that is false :) 
6 0
2 years ago
Read 2 more answers
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?
Gennadij [26K]

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3  

print (" Average is = ", average)

Explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3   statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

4 0
2 years ago
Read 2 more answers
Suppose Host A sends two TCP segments back to back to Host B over a TCP connection. The first segment has sequence number 90; th
Anna71 [15]

Answer:

a)   Consider sequence numbers,First segment=90

Second segment=110

Data in the first segment = 110-90  =20

b) Consider the first segment is lost but the second segment arrives at B. In the acknowledgment that Host B sends to Host A, then the acknowledgment number will be first segment of sequence number, that is 90.

Explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • Suppose a computer using direct mapped cache has 220 bytes of byte-addressable main memory, and a cache of 32 blocks, where each
    5·1 answer
  • A class of Students was previously defined with the following properties: a string name, an integer age, a Boolean variable indi
    14·1 answer
  • Use the following data definitions data myBytes BYTE 10h,20h,30h,40h myWords WORD 3 DUP(?),2000h myString BYTE "ABCDE" What will
    9·1 answer
  • What happened if the offshore team members are not able to participate in the iterations demo due to timezone/infrastructure iss
    12·1 answer
  • Write a program findStr.c that finds the "smallest" and "largest" in a series of words. After the user enters the words, the pro
    9·1 answer
  • reAay ouyay aay hizway ithway igPay atin?Lay? (Translated: "Are you a whiz with Pig Latin?") Write a program that converts an En
    6·1 answer
  • #Write a function called fancy_find. fancy_find should have #two parameters: search_within and search_for. # #fancy_find should
    9·1 answer
  • Explain the history of computing of mechanical era
    14·2 answers
  • Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binar
    12·1 answer
  • A customer opened a file attachment, and now her PC is infected with ransomware. She's unable to open any of her files. Which ac
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!