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
Please i need help here.. am giving brainliest.
Stels [109]

Answer:

1. High performance

The first and foremost characteristic of an expert system is to deliver high performance 24×7

2. Understandable

The expert system should be easy to comprehend for all the people using it.

3. Reliable

An expert system has to be reliable in the sense that it is error-free so that it is trustable.

4. Highly Responsive

An expert system has to be proactive and provide responses for each and every detail of the problem.

Explanation:

Description of each

and sorry if wrong, don't be mad

7 0
2 years ago
Read 2 more answers
Consider the following method: static void nPrint(String a, int n) { System.out.println(a.charAt(n)); } What potential error cou
Juliette [100K]
<span>Briefly explain why it is necessary to critique a scientific argument before it is accepted.
</span>
4 0
3 years ago
Sorting and filtering are two ways to blank data
madreJ [45]
It’s two ways to analyze data
6 0
3 years ago
Linda is searching for a new job. Which information would her potential employers likely review in her social profile?
nasty-shy [4]
The answer will be A they would wanna know about her work history
3 0
3 years ago
Read 2 more answers
a) Write out an abstract class to represent a ball. Include data fields to store the weight of the ball as a double value and th
guapka [62]

Answer:

Check the explanation

Explanation:

//Ball.java

public abstract class Ball {

   double value;

   String color;

   public Ball() {

   }

   public Ball(double value, String color) {

       this.value = value;

       this.color = color;

   }

   public abstract void howToPlay();

}

////////////////////////////////////////////

//SoccerBall.java

public class SoccerBall extends Ball {

   public void howToPlay() {

       System.out.println("Description to how to play soccer ball");

   }

}

7 0
3 years ago
Read 2 more answers
Other questions:
  • An ___ is any person who spends times using technology at home
    10·1 answer
  • Why is it a good idea to view your HTML code in more than one web browser
    13·1 answer
  • What is master slide and tell about master slide
    6·1 answer
  • Match the number in the picture to the correct Excel interface part. Each number is only used one time.
    11·1 answer
  • There is an enormous amount of information on the Internet that is automatically separated into good content and not-so-good con
    15·1 answer
  • It is an array containing information such as headers, paths and script locations wherein it is created by the web server itself
    8·1 answer
  • In two to three sentences, describe one advanced search strategy and how it is useful.
    13·1 answer
  • TP1. लेखा अभिलेखको अर्थ उल्लेख गर्नुहोस् । (State the mea
    15·1 answer
  • I CANT DO SKIN MODS ON BRAWLHALLA RIGHT!!!! IM SO MADDDDDDDDDDD
    11·1 answer
  • write a program that computes an integer's checksum. to compute the checksum, break the integer into its constituent
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!