SlideShare a Scribd company logo
Instructions
Write a program whose main function is merely a collection of variable declarations and function
calls. This program reads a text and outputs the letters, together with their counts, as explained
below in the function printResult. (There can be no global variables! All information must be
passed in and out of the functions. Use a structure to store the information.) Your program must
consist of at least the following functions:
Function openFile: Opens the input and output files. You must pass the file streams as parameters
(by reference, of course). If the file does not exist, the program should print an appropriate
message ("The input file does not exist.") and exit. The program must ask the user for the
names of the input and output files.
Function count: Counts every occurrence of capital letters A-Z and small letters a-z in the text file
opened in the function openFile. This information must go into an array of structures. The array
must be passed as a parameter, and the file identifier must also be passed as a parameter.
Function printResult: Prints the number of capital letters and small letters, as well as the
percentage of capital letters for every letter A-Z and the percentage of small letters for every letter
a-z. The percentages should look like this: "25%".This information must come from an array of
structures, and this array must be passed as a parameter.
Your program should prompt the user for name of the input file, then the name of the output file.

More Related Content

PDF
So basically I worked really hard on this code in my CS150 class and.pdf
PDF
So I am writing a CS code for a project and I keep getting cannot .pdf
PDF
You are required to open an input file (shown below) then read one c.pdf
PPTX
samples.pptx
PPTX
Comprehensive Project Report on A super advanced calculator.
PDF
PRACTICAL RECORD FORMAT FOR TSUDENTS XI AND XII
DOCX
For this assignment, download the A6 code pack. This zip fil.docx
PPTX
File Programs with Solutions on python.pptx
So basically I worked really hard on this code in my CS150 class and.pdf
So I am writing a CS code for a project and I keep getting cannot .pdf
You are required to open an input file (shown below) then read one c.pdf
samples.pptx
Comprehensive Project Report on A super advanced calculator.
PRACTICAL RECORD FORMAT FOR TSUDENTS XI AND XII
For this assignment, download the A6 code pack. This zip fil.docx
File Programs with Solutions on python.pptx

Similar to Instructions Write a program whose main function is merely a.pdf (12)

PDF
Hello, I need help with the following assignmentThis assignment w.pdf
DOCX
Start with the inclusion of libraries#include iostream .docx
DOCX
Write a NumPy program to find the most frequent value in an array. Take two...
PDF
Ejercicios de estilo en la programación
DOCX
source code which create file and write into it
PDF
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
PDF
TffffThe program needs to be in C++ and part 1 of the assignment i.pdf
PPTX
Csci101 lect03 algorithms_i
PDF
C Programming Project
DOCX
#include iostream#include cmath#include fstream.docx
PDF
Please help. C++ The program is an interactive program th.pdf
Hello, I need help with the following assignmentThis assignment w.pdf
Start with the inclusion of libraries#include iostream .docx
Write a NumPy program to find the most frequent value in an array. Take two...
Ejercicios de estilo en la programación
source code which create file and write into it
Background Sometimes the standard C libraries (stdio.h, stdlib.h, e.pdf
TffffThe program needs to be in C++ and part 1 of the assignment i.pdf
Csci101 lect03 algorithms_i
C Programming Project
#include iostream#include cmath#include fstream.docx
Please help. C++ The program is an interactive program th.pdf
Ad

More from adinathknit (20)

PDF
It had been seven weeks since her surgery and Marlene was On.pdf
PDF
ISuppose that the marginal propensity to save is dya5057y+.pdf
PDF
IT 7113 Data Visualization and Dashboard Development Project.pdf
PDF
issurecoit thevend at teedes ERetiat a patin puinen ra soo .pdf
PDF
ISO 9000 uluslararas kalite standarddr Standardn en son dei.pdf
PDF
Isabella Penrose la gerente general le pidi a la Sra Sul.pdf
PDF
Isaiah is a 9 vear old malewho was diaanosed with Cerebra.pdf
PDF
Is there convincing evidence that less than half of American.pdf
PDF
Is the following statement true or false and why this sta.pdf
PDF
Is the coefficient 0 1 or not defined Please provide expl.pdf
PDF
Is the drawn T the doubled version of T If not what is th.pdf
PDF
Is SPI filtering for packets that are part of ongoing commun.pdf
PDF
Is it possible to create a bottom navigation with two option.pdf
PDF
Is gain of function correct Colors indicate range of gene e.pdf
PDF
irketlerin zellikleri ile ilgili olarak aadakilerden hangis.pdf
PDF
irketimizin aadaki nakit aklarna sahip bir projesi bulunmakt.pdf
PDF
Ire ntanin Cedar of ontry into recinient cell Given the abo.pdf
PDF
IP Fragmentation Consider sending a 2000 byte datagram in.pdf
PDF
Investors have a utility function over wealth of Retur.pdf
PDF
Investors have different risk preferences Most people are n.pdf
It had been seven weeks since her surgery and Marlene was On.pdf
ISuppose that the marginal propensity to save is dya5057y+.pdf
IT 7113 Data Visualization and Dashboard Development Project.pdf
issurecoit thevend at teedes ERetiat a patin puinen ra soo .pdf
ISO 9000 uluslararas kalite standarddr Standardn en son dei.pdf
Isabella Penrose la gerente general le pidi a la Sra Sul.pdf
Isaiah is a 9 vear old malewho was diaanosed with Cerebra.pdf
Is there convincing evidence that less than half of American.pdf
Is the following statement true or false and why this sta.pdf
Is the coefficient 0 1 or not defined Please provide expl.pdf
Is the drawn T the doubled version of T If not what is th.pdf
Is SPI filtering for packets that are part of ongoing commun.pdf
Is it possible to create a bottom navigation with two option.pdf
Is gain of function correct Colors indicate range of gene e.pdf
irketlerin zellikleri ile ilgili olarak aadakilerden hangis.pdf
irketimizin aadaki nakit aklarna sahip bir projesi bulunmakt.pdf
Ire ntanin Cedar of ontry into recinient cell Given the abo.pdf
IP Fragmentation Consider sending a 2000 byte datagram in.pdf
Investors have a utility function over wealth of Retur.pdf
Investors have different risk preferences Most people are n.pdf
Ad

Recently uploaded (20)

PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Lesson notes of climatology university.
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Structure & Organelles in detailed.
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Computing-Curriculum for Schools in Ghana
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
RMMM.pdf make it easy to upload and study
PDF
Supply Chain Operations Speaking Notes -ICLT Program
VCE English Exam - Section C Student Revision Booklet
Lesson notes of climatology university.
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Structure & Organelles in detailed.
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Computing-Curriculum for Schools in Ghana
Yogi Goddess Pres Conference Studio Updates
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Weekly quiz Compilation Jan -July 25.pdf
GDM (1) (1).pptx small presentation for students
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
RMMM.pdf make it easy to upload and study
Supply Chain Operations Speaking Notes -ICLT Program

Instructions Write a program whose main function is merely a.pdf

  • 1. Instructions Write a program whose main function is merely a collection of variable declarations and function calls. This program reads a text and outputs the letters, together with their counts, as explained below in the function printResult. (There can be no global variables! All information must be passed in and out of the functions. Use a structure to store the information.) Your program must consist of at least the following functions: Function openFile: Opens the input and output files. You must pass the file streams as parameters (by reference, of course). If the file does not exist, the program should print an appropriate message ("The input file does not exist.") and exit. The program must ask the user for the names of the input and output files. Function count: Counts every occurrence of capital letters A-Z and small letters a-z in the text file opened in the function openFile. This information must go into an array of structures. The array must be passed as a parameter, and the file identifier must also be passed as a parameter. Function printResult: Prints the number of capital letters and small letters, as well as the percentage of capital letters for every letter A-Z and the percentage of small letters for every letter a-z. The percentages should look like this: "25%".This information must come from an array of structures, and this array must be passed as a parameter. Your program should prompt the user for name of the input file, then the name of the output file.