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
Get user input as a boolean and store it in the variable tallEnough. Also, get user input as a boolean and store it in the varia
frozen [14]

Answer:

I will code in JAVA.

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

 

boolean tallEnough;

boolean oldEnough;

Scanner input = new Scanner(System.in);

tallEnough = input.nextBoolean();<em> //wait the input for tallEnough</em>

oldEnough = input.nextBoolean(); <em>//wait the input for OldEnough</em>

   if(tallEnough && oldEnough){

   System.out.print(true);

   } else {

   System.out.print(false);

   }

}

}

Explanation:

First, to accept user inputs you have to import the class Scanner. Then declare both variables before allowing the user to set input values for both boolean variables.

In the if-else statement checks if both variables are true, then prints true. Another case prints always false.

8 0
1 year ago
Write a function addOddMinusEven that takes two integers indicating the starting point and the end point. Then calculate the sum
snow_lady [41]

Answer:g

   public static int addOddMinusEven(int start, int end){

       int odd =0;

       int even = 0;

       for(int i =start; i<end; i++){

           if(i%2==0){

               even = even+i;

           }

           else{

               odd = odd+i;

           }

       }

       return odd-even;

   }

}

Explanation:

Using Java programming language:

  • The method addOddMinusEven() is created to accept two parameters of ints start and end
  • Using a for loop statement we iterate from start to end but not including end
  • Using a modulos operator we check for even and odds
  • The method then returns odd-even
  • See below a complete method with a call to the method addOddMinusEven()

public class num13 {

   public static void main(String[] args) {

       int start = 2;

       int stop = 10;

       System.out.println(addOddMinusEven(start,stop));

   }

   public static int addOddMinusEven(int start, int end){

       int odd =0;

       int even = 0;

       for(int i =start; i<end; i++){

           if(i%2==0){

               even = even+i;

           }

           else{

               odd = odd+i;

           }

       }

       return odd-even;

   }

}

8 0
1 year ago
A cyber criminal sends a series of maliciously formatted packets to the database server. The server cannot parse the packets and
telo118 [61]

Answer:

DoS attack

Explanation:

A Denial of Service attack involves the sending of maliciously formatted data packets to a server. The packet can be larger than the allowed IP size such that when it arrives at the server, the server cannot identify the headers in the data packet for it to process and extract data. The server can either freeze or crash, denying allowed users access to its resources and making it unavailable.

7 0
1 year ago
Supplemental security software (such as anti-virus [anti-malware]) is: Generally considered essential for all desktops and lapto
k0ka [10]

Answer:

Explanation:

With an anti-virus, we can search, detect, and delete malware like spyware, worms, Trojans, rootkits, pseudoviruses, etc.

An anti-virus can detect virus with several methods like:

  • Digital signature
  • Heuristic detection
  • Behavior detection
  • Sandbox detection

Is necessary for personal laptops and desktops, even in companies hardware.

7 0
1 year ago
Kaira's company recently switched to a new calendaring system provided by a vendor. Kaira and other users connect to the system,
goldfiish [28.3K]

The service model that Kaira’s company is using is Saas

Explanation

Kaira’s company is using Software as a Service to access their new calendaring system that has been hosted by a 3rd party vendor over the web. It is the work of the SaaS to host specific applications and to deliver these applications to customers over the cloud. With SaaS, Kaira’s company does not need to install their calendaring software on their PCs. Every useful thing they want from their calendaring system can easily be accessed over the internet. All the company will need are personalized accounts with usernames and passwords for their employees to access.

The other different types of Cloud Computing services include;

  • PaaS: A set of tools and services designed to make coding and deploying those applications quick and efficient.
  • IaaS: hardware and software that powers it all – servers, storage, networks, and operating systems.

Learn more:

What is cloud computing?

brainly.com/question/2662575

Explain the three basic types of Cloud computing

brainly.com/question/12967175

#LearnwithBrainly

3 0
1 year ago
Other questions:
  • bill and melinda have two young children ages 2 and 4 and they are not covered under any life insurance policy. Melinda is full
    8·1 answer
  • Which feature of a typical professional networking site helps users add professional details to their profile ?
    9·2 answers
  • If there are three classes, Shape, Circle and Square, what is the most likely relationship among them?
    15·1 answer
  • Static packet filtering firewalls are limited to ________. inspecting packets for which there are good application proxy filteri
    8·1 answer
  • What output is produced by the following program segment? Why? (Recall that name.charAt(i) is the i-th character in the string,
    11·1 answer
  • Which of the following should get a Page Quality (PQ) rating of Low or Lowest? Select all that apply. True False A page with a m
    8·1 answer
  • Select the correct answer. Richard owns a chain of hardware stores. He wants to update the store website and write a numbered li
    14·1 answer
  • What protocol communicates data between routers representing the edges of autonomous systems?Distance-vectorLink stateInterior g
    11·1 answer
  • JAVA Write a program that first asks the user to type a letter grade and then translates the letter grade into a number grade. L
    9·1 answer
  • The Tell Me feature also includes access to the _____ feature.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!