Answer:
four copies of three tenths
Explanation
just like you did it but its all in words
A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a file. 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 I AM SAM I AM SAM SAM I AM
Answer:
Here is the Python program:
filename=input('Enter the file name: ') #prompts to enter file name
file = open(filename,"r+") #opens file in read mode
dict={} #creates a dictionary
for word in file.read().split(): #reads and splits the file and checks each word in the file
if word not in dict: #if word is not already present in dictionary
dict[word] = 1 #sets dict[word] to 1
else: #if word is already in the dictionary
dict[word] += 1 #adds 1 to the count of that word
file.close(); #closes file
for key in sorted(dict): #words are sorted as per their ASCII value
print("{0} {1} ".format(key, dict[key])); #prints the unique words (sorted order) and their frequencies
Explanation:
I will explain the program with an example:
Lets say the file contains the following contents:
I AM SAM I AM SAM SAM I AM
This file is read using read() method and is split into a list using split() method so the file contents become:
['I', 'AM', 'SAM', 'I', 'AM', 'SAM', 'SAM', 'I', 'AM']
for word in file.read().split():
The above for loop checks file contents after the contents are split into a list of words. So if statement if word not in dict: inside for loop checks if each item in the list i.e. each word is not already in dict. It first checks word 'I'. As the dictionary dict is empty so this word is not present in dict. So the statement dict[word] = 1 executes which adds the word 'I' to dict and sets it to 1. At each iteration, each word is checked if it is not present in dictionary and sets its count to 1. This way the words 'I', 'AM' and 'SAM' count is set to 1. Now when 'I' appears again then this if condition: if word not in dict: evaluates to false because 'I' is already present in the dict. So else part executes dict[word] += 1 which adds 1 to the count of this word. So frequency of 'I' becomes 2. Now each time when 'I' in encountered its count is incremented by 1. Since 'I' appears three times so frequency of 'I' is 3.
After all the words are checked and the loop ends, the next for loop for key in sorted(dict): uses sorted method to sort the items in dict in alphabetical order then check each key of the dict and prints the key value along with it frequency. So the output of the entire program is:
AM 3 I 3 SAM 3
The screenshot of program along with its output is attached.
Instructions PhoneNumbersjava + 1 import java.util.*; 2 class PhoneNumbers 3 public static void main(String[] args) 4 //write code here A personal phone directory contains room for first names l and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the name is found in the list, display the corresponding phone number. If the name is not found in the list, prompt the user for a phone number, and add the new name and phone number to the list. Continue to prompt the user for names until the user enters quit. After the arrays are full (containing 30 names), do not allow the user to add new entries. Use the following names and phone numbers: Name Phone # Gina Marcia (847) 341-2392 Rita Jennifer (414) 234-0912 Fred Neil Judy (608) 435-0434 Arlene (608) 123-0312 LaWanda (920) 787-9813 Deepak (930) 412-0991 (847) 341-0912 (847) 354-0654 (414) 435-6567 (608) 123-0904
Answer:
What is the question?
In which of the following scenarios would it be best to use a for loop?
1. When you need to stop looping based on input from the user
2. When you need to check that a user's input is valid.
3. When you want to ask the user for 10 numbers
4. When you need to be able to use the block of code in many places in your program
Answer:
I would say 3 is the most likely answer ("When you want to ask the user for 10 numbers").
You use for loops to perform a task x times usually.
What statement best describes percentage values in CSS?
A.It's the fraction of the value that came before it.
B.It's the smallest controllable element on the screen.
C.It's always the width of an indent.
D.It's a value that is relative to the width of its HTML element or to the page.
Answer:
Im sorry if its wrong but i believe its D.
Explanation:
D. It's a value that is relative to the width of its HTML element or to the page.
Answer:
The answer is
Explanation:
D. It's a value that is relative to the width of its HTML element or to the page.
What order means that the highest numbers will be on top of the column
Answer:
Descending
Explanation:
Suppose you are purchasing something online on the Internet. At the website, you get a 10% discount if you are a member. Additionally, you are also getting a discount of 5% on the item because its Father's Day. Write a function that takes as input the cost of the item that you are purchasing and a Boolean variable indicating whether you are a member (or not), applies the discounts appropriately, and returns the final discounted value of the item. Note: The cost of the item need not be an integer
Answer:
The function is written in C++
void calc_discount(double amount,bool member)
{
double discount;
if(member)
{
discount = amount - 0.10 * amount - 0.05 * amount;
}
else
{
discount = amount - 0.05 * amount;
}
cout<<"Discount = "<<discount;
}
Explanation:
I've included the full source code (including the main method) as an attachment where I use comments as explanations
What do you use for soaking hands and holding soapy water
Answer:
a bowl
Explanation:
a round, deep dish or basin used for food or liquid.
plz mark brainliest
Suppose a linked list of 20 nodes. The middle node has a data –250. Write the pseudocode to replace the middle node of the linked list with a new node and new data. Assume that the list's head pointer is called head_ptr and the data for the new node is called entry.
Answer:
The middle node has a data –250. ... Write The Pseudocode To Replace The Middle Node Of The Linked List With ... Assume That The List's Head Pointer Is Called Head_ptr And The Data For The New Node Is Called Entry ... Assume that the list's head pointer is called head_ptr and the data for the new node is called entry ...
Explanation:
Helppp!!! Will give brainliest! Which of these operating system use the organize file?
Hypervisor
Firmware or wetware
Folders or directories
Output devices
Answer:hyperviser
Explanation:
which of the following is a chemical change.
A: Separating water into different glasses
B: breaking frozen ice cubes with a hammer
c: running an electric current through water
d: boiling water to evaporate it on a stove.
Answer:c
Explanation:
which of the following best describes the relationship between oxygen and chlorine
Answer:
Oxygen - More size, Less covalent, Less electronegative. Chlorine - More size, Less covalent, Less electronegative.
These are the things they have in common.
What is Groovefunnels?
Explanation:
Griovefunnels is a suite of digital marketing tools desinged to help you run a sucessfull online business .
Write a program containing a loop that you execute 16 times. In the loop, generate two random numbers between 1 and 50. Divide the first random number by the second random number and print the result using 4 decimal places of accuracy.Lab Exercise #1 Put your name, the compiler used, and Lab Exercise #1 in a comment at the top of your program. Email your source code. This lab exercise is due at the beginning of the next lecture. You may email your lab solution prior to that. Remember to use "Ex1" as the subject of your email submission. Write a program containing a loop that you execute 16 times. In the loop, generate two random numbers between 1 and 50. Divide the first random number by the second random number and print the result using 4 decimal places of accuracy. Your output should look like this - except for different random values: 2.3333 35.0000 0.8000 3.2222 0.8667 0.1304 1.1429 0.2857 1.0698 0.7568 8.4000 0.7500 1.3030 1.2941 0.4130 1.7778 Hint: you should get a floating-point answer (a cast is suggested).
Answer:
Follows are the code to this question:
#include <stdio.h>// header file
int main()//main method
{
int i,x, y;//declaring integer variable
float result;//declaring flat variable
for(i=0; i<16; i++) //defining foe loop for calculate value
{
x = (rand() % (50 - 0 + 1)) + 1;//use x variable for hold random value
y = (rand() % (50 - 0 + 1)) + 1;//use x variable for hold random value
result=(float)x/y;//use result variable for calculate value
printf("%.4f\n",result);//print value
}
return 0;
}
Output:
0.2200
0.2857
0.8684
0.7755
2.3000
0.1875
1.0500
1.3043
1.4839
1.2812
4.0000
0.9250
2.5000
1.8000
1.1034
1.1250
Explanation:
In the given code, three integer variable "i,x, and y" one float variable "result" is defined, in which integer variable "x and y" is used in the for loop, that uses the random function input value and in the float variable "result" it divides the value from x to y. This variable uses the typecasting to convert an integer to float and print its value.
Complete performance index:
How is it calculated?
Answer:
Remaining Work = Total budget – Earned Value. = (BAC – EV).
Lazarus Consulting is a large computer consulting company in New York. Pete Lazarus, theà CEOà and founder, is well known for his philanthropic efforts. Pete knows that most of his employees contribute to nonprofit organizations and wants to reward them for their efforts while encouraging others to contribute to charities. Pete began a program that matches 50 percent of each employee donation. The only stipulations are that the charity must be a nonprofit organization and the company will match only up to $2,000 per year per employee.
Use the à data fileà provided to determine the following:
What was the total donation amount per organization?
What were the average donations per organization?
Answer:
There are too many weird characters in this question, so I am unable to fix it, comment on this with the correct characters so I can submit a correct answer.
What is the hexadecimal equivalent for the decimal number 27? Working must be shown
The answer is .9726
Explanation:
Cyberbullying someone by threatening to hurt them is ethically wrong, but does NOT violate any laws. True False
Write the letter from D'Artagnan's father that was stolen from D'Artagnan in Meung. Include information about how D'Artagnan's father knows M. de Treville, describe D'Artagnan to M. de Treville, and request what D'Artagnan's father would like M. de Treville to do for D'Artagnan. Minimum 4 sentences.
Answer:
D'Artagnan's father advises him to be guided by his courage and his wits, ... town, but finds that the gentleman has stolen his letter of introduction to M. de Treville. ... D'Artagnan is received into M. de Treville's private chamber. However, before the two can speak, de Treville calls in two of his musketeers, Aramis and Porthos.
Explanation:
What sequence is used to create a brochure document from a template?
Answer:
computer is used to create a voucher document
This Operating System was basically an upgrade to Windows 98 and was designed for home users. 1) Windows ME 2) Windows 2K 3) Windows 2000 4) Windows New Technology
the answer is windows2k3 hope this helps!
help help help help help help help help
Answer:
ok witch qeston
Explanation:
Answer:
2
Explanation:
Which shortcut key aligns text to the center of a page?
O Ctrl+C
O Ctrl+Shift+C
O Shift+C.
O Ctrl+E
Option D, Ctrl + E aligns text to centre
Choose the words that make the statement true. You wrote a program called firstProgram.
Your program is _____.
O always running in the background
O stored until you open the file
Answer:
Stored until you open the file
Explanation:
Your program is stored until you open the file.
-edge 2022
You wrote a program called first Program. Your program is stored until you open the file. The second option is correct.
What is program?A program is made from code of instructions. A program is saved for later use.
When a program is opened, it is in running condition until it is closed. But when it is not in use, it gets stored at a location for next use.
You wrote a program called first Program. Your program is stored until you open the file.
Thus, the second option is correct.
Learn more about program.
https://brainly.com/question/3224396
#SPJ2
write a program that first defines three string objects called firstName, middleName, and lastName which contains your own first, middle and last name separately. If you do not have middle name, then make up one. Then try to generate a new user name for you by using your first letter of your first name(captilized), first letter of you middle name (Captilized), plus all letters in your last name, add a random number between (1 to 100) to the your new user name. Here is an exampl: Name: John blake adams then the user name generated by your program coulde be: JBadams23
Answer:
Written in Python
import random
firstName = "Charles"
lastName = "Dawson"
middleName = "Rutherford"
pwd = firstName[0] + lastName[0]+middleName+str(random.randint(1,101))
print(pwd)
Explanation:
This line imports random library into the program
import random
The next three lines initializes the name of the user
firstName = "Charles"
lastName = "Dawson"
middleName = "Rutherford"
This line generates the password
pwd = firstName[0] + lastName[0]+middleName+str(random.randint(1,101))
This line prints the generated password
print(pwd)
Which function prompts the user to enter information?
def main()
input()
int()
main()
Answer:
B. input()
Explanation:
Hope this helps :)
Answer:
Input()
Explanation:
So if you used process of elimination, you can see that def main() defines the start of the program and main() defines the end of the program. Also, int() is to solve without a decimal or special marking, therefore, input() would be the only reliable answer.
~i also got this correct on the test!~
Which of the following is a sign you may be drowsy behind the wheel?
A. Jitteriness
B. Happiness
C. Unhappiness
D. Irritability
The sign that you may be drowsy behind the wheel is Unhappiness. The correct option is C.
What are feelings?Feelings and emotions vary fundamentally in that feelings are experienced consciously, whereas emotions manifest either consciously or subconsciously.
Some people may go years, if not a lifetime, without comprehending the depths of their feelings. Drowsiness encompasses symptoms such as tiredness, inability to keep busy, feeling uninteresting, and the absence of happiness.
Therefore, the correct option is C. Unhappiness.
To learn more about feelings, refer to the link:
https://brainly.com/question/13044426
#SPJ1
_____ is a framework based on JavaScript and HTML that is normally used to make dynamic web apps.
a
Python
b
CSS
c
AngularJS
d
A database
Answer:
AngularJS (c)
Explanation:
Answer:
AngularJS
node is better
Explanation:
What does B the represent
Answer:
The B represents a boolean.
Planned value:
How is it calculated?
The only item on the desktop of a new Mac is the hard-drive icon.
True or false?
Answer:
False
There are many more items on the desktop of a new Mac than the hard-drive icon.