Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
* AHPA #5: Caesar's Cipher
*
* Open the file "clearMessage.txt".
*
* Read each character of text using fgetc.
*
* Convert each ASCII character to its numeric equivalent.
*
* Apply the Caesar Cipher and increment each character by 3.
*
* Only convert alphabetic characters – leave all other characters
* unchanged.
*
* Convert each character back to its ASCII value.
*
* Write the encoded message out to the file "secretMessage.txt".
use c language
SAVE
AI-Generated Solution
info
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
Unlock instant AI solutions
Tap the button
to generate a solution
to generate a solution
Click the button to generate
a solution
a solution
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- python: Open the file mbox-short.txt and read it line by line. When you find a line that starts with 'From ' like the following line:From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008 You will parse the From line using split() and print out the second word in the line (i.e. the entire address of the person who sent the message). Then print out a count at the end. Hint: make sure not to include the lines that start with 'From:'. Also look at the last line of the sample output to see how to print the count. You can download the sample data at http://www.py4e.com/code3/mbox-short.txt my code: fname = input("Enter file name: ")if len(fname) < 1: fname = "mbox-short.txt" fh = open(fname)count = 0 print("There were", count, "lines in the file with From as the first word")arrow_forwardThis week assignment is from file processing. • Read a file Count number of lines • Count number of words • Count number of characters Create a random file. Don't send me the file. Only send .java file.arrow_forwardhow to Generate 4,000 random digits and save them in a text file (using ASCII coding), wherecharacters are separated by spaces and each line includes four characters. Repeat thepoker test by reading the numbers from the file in c programming languagearrow_forward
- can you do it pythonarrow_forwardI have a bit of code that is intended to read a file ("students.txt") and calculate the average, highest, and lowest scores from given information. (students.txt reads: " Mark Thompson 72.50James Taylor 100.00Daniel Price 80.2Busy Phillips 63.0 " ) This is the code I have: I have tweaked it to output the highest and lowest but I cannot get it to read the file. I have saved the file into the directory of the program but nothing seems to be working. I am also stumped on the formatting of the calculations. //////////////////////////////////////////// #include <iostream>#include <fstream>#include <cmath>#include <string>#include <iomanip>using namespace std; int main() { ifstream inFile; // This is a declaration of the inFile that holds all the gradesstring fileName; // This is the filename that the user will enterconst int min = 63.0; // This is a constant min used to find the lowest scoreconst int max = 100.0; // This is the constant max used to find the…arrow_forwardwhat is the aproximate size of the file?arrow_forward
- Need help writing this java code, it has three objectives: to process strings to compare, search, sort, and verify location of specific pattern to output result via interface Description Write a Java program to read a text file (command line input for file name), process the text file and perform the following. Print the total number of words in the file. (When using java_test.txt, I calculate the number of words, including number, as 254.) Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file. (When using java_test.txt, I calculate the number of different words, including number, as 168.) Print all words in ascending order (based on the ASCII code) without duplication. Write a pattern match method to find the location(s) of a specific word. This method should return all line number(s) and location(s) of the word(s) found in the file. Print all line(s) with line number(s) where the word is found by invoking the method…arrow_forwardSuppose the file test.txt contains floating-point numbersseparated by spaces. Write a program to obtain the sum, average, maximum, andminimum of the numbers.arrow_forward***Using Python A report could be produced by a program like this: Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this: 0h 1.5h 3.25h 3.0h 6.0h 1.0h 5.5h 2.25h 0.75h 2.25h 3.0h 3.0h 5.75h 2.25h 0h ---------------------------------------0.00h | 0.00h5.25h | 1.50h 3.25h 0.50h10.00h | 3.00h 6.00h 1.00h8.50h | 5.50h 2.25h 0.75h8.25h | 2.25h 3.00h 3.00h8.00h | 5.75h 2.25h0.00h | 0.00h---------------------------------------Weekly Total: 40.00h Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data types, and string formatting. For your assignment, create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a…arrow_forward
- C++ The program read Bin.bin file from ASCII to hex, then convert to binary string (0 and 1), store in tuple. Then read csv file to translate from binary to Morse code (dot-10 and dash-01, space-00). The output can be readable. Can change MyCode.cpp if you want. Tuple Fields:ASCII Character:The ASCII character_ ‘M’Morse Code:The Morse Code string_ “- -”Morse Binary:Morse Code binary string_ “0101” And: Algorithm Search( binchar ) // “0101”foreach tup in tupleListif tup.binary == bincharreturn tupreturn nullAlgorithm Decrypt( encryptedstring ) // “RI…‰”decryptedstring = Emptyfor chr in encryptedstringfound = tupleList.Search(chr) // “0101”decryptedstring.append(found.ascii) Mycode.cpp #include <iostream>#include <fstream>#include <sstream>#include <tuple>#include <vector> using namespace std;int main() {ifstream input_file("Bin.bin", ios::binary); stringstream buffer;buffer << input_file.rdbuf();string contents = buffer.str(); input_file.close();…arrow_forwardHow would I open a file and encrypt that file from a dictionary in Python? Attached is a picture of my current code. I am currently stuck at the getFiles() and convert(inputFile, outputFile) functions.arrow_forwardcan someone help me with this problem in C and explain how to do it step by steparrow_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