17197169104233430701740026705814
.jpg
keyboard_arrow_up
School
Sinclair Community College *
*We aren’t endorsed by this school
Course
1111
Subject
Computer Science
Date
Jul 1, 2024
Type
jpg
Pages
1
Uploaded by CountAntelopePerson4235
AN | @& Ask Copilot ol e L 1| of2 | o T CIS 1111 Files Assignment (20 Points) )escription: For this assignment, you will be provided a pre-populated file. You will need to search through the entire file for keywords entered from the keyboard. While we have provided the keywords to you, your program must still | collect them from the user. After searching the file, generate a new text file with a report that shows the total number of times each keyword was found. Your text file report should look i like the screenshot. The output will vary depending on which words NEHIT 3 File Edit Format View Help fThe keyword "it" was found 145 times. The keyword "the" was found 361 times. | you search for. Requirements: B ? 1. Output must be labelled and easy to read as shown in the sample output below. » 3 2. You must display how many times each keyword was found. % 3. Program must be documented with the following: R a. // Name b. // Date c. // Program Name d. // Description 4. Flowchart the logic of the program Sample Output: i What is the first keyword to search for? it 3
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
GRADEBOOK PROJECT
Attached Files: Gradebook.docx (18.278 KB)
Gradebook Practicla Project: use the attached code as an exaple and modify where neccesary to fit your situation
Write a program that uses an array of string objects to hold the five student names, an array of five characters to hold the five students' letter grades, and five
arrays of four doubles to hold each student's set of test scores.
The program should allow the user to enter each student's name and his or her four test scores. It should then calculate and display each student's ayerage test
score and a letter grade based on the average.
Input Validation: Do not accept test scores less than 0 or greater than 100.
Use the following test score grades
Test Score Letter Grade
80-100 -> A
70-79 -> B
60-69 -> C
50-59 -> D
OO
HUAWEI P30 lite
TRIPLE CAMERA
Activate Windows
dolto vers
arrow_forward
*Code in Python
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
Enter the input file name: example.txt AM 3 I 3 SAM 3
The program should handle input files of varying length (lines).
arrow_forward
What does the following python code do?
f = open("sample.txt", "w")
Choose all that apply.
Select 2 correct answer(s)
Question 11 options:
If the file called sample.txt exists, it writes at the bottom of the file
if the file sample.txt exists, deletes everything in it
reads the file called sample.txt starting from the top
if the file sample.txt does not exist, it creates the file and opens it for writing
opens a file called sample.txt for appending
writes "w" to the file called sample.txt
opens a file called sample.txt for reading
closes a file called sample.txt
arrow_forward
Can you please help me do this program, its for a class called Object Oriented Programming
arrow_forward
Searching - a user should be able to search by ID or by item name
create only one menu item for searching
a user should be able to enter the name of the item using any case, (for example, sTRolleR)
you may wish to store items in all lower/upper case to expedite the search
write one search function that can search by ID and name and goes through the array of structs/objects only once
show the entire record if found or an appropriate message if not
Sorting - sort by any field
write one function to sort by any field using a parallel array of pointers
use Bubble Sort is not the most effective but the easiest to modify.
do not copy and paste sort code five times into the same function.
sorting using pointers is faster because you have to swap pointers only, which are normally stored in 4 bytes each; it also allows you to preserve the original order of the items
If you choose to have a submenu, a submenu must have an option to go back to the previous menu or main menu
if a user got…
arrow_forward
Python - Next Birthdate
In this task, we will write a program that reads birthdate data from a given CSV file, and given the current date, determines which person's birthday will be celebrated next.
Create a function with the following signature:
nextBirthdate(filename, date)
filename: parameter, which represents the CSV filename.
date: parameter, which represents the current date.
The function should open the CSV file, read the birthdate data, and determine which person's birthday will be celebrated next, given the current date. The name of the person should be returned. In other words, given a date, find the person whose birthday is next.
Sample Run
birthdates.csv
Draven Brock, 01/21/1952
Easton Mclean, 09/02/1954
Destiny Pacheco, 10/10/1958
Ariella Wood, 12/20/1961
Keely Sanders, 08/03/1985
Bryan Sloan,04/06/1986
Shannon Brewer, 05/11/1986
Julianne Farrell,01/29/2000
Makhi Weeks, 03/20/2000
Lucian Fields, 08/02/2018
Function Call
nextBirthdate("birthdates.csv", "01/01/2022")
Output…
arrow_forward
Finish this program from the code posted below! Note: There should be two files Main.py and Contact.py
You will implement the edit_contact function. In the function, do the following:
Ask the user to enter the name of the contact they want to edit.
If the contact exists, in a loop, give them the following choices
Remove one of the phone numbers from that Contact.
Add a phone number to that Contact.
Change that Contact's email address.
Change that Contact's name (if they do this, you will have to remove the key/value pair from the dictionary and re-add it, since the key is the contact’s name. Use the dictionary's pop method for this!)
Stop editing the Contact
Once the user is finished making changes to the Contact, the function should return.
Code:from Contact import Contactimport pickledef load_contacts():""" Unpickle the data on mydata.dat and save it to a dictionaryReturn an empty dictionary if the file doesn't exist """try:with open("mydata.dat", 'rb') as file:return…
arrow_forward
Problem: Write a Python program that
reads from an input file named employees.txt
some employee information and produces a salaries report on
screen.
The input file
employees.txt has a number of data lines. Each data line in the input file contains
information about one employee including: first name, last name, job code (an integer
between 1 and 4), and the number of days worked. The following is an example of what
the input file employees.txt can contain:
Ali Al-Harthi
22
Laila Al-Busaidi
4
25
Salim Al-Hajri
Badria Al-Sinani
2
21s
19
Abir Al-Hinai
1
15
Your program should produce a salaries report on screen using the format shown below.
Enter input file name: employee.txt
Name
Job Code
Days Worked
Salary (OMR)
Ali Al-Harthi
3
22
660.000
Laila Al-Busaidi
4
25
637.500
Abir Al-Hinai
15
600.000
Number of faulty records = 2
Number of valid records = 3
Average salary
= 632.500
The salary of each employee is equal to the number of days worked multiplied by the
daily pay rate. The daily pay…
arrow_forward
pleas answer it
arrow_forward
.
arrow_forward
input files are random numbers
arrow_forward
JAVA PPROGRAM
Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found.
While entering the file name, the program should allow the user to type quit to exit the program.
If the file with a given name does not exist, then display a message and allow the user to re-enter the file name.
The file may contain up to 100 names.
You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList.
Input validation:
a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…
arrow_forward
The function fopen return NULL when:
An error occurred while opening the file.
An error occurred while reading the file.
An error occurred while closing the file.
An error occurred while compiling the file.
arrow_forward
Task: Loading data from files
This exercise will require you to load some information from files and use it in your program.
scene.txt contains a description of a series of shapes and colours to draw. You need to write code to read in the file data and draw the requested shapes in the correct colour. Each line in scene.txt will contain one of the following starting keywords followed by some data:
COLOUR followed by 3 values: R, G, B
CIRCLE followed by 3 values: X, Y, RADIUS
RECT Followed by 4 values: X, Y, W, H
LINE Followed by 4 values: X1, Y1, X2, Y2
CIRCLES are defined from the center. RECT's are defined from the top left. All values are space separated, and you can assume all input is correct (no errors). Please solve this program to draw the scene.
I can't upload the file scene.txt, so I decide to screenshot a file for you.
Subject: Java Programming
arrow_forward
please code in pythonredact_file: This function takes a string filename. It writes a new file that has the same contentsas the argument, except that all of the phone numbers are redacted. Assume that the filename has onlyone period in it. The new filename is the same as the original with '_redacted' added before theperiod. For instance, if the input filename were 'myfile.txt', the output filename would be'myfile_redacted.txt'. Make sure you close your output file.The first hard task in this function is to make the output filename from the input filename that waspassed in. You can break it into two pieces by splitting on the dot or by using the index method andslicing. Then put it back together again using string concatenation.We are also working with files in this one. To open a file with a filename stored in the variable fname,in read mode use the open function as such: fp = open(fname). You will need to open the outputfile in write mode: open(fname, 'w'). Then you can traverse the…
arrow_forward
Average Number of WordsIf you have downloaded the source code from the Computer Science Portal you will find a filenamed text.txt in the Chapter 08 folder. The text that is in the file is stored as one sentenceper line. Write a program that reads the file’s contents and calculates the average number ofwords per sentence.(You can access the Computer Science Portal at www.pearsonhighered.com/gaddis.)
arrow_forward
Using C++Put your entire completed visual studio solution in a zip archive and upload it as: assignment01YourName.zip.
Write the program that allows the user to sort using the Bubble Sort, Selection Sort, Insertion Sort and Shell Short The program should be able to read in data from a binary file. The first element of the binary file will be used to tell how many elements to read in. Once all the data has been read in, the program should sort the data. The user should be able to choose which algorithm to use to sort the data. The program should print the time before and after the sort. The last part of the program should prompt the user for a lower and upper bound. These two value should then be used to decide how much and which part of the array will be display. You should test all of the sorts on each of the data files. In a separate word document include a short writeup for each sort that looks something like this:
Insertion Sort:
1,000,000 Random: 5 minutes
1,000,000…
arrow_forward
Submission: Combine the code files for Q1 and Q2 as a zip file and submit in Moodle
Question 1: Write a Program that to enter Student Name, Grade and print it to the screen
with below requirements
.
.
.
.
Asks the users how many student grades they want to enter.
Based on that number the program should setup a loop to ask the user to
enter student name and the student grade.
Save this information using 2 arrays
At the end the program must show the student names and grades with 1
student on each line on the screen
Program should use Arrays and loops to achieve the task.
arrow_forward
Please help with simple java code i/o
arrow_forward
Python
arrow_forward
use windows form app
arrow_forward
In python please! I am struggling
arrow_forward
C++ Programming.
Associative and unordered associative containers.
Associative containers (set, map, multiset, multimap).
• When executing a given task, the input values must be read from a text file.
Task : Create a program that deletes a set of elements from a single word of a given string type and creates a second set of elements that consist of a single word, and also displays it on the screen.
arrow_forward
Should not be case sensitive when getting the column name. Use python language for a program that modifies and sorts the content of a specific csv file based on the inputted column name. The program should ask Enter filename: Enter column name to be sorted: Additionally, the csv file must be modified and no additional csv files must be created. The application will catch and display an error message "the file does not exist" if the csv file does not exist.
arrow_forward
scanner format using java
please have the code copypaste
Create a program to count the word's length distribution of a text file. The program should read in the file row by row and split the row into words (assuming there is no punctuations). Then the program should count the number of strings of a certain length. For example, given the following file:
Mary has a little lamb
little lamb
little lamb
The result should be:
Length 1: 1
Length 3: 1
Length 4: 4
Length 6: 3
arrow_forward
>> classicVinyls.cpp
For the following program, you will use the text file called “vinyls.txt” attached to this assignment. The file stores information about a collection of classic vinyls.
The records in the file are like the ones on the following sample:
Led_Zeppelin Led_Zeppelin 1969 1000.00
The_Prettiest_Star David_Bowie 1973 2000.00
Speedway Elvis_Presley 1968 5000.00
Spirit_in_the_Night Bruce_Springsteen 1973 5000.00
…
Write a declaration for a structure named vinylRec that is to be used to store the records for the classic collection system. The fields in the record should include a title (string), an artist (string), the yearReleased (int), and an estimatedPrice(double).
Create the following…
arrow_forward
$aprint
arrow_forward
Answer fast else downvote
arrow_forward
print ("sum of all values entered correctly = %.2f" % total)
Slide Type Slide
• Exercise # 3 Write a program that reads each line in a file, reverses its lines, and writes them to another file. For example, if the file input.txt contains the
lines:
Slide Type Fragment v
Mary had a little lamb
Its fleece was white as snow
And everywhere that Mary went
The lamb was sure to go.
• You may assume that the input file is called inputex3.txt and the output file is outputex3.txt.
Slide Type Fragment v
• then output txt contains
The lamb was sure to go.
And everywhere that Mary went
Its fleece was white as snow
Mary had a little lamb
In [6]:
Slide Type
W Exercise# 3 - Source Code
JBL
PrtSc
Sys Rq
Insert
Scrlk
Home
Pa
F4
F5
F6
F7
F8
F9
F10
F11
F12
Delete
&
Backspace
4
7
V
8
Y
U
Ох
P :
く
40
F
G Y
J
K
L /
Enter
146
/ V B ý Ni M
Shift
V
•1
この
arrow_forward
PYTHONPLEASE ALSO SHARE CODE THROUGH LINK: online-python(dot)comAlso screenshot code with correct indentation
Create a python program that reads the student information from a tab separated values (tsv) file. The python program then must creates a text file that will records the course grades of the students. Each row of the tsv file contains the Last Name, First Name, Midtrm1 score, Midtrm2 score, and the Final score of a student. A sample of the student information is provided in StudentInfoScore.tsv. Assume the number of students is at least 1 and at most 20.
The program performs the following tasks:
Read the file name of the tsv file from the user.
Open the tsv file and read the student information.
Compute the average exam score of each student.
Assign a letter grade to each student based on the average exam score in the following scale:
A: 90 =< x
B: 80 =< x < 90
C: 70 =< x < 80
D: 60 =< x < 70
F: x < 60
Compute the average of each exam.
Output the…
arrow_forward
JAVA PPROGRAM ASAP
Hypergrade does not like this program because it says 2 out of 7 passed and take out the extra \n from the program. Please Modify and change this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade. Also, for test cases 1-4 it wants only to input Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram.
import java.io.File;import java.io.FileNotFoundException;import…
arrow_forward
How many edges does your polygon have? 6 This is a hexagon. --- Sample run: This is a rectangle. Shape not recognized. How many edges does your polygon have? 3 This is a triangle.
I m posting this third time dont copy paste code
arrow_forward
Constraints:
Use Python
Don't use global variables
Don't use external libraries (PIL and os are allowed)
Start the program with a main function (def main():)
Content:
Ask the user to input a .jpeg/.jpg image. Once a jpeg file is uploaded, create a function with the argument img_info and return a tuple with the image's dimensions in pixels (w, h) and the image data in a form of a list of tuples with RGB values.
Print out the values/data collected.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- GRADEBOOK PROJECT Attached Files: Gradebook.docx (18.278 KB) Gradebook Practicla Project: use the attached code as an exaple and modify where neccesary to fit your situation Write a program that uses an array of string objects to hold the five student names, an array of five characters to hold the five students' letter grades, and five arrays of four doubles to hold each student's set of test scores. The program should allow the user to enter each student's name and his or her four test scores. It should then calculate and display each student's ayerage test score and a letter grade based on the average. Input Validation: Do not accept test scores less than 0 or greater than 100. Use the following test score grades Test Score Letter Grade 80-100 -> A 70-79 -> B 60-69 -> C 50-59 -> D OO HUAWEI P30 lite TRIPLE CAMERA Activate Windows dolto versarrow_forward*Code in Python 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 Enter the input file name: example.txt AM 3 I 3 SAM 3 The program should handle input files of varying length (lines).arrow_forwardWhat does the following python code do? f = open("sample.txt", "w") Choose all that apply. Select 2 correct answer(s) Question 11 options: If the file called sample.txt exists, it writes at the bottom of the file if the file sample.txt exists, deletes everything in it reads the file called sample.txt starting from the top if the file sample.txt does not exist, it creates the file and opens it for writing opens a file called sample.txt for appending writes "w" to the file called sample.txt opens a file called sample.txt for reading closes a file called sample.txtarrow_forward
- Can you please help me do this program, its for a class called Object Oriented Programmingarrow_forwardSearching - a user should be able to search by ID or by item name create only one menu item for searching a user should be able to enter the name of the item using any case, (for example, sTRolleR) you may wish to store items in all lower/upper case to expedite the search write one search function that can search by ID and name and goes through the array of structs/objects only once show the entire record if found or an appropriate message if not Sorting - sort by any field write one function to sort by any field using a parallel array of pointers use Bubble Sort is not the most effective but the easiest to modify. do not copy and paste sort code five times into the same function. sorting using pointers is faster because you have to swap pointers only, which are normally stored in 4 bytes each; it also allows you to preserve the original order of the items If you choose to have a submenu, a submenu must have an option to go back to the previous menu or main menu if a user got…arrow_forwardPython - Next Birthdate In this task, we will write a program that reads birthdate data from a given CSV file, and given the current date, determines which person's birthday will be celebrated next. Create a function with the following signature: nextBirthdate(filename, date) filename: parameter, which represents the CSV filename. date: parameter, which represents the current date. The function should open the CSV file, read the birthdate data, and determine which person's birthday will be celebrated next, given the current date. The name of the person should be returned. In other words, given a date, find the person whose birthday is next. Sample Run birthdates.csv Draven Brock, 01/21/1952 Easton Mclean, 09/02/1954 Destiny Pacheco, 10/10/1958 Ariella Wood, 12/20/1961 Keely Sanders, 08/03/1985 Bryan Sloan,04/06/1986 Shannon Brewer, 05/11/1986 Julianne Farrell,01/29/2000 Makhi Weeks, 03/20/2000 Lucian Fields, 08/02/2018 Function Call nextBirthdate("birthdates.csv", "01/01/2022") Output…arrow_forward
- Finish this program from the code posted below! Note: There should be two files Main.py and Contact.py You will implement the edit_contact function. In the function, do the following: Ask the user to enter the name of the contact they want to edit. If the contact exists, in a loop, give them the following choices Remove one of the phone numbers from that Contact. Add a phone number to that Contact. Change that Contact's email address. Change that Contact's name (if they do this, you will have to remove the key/value pair from the dictionary and re-add it, since the key is the contact’s name. Use the dictionary's pop method for this!) Stop editing the Contact Once the user is finished making changes to the Contact, the function should return. Code:from Contact import Contactimport pickledef load_contacts():""" Unpickle the data on mydata.dat and save it to a dictionaryReturn an empty dictionary if the file doesn't exist """try:with open("mydata.dat", 'rb') as file:return…arrow_forwardProblem: Write a Python program that reads from an input file named employees.txt some employee information and produces a salaries report on screen. The input file employees.txt has a number of data lines. Each data line in the input file contains information about one employee including: first name, last name, job code (an integer between 1 and 4), and the number of days worked. The following is an example of what the input file employees.txt can contain: Ali Al-Harthi 22 Laila Al-Busaidi 4 25 Salim Al-Hajri Badria Al-Sinani 2 21s 19 Abir Al-Hinai 1 15 Your program should produce a salaries report on screen using the format shown below. Enter input file name: employee.txt Name Job Code Days Worked Salary (OMR) Ali Al-Harthi 3 22 660.000 Laila Al-Busaidi 4 25 637.500 Abir Al-Hinai 15 600.000 Number of faulty records = 2 Number of valid records = 3 Average salary = 632.500 The salary of each employee is equal to the number of days worked multiplied by the daily pay rate. The daily pay…arrow_forwardpleas answer itarrow_forward
- .arrow_forwardinput files are random numbersarrow_forwardJAVA PPROGRAM Write a program that prompts the user to enter a file name, then opens the file in text mode and reads names. The file contains one name on each line. The program then compares each name with the name that is at the end of the file in a symmetrical position. For example if the file contains 10 names, the name #1 is compared with name #10, name #2 is compared with name #9, and so on. If you find matches you should print the name and the line numbers where the match was found. While entering the file name, the program should allow the user to type quit to exit the program. If the file with a given name does not exist, then display a message and allow the user to re-enter the file name. The file may contain up to 100 names. You can use an array or ArrayList object of your choosing, however you can only have one array or ArrayList. Input validation: a) If the file does not exist, then you should display a message "File 'somefile.txt' is not found." and allow the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education