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
The ____ is the period of time within which systems, applications, or functions must be recovered after an outage. Select one:
scZoUnD [109]

Answer:

c. recovery time objective                                                  

Explanation:

  • Recovery time objective (RTO) is the maximum acceptable duration permitted between an unfortunate loss or failure and the restoration of normal operations and services.
  • According to the RTO, the systems, applications or operations must be restored within a targeted time period after a disaster, to avoid unacceptable outcomes of the disruption.
  • So a business process must be recovered within this period of time.
  • It measures how much a failure affects the normal operations, applications and systems and RTO is measures in time units like seconds minutes hours or days.
  • In simple words RTO refers to the time you need to restore system, applications and data.
  • For instance a 2-hour RTO refers to restore and get operations or services back to running within 2 hours of the service failure or outrage.
6 0
3 years ago
A colleague has included you on an email that is irrelevant to you, but it continues to come to your inbox because people are us
Law Incorporation [45]

on google there is a mute function with the 3 dots on the top and outlook has it in the same location but under the word of "ignore"

7 0
3 years ago
An entrepreneur wants to make an app to show what breeds of dogs are similar to each other. She wants to look at factors such as
Alex

Answer

Dog breeds = observations, Average weight and energy level for each breed = variables. Each cluster is a category.

Explanation:

Using a method of clustering, she would be putting the dog breeds that are more similar together and in order to do this she has to look at various factors such as observation which are the dog breeds, and the average weight and energy level of the breeds, which represents variables. Every one of these clusters would be a category.

7 0
3 years ago
In best practice, should you use all lowercase, all uppercase or a mixture of cases in HTML tag names?
mixas84 [53]
B considering it’s proper english, we went through this about a week ago
7 0
2 years ago
dose anyone do gacha or even tikt.ok or sumthin i try see sumthin here rq (i do both so i dont judge XD)
torisob [31]

Answer:

I used to do tik to k but I never did the other one

Explanation:

please mark me as brainliest

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which one of the following features can control left and right indents on using markers
    8·1 answer
  • Need help answering this
    7·1 answer
  • You have just driven to the Hewlett-Packard site in Corvallis to field-interview a programmer. You sit down in a conference room
    6·1 answer
  • teve wants to use Google Display Ads to reach new customers who are looking to purchase products similar to his. Which audience
    14·1 answer
  • The ---------------initiates a message by encoding theidea (or a thought) in words or symbols and sends it to areceiver.ChannelS
    10·1 answer
  • Suppose Alice, Bob, and Carol want to use secret key technology to authenticate each other. If they all used the same secret key
    10·1 answer
  • write a loop that reads positive integers from stands input and that terinated when it reads an interger that is not positive af
    10·1 answer
  • What is garbage in garbage out?​
    15·1 answer
  • ____________ are designed to delete temporary files (such as deleted files still in the Recycle Bin, temporary Internet files, t
    10·2 answers
  • When an interviewer asks "tell me about yourself", you should tell them about your childhood past. please select the best answer
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!