1answer.
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
Aleksandr-060686 [28]
3 years ago
10

Write a program that reads the contents of a file named text.txt and determines the following: The number of uppercase letters i

n the file The number of lowercase letters in the file The number of digits in the file Prompts And Output Labels. There are no prompts-- nothing is read from standard in, just from the file text.txt. Each of the numbers calculated is displayed on a separate line on standard output , preceded by the following prompts (respectively): "Uppercase characters : ", "Lowercase characters : ", "Digits: ". Input Validation. None.
Computers and Technology
1 answer:
murzikaleks [220]3 years ago
3 0

Answer:

Explanation:

//Cpp program to count Uppercase, Lowercase, Digits count from file

#include<iostream>

#include<fstream>

using namespace std;

int main()

{

  //ifstream For reading file purpose only

ifstream file("text.txt");

 

  //cheks whether given file is present or not

  if(!file){

      cout<<"File not Found";

      return 0;

  }

  //variables for all three counts and character in file

char character;

int uppercaseCount=0, lowercaseCount=0, digitsCount=0;

  //loop for reading and checkile file character by character

while(file){

      //get a single character

file.get(character);

 

      //checks uppercase character

if((character >= 'A') && (character <= 'Z'))

uppercaseCount++;

     

      //checks lowercase character

 else if((character >= 'a') && (character <= 'z'))

lowercaseCount++;

     //checks lowercase character

      else if((character >= '0') && (character <= '9'))

      digitsCount++;

}

cout<<"\nUppercase characters: "<<uppercaseCount;

cout<<"\nLowercase characters: "<<lowercaseCount;

cout<<"\nDigits: "<<digitsCount;

return 0;

}

/*

content of File text.txt

C++

10.15: Character Analysis Write a program that reads the contents of a file named text.txt and determines the following: The number of uppercase letters in the file The number of lowercase letters in the file The number of digits in the file Prompts And Output Labels. There are no prompts-- nothing is read from standard in, just from the file text.txt. Each of the numbers calculated is displayed on a separate line on standard output, preceded by the following prompts (respectively): "Uppercase characters: ", "Lowercase characters: ", "Digits: ". Input Validation. None.

Output :-

Uppercase characters: 19

Lowercase characters: 434

Digits: 4

*/

You might be interested in
What is data and instructions entered into the memory of a device
lyudmila [28]

A POINTING DEVICE IS AN INPUT DEVICE THAT ALLOWS A USER TO CONTROL A POINTER ON THE SCREEN. ... A KEYBOARD IS AN INPUT DEVICE THAT CONTAINS KEYS USER TO ENTER DATA AND INSTRUCTIONS INTO A COMPUTER.                                                                            

SORRY FOR CAPS MY CAPS KEY GOT STUCK

3 0
3 years ago
What benefits did evolution realize by using the crm software?
Elza [17]
Hello there!
Answer:
Have included productivity improvements (doubling the number of deliveries for a speci²c time period), enhanced inventory management, automation of picklists, better resource planning, and more e±ective reporting to key stakeholders. Evolution’s CRM system can determine deliveries planned for any future month and the amount of product in stock, helping Evolution reduce stock holding by 40%. When a new patient is keyed onto system, tasks can be generated for Evolution’s team to organize delivery ahead of time. The system automatically generates a pick list for that patient from Evolution’s pharmacy. Managers can see tasks 2 weeks ahead and can allocate resources accordingly. Hoping this helps you! :D
4 0
3 years ago
La sección de lectores de un diario de la ciudad impone como única restricción para la publicación de las cartas, que el texto d
kap26 [50]

Answer:

El tamaño de un archivo .txt que contenga esa cantidad de texto será de 1.46 KB.

Explanation:

Se entiende que todo caracter informático posee un tamaño de 1 byte, con lo cual en total el texto no puede superar los 1,500 bytes de tamaño.

Ahora bien, un kilobyte es una unidad de medida informática superior, que se compone de 1,024. Por lo tanto, dado que 1,500 - 1,024 es igual a 474, el tamaño del archivo será de 1 KB y 474 bytes. Así, para calcular el tamaño total del archivo en KB, se debe realizar el siguiente cálculo:

1,024 = 1

474 = X

((474 x 1) / 1,024) = X

0.46 = X

Así, el tamaño de un archivo .txt que contenga esa cantidad de texto será de 1.46 KB.

4 0
3 years ago
7 Annie must pay in taxes to the state<br> government on her investment.
svetoff [14.1K]

Answer:

is that the question?

Explanation:

6 0
3 years ago
Read 2 more answers
A collaborative web page that is designed to be edited and republished by a variety of individuals is known as a(n) ____.
avanturin [10]
<span>A collaborative Web page that is designed to be edited and republished by a variety of individuals is called ad Wiki. A wiki is a server program that allows users to collaborate in forming the content of a Web site. The term comes from the word "wikiwiki," which means "fast" in the Hawaiian language.The simplest wiki programs allow users to create and edit content.</span>
4 0
3 years ago
Other questions:
  • How can i save a word 2016 document as a word 2016 document?
    6·1 answer
  • Who is the owner of microsoft company​
    12·1 answer
  • Look at the top 3 banking activities done via mobile banking vs. online banking. What characteristics do you notice for both?
    9·1 answer
  • What is the difference between hardware and software?
    9·1 answer
  • Assume that the array arr has been defined and initialized with the values {4, 2, 5, 3, 1}. What are the values in the array arr
    15·1 answer
  • Virtualization, like cloud computing, is a technology that can be useful for _____ sites. hot warm business cold
    9·1 answer
  • What is a navigation bar?
    7·1 answer
  • What type of media is a hard disk​
    9·1 answer
  • 1. why is manufacturing considered the biggest contributor to progress
    9·1 answer
  • Plagiarism is considered
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!