SlideShare a Scribd company logo
1 of 8
CODIGO VISUAL BASIC
Sub copia_y_pega()
Dim texto As String
Dim contador As Integer
Dim contador2 As Integer
Dim contador3 As Integer
Open "C:UsersFreddyDocumentsprueba.txt" For Input As #1
texto = Input(LOF(1), #1)
MsgBox ("PROGRAMA PARA CONTAR MAYUSCULAS,MINUSCULAS,VOCALES DESDE UN ARCHIVO DE TEXTO")
For i = 1 To Len(texto)
If Mid(texto, i, 1) = "b" Or Mid(texto, i, 1) = "c" Or Mid(texto, i, 1) = "d" Or Mid(texto, i, 1) = "f" Or Mid(texto, i, 1) = "g" Or Mid(texto, i, 1) = "h" Or
Mid(texto, i, 1) = "j" Or Mid(texto, i, 1) = "k" Or Mid(texto, i, 1) = "l" Or Mid(texto, i, 1) = "m" Or Mid(texto, i, 1) = "n" Or Mid(texto, i, 1) = "ñ" Or
Mid(texto, i, 1) = "p" Or Mid(texto, i, 1) = "q" Or Mid(texto, i, 1) = "r" Or Mid(texto, i, 1) = "s" Or Mid(texto, i, 1) = "t" Or Mid(texto, i, 1) = "v" Or
Mid(texto, i, 1) = "w" Or Mid(texto, i, 1) = "x" Or Mid(texto, i, 1) = "y" Or Mid(texto, i, 1) = "z" Then
contador = contador + 1
End If
If Mid(texto, i, 1) = "a" Or Mid(texto, i, 1) = "e" Or Mid(texto, i, 1) = "i" Or Mid(texto, i, 1) = "o" Or Mid(texto, i, 1) = "u" Then
contador2 = contador2 + 1
End If
If Mid(texto, i, 1) = "A" Or Mid(texto, i, 1) = "B" Or Mid(texto, i, 1) = "C" Or Mid(texto, i, 1) = "D" Or Mid(texto, i, 1) = "E" Or Mid(texto, i, 1) =
"F" Or Mid(texto, i, 1) = "G" Or Mid(texto, i, 1) = "H" Or Mid(texto, i, 1) = "I" Or Mid(texto, i, 1) = "J" Or Mid(texto, i, 1) = "K" Or Mid(texto, i, 1) =
"L" Or Mid(texto, i, 1) = "M" Or Mid(texto, i, 1) = "N" Or Mid(texto, i, 1) = "Ñ" Or Mid(texto, i, 1) = "O" Or Mid(texto, i, 1) = "P" Or Mid(texto, i, 1) =
"Q" Or Mid(texto, i, 1) = "R" Or Mid(texto, i, 1) = "S" Or Mid(texto, i, 1) = "T" Or Mid(texto, i, 1) = "U" Or Mid(texto, i, 1) = "V" Or Mid(texto, i, 1) =
"W" Or Mid(texto, i, 1) = "X" Or Mid(texto, i, 1) = "Y" Or Mid(texto, i, 1) = "Z" Then
contador3 = contador3 + 1
End If
Next i
MsgBox ("El numero de mayusculas es: " & contador3)
MsgBox ("El numero de consonantes es: " & contador)
MsgBox ("El numero de vocales es: " & contador2)
Close #1
End Sub
LENGUAJE C
#include "stdio.h"
#include "stdafx.h"
#include "string.h"
#include "stdlib.h"
# include "fstream"
int main(int argc, char **argv)
{
FILE *pfsArchivo;
char ch, txt[300] = "";
int j = 0;
int a = 0, e = 0, i = 0, o = 0, u = 0, acumulador = 0, suma = 0, acumulador2 = 0;
int nas = 0, nes = 0, nis = 0, nos = 0, nus = 0, nbs = 0, ncs = 0, nds = 0, nfs = 0, ngs = 0, nhs = 0, nps = 0, nqs = 0, nrs = 0, nss = 0, nts
= 0, nvs = 0, njs = 0, nks = 0, nls = 0, nms = 0, nns = 0, nñs = 0, nws = 0, nxs = 0, nys = 0, nzs = 0;
printf("t PROGRAMA PARA ENCONTRAR MAYUSCULAS, VOCALES Y CONSONANTESn");
printf("ttt DESDE UN ARCHIVO DE TEXTOn");
printf("nCONTENIDO DE SU DOCUMENTO:n");
pfsArchivo = fopen("C:UsersFreddyDocumentsprueba.txt", "r");
if (pfsArchivo == NULL)
{
printf("No se pudo abrir el archivo %s n", "prueba.txt");
}
else
{
while ((txt[j] = getc(pfsArchivo)) != EOF)
{
ch = txt[j];
switch (ch)
{
case 'a':
nas++;
txt[j] = 'a';
break;
case 'e':
nes++;
txt[j] = 'e';
break;
case 'i':
nis++;
txt[j] = 'i';
break;
case 'o':
nos++;
txt[j] = 'o';
break;
case 'u':
nus++;
txt[j] = 'u';
break;
case 'b':
nbs++;
txt[j] = 'b';
break;
case 'c':
ncs++;
txt[j] = 'c';
break;
case 'd':
nds++;
txt[j] = 'd';
break;
case 'f':
nfs++;
txt[j] = 'f';
break;
case 'g':
ngs++;
txt[j] = 'g';
break;
case 'h':
nhs++;
txt[j] = 'h';
break;
case 'j':
njs++;
txt[j] = 'j';
break;
case 'k':
nks++;
txt[j] = 'k';
break;
case 'l':
nls++;
txt[j] = 'l';
break;
case 'm':
nms++;
txt[j] = 'm';
break;
case 'n':
nns++;
txt[j] = 'n';
break;
case 'ñ':
nñs++;
txt[j] = 'ñ';
break;
case 'p':
nps++;
txt[j] = 'p';
break;
case 'q':
nqs++;
txt[j] = 'q';
break;
case 'r':
nrs++;
txt[j] = 'r';
break;
case 's':
nss++;
txt[j] = 's';
break;
case 't':
nts++;
txt[j] = 't';
break;
case 'v':
nvs++;
txt[j] = 'v';
break;
case 'w':
nws++;
txt[j] = 'w';
break;
case 'x':
nxs++;
txt[j] = 'x';
break;
case 'y':
nys++;
txt[j] = 'y';
break;
case 'z':
nzs++;
txt[j] = 'z';
break;
}
j++;
}
for (j = 0; j < 100; j++)
{
if (txt[j] >= 65 && txt[j] <= 90)
{
suma++;
}
}
printf("n%sn", &txt);
}
acumulador2 = acumulador2 + nbs + ncs + nds + nfs + ngs + nhs + nps + nqs + nrs + nss + nts + nvs + njs + nks + nls + nms + nns +
nñs + nws + nxs + nys + nzs;
acumulador = acumulador + nas + nes + nis + nos + nus;
printf("nOBSERVACIONES :n");
printf("nEl numero de mayusculas es: %d", suma);
printf("nEl numero de vocales es: %d", acumulador);
printf("nEl numero de consonantes es: %d", acumulador2);
fclose(pfsArchivo);
getchar();
return 0;
}
CODIGO JAVA
package javaapplication4;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;
public class JavaApplication4
{
public static void main(String[] args)
{
Scanner dato = new Scanner(System.in);
int Contador1= 0;
int Contador2 = 0;
int Contador = 0;
System.out.println("t PROGRAMA PARA ENCONTRAR MAYUSCULAS, VOCALES Y CONSONANTESn");
System.out.println("ttt DESDE UN ARCHIVO DE TEXTOn");
System.out.println("nCONTENIDO DE SU DOCUMENTO:");
try {
FileReader fr = new FileReader("C:UsersFreddyDocumentsprueba.txt");
BufferedReader bf = new BufferedReader(fr);
String sCadena;
sCadena="prueba.txt";
while ((sCadena = bf.readLine())!=null)
{
System.out.println(sCadena);
for(int i=0; i<sCadena.length(); i++)
{
if(sCadena.charAt(i) == 'a' || sCadena.charAt(i) == 'e' || sCadena.charAt(i) == 'i' || sCadena.charAt(i) == 'o' ||
sCadena.charAt(i) == 'u')
Contador1++;
else
if(sCadena.charAt(i) == 'b' || sCadena.charAt(i) == 'c' || sCadena.charAt(i) == 'd' || sCadena.charAt(i) == 'f' ||
sCadena.charAt(i) == 'g'||sCadena.charAt(i) == 'h' || sCadena.charAt(i) == 'j' || sCadena.charAt(i) == 'k' || sCadena.charAt(i) == 'l' ||
sCadena.charAt(i) == 'm'||sCadena.charAt(i) == 'n' || sCadena.charAt(i) == 'ñ' || sCadena.charAt(i) == 'p' || sCadena.charAt(i) == 'q' ||
sCadena.charAt(i) == 'r'||sCadena.charAt(i) == 's' || sCadena.charAt(i) == 't' || sCadena.charAt(i) == 'v' || sCadena.charAt(i) == 'w' ||
sCadena.charAt(i) == 'x'|| sCadena.charAt(i) == 'y'|| sCadena.charAt(i) == 'z')
Contador2++;
else
if(sCadena.charAt(i) == 'A' || sCadena.charAt(i) == 'E' || sCadena.charAt(i) == 'I' || sCadena.charAt(i) == 'O' ||
sCadena.charAt(i) == 'U')
Contador++;
else
if (sCadena.charAt(i) == 'B' || sCadena.charAt(i) == 'C' || sCadena.charAt(i) == 'D' || sCadena.charAt(i) == 'E' ||
sCadena.charAt(i) == 'F'||sCadena.charAt(i) == 'J' || sCadena.charAt(i) == 'H' || sCadena.charAt(i) == 'K' || sCadena.charAt(i) == 'L' ||
sCadena.charAt(i) == 'M'||sCadena.charAt(i) == 'N' || sCadena.charAt(i) == 'Ñ' || sCadena.charAt(i) == 'O' || sCadena.charAt(i) == 'P' ||
sCadena.charAt(i) == 'Q'||sCadena.charAt(i) == 'R' || sCadena.charAt(i) == 'S' || sCadena.charAt(i) == 'T' || sCadena.charAt(i) == 'V' ||
sCadena.charAt(i) == 'W'||sCadena.charAt(i) == 'X'||sCadena.charAt(i) == 'Y'|| sCadena.charAt(i) == 'Z') {
Contador++;
}
}
}
System.out.println("nOBSERVACIONES:");
System.out.print("nEl numero de vocales es: "+Contador1);
System.out.print("nEl numero de consonantes es: "+Contador2);
System.out.print("nEl numero de mayusculas es: "+Contador);
}
catch (FileNotFoundException fnfe)
{
} catch (IOException ioe)
{
}
}
}

More Related Content

What's hot

ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionIan Barber
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleIan Barber
 
Railson dickinson 5 mil seguidores
Railson dickinson 5 mil seguidoresRailson dickinson 5 mil seguidores
Railson dickinson 5 mil seguidoresRailson Dickinson
 
Dropping ACID with MongoDB
Dropping ACID with MongoDBDropping ACID with MongoDB
Dropping ACID with MongoDBkchodorow
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giantsIan Barber
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with itFlavien Raynaud
 
Grails - The search is over
Grails - The search is overGrails - The search is over
Grails - The search is overFelipe Coutinho
 
よく使うテストヘルパーの紹介 #ios_test_night
よく使うテストヘルパーの紹介 #ios_test_nightよく使うテストヘルパーの紹介 #ios_test_night
よく使うテストヘルパーの紹介 #ios_test_nightKenji Tanaka
 
File handling complete programs in c++
File handling complete programs in c++File handling complete programs in c++
File handling complete programs in c++zain ul hassan
 
Solr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanSolr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanGregg Donovan
 
When RegEx is not enough
When RegEx is not enoughWhen RegEx is not enough
When RegEx is not enoughNati Cohen
 
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQAFest
 
C++ adt c++ implementations
C++   adt c++ implementationsC++   adt c++ implementations
C++ adt c++ implementationsRex Mwamba
 
Webinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation FrameworkWebinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation FrameworkMongoDB
 
Easy to Learn C language program
Easy to Learn C language programEasy to Learn C language program
Easy to Learn C language programHitarth Patel
 
Mongodb Aggregation Pipeline
Mongodb Aggregation PipelineMongodb Aggregation Pipeline
Mongodb Aggregation Pipelinezahid-mian
 

What's hot (19)

ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 VersionZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
 
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made SimpleZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
 
Railson dickinson 5 mil seguidores
Railson dickinson 5 mil seguidoresRailson dickinson 5 mil seguidores
Railson dickinson 5 mil seguidores
 
Dropping ACID with MongoDB
Dropping ACID with MongoDBDropping ACID with MongoDB
Dropping ACID with MongoDB
 
How to stand on the shoulders of giants
How to stand on the shoulders of giantsHow to stand on the shoulders of giants
How to stand on the shoulders of giants
 
How to write rust instead of c and get away with it
How to write rust instead of c and get away with itHow to write rust instead of c and get away with it
How to write rust instead of c and get away with it
 
Grails - The search is over
Grails - The search is overGrails - The search is over
Grails - The search is over
 
よく使うテストヘルパーの紹介 #ios_test_night
よく使うテストヘルパーの紹介 #ios_test_nightよく使うテストヘルパーの紹介 #ios_test_night
よく使うテストヘルパーの紹介 #ios_test_night
 
File handling complete programs in c++
File handling complete programs in c++File handling complete programs in c++
File handling complete programs in c++
 
08 php-files
08 php-files08 php-files
08 php-files
 
C99.php
C99.phpC99.php
C99.php
 
Solr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg DonovanSolr & Lucene @ Etsy by Gregg Donovan
Solr & Lucene @ Etsy by Gregg Donovan
 
Grails queries
Grails   queriesGrails   queries
Grails queries
 
When RegEx is not enough
When RegEx is not enoughWhen RegEx is not enough
When RegEx is not enough
 
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
 
C++ adt c++ implementations
C++   adt c++ implementationsC++   adt c++ implementations
C++ adt c++ implementations
 
Webinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation FrameworkWebinar: Exploring the Aggregation Framework
Webinar: Exploring the Aggregation Framework
 
Easy to Learn C language program
Easy to Learn C language programEasy to Learn C language program
Easy to Learn C language program
 
Mongodb Aggregation Pipeline
Mongodb Aggregation PipelineMongodb Aggregation Pipeline
Mongodb Aggregation Pipeline
 

Viewers also liked

Companies financial result updated on 6t th august 2015
Companies financial result updated on 6t th august 2015Companies financial result updated on 6t th august 2015
Companies financial result updated on 6t th august 2015RAFI SECURITIES (PVT.)LTD.
 
Hak anak dalam islam
Hak anak dalam islamHak anak dalam islam
Hak anak dalam islamLukman Hakim
 
Recently completed projects
Recently completed projectsRecently completed projects
Recently completed projectsKyle Simonetta
 
FBIF2015:aarlt 全球化和本地化
FBIF2015:aarlt 全球化和本地化FBIF2015:aarlt 全球化和本地化
FBIF2015:aarlt 全球化和本地化Simba Events
 
UNIVERSIDAD CENTRAL DEL ECUADOR C++
UNIVERSIDAD CENTRAL DEL ECUADOR C++UNIVERSIDAD CENTRAL DEL ECUADOR C++
UNIVERSIDAD CENTRAL DEL ECUADOR C++CamiEscobar1995
 
Jason Tew Portfolio
Jason Tew PortfolioJason Tew Portfolio
Jason Tew PortfolioJason Tew
 
翡翠為何會變?
翡翠為何會變?翡翠為何會變?
翡翠為何會變?neo423
 
April 2015 assignment 1
April 2015 assignment 1April 2015 assignment 1
April 2015 assignment 1AdeleLu
 

Viewers also liked (10)

Virtual Keyboard
Virtual KeyboardVirtual Keyboard
Virtual Keyboard
 
Liwen
LiwenLiwen
Liwen
 
Companies financial result updated on 6t th august 2015
Companies financial result updated on 6t th august 2015Companies financial result updated on 6t th august 2015
Companies financial result updated on 6t th august 2015
 
Hak anak dalam islam
Hak anak dalam islamHak anak dalam islam
Hak anak dalam islam
 
Recently completed projects
Recently completed projectsRecently completed projects
Recently completed projects
 
FBIF2015:aarlt 全球化和本地化
FBIF2015:aarlt 全球化和本地化FBIF2015:aarlt 全球化和本地化
FBIF2015:aarlt 全球化和本地化
 
UNIVERSIDAD CENTRAL DEL ECUADOR C++
UNIVERSIDAD CENTRAL DEL ECUADOR C++UNIVERSIDAD CENTRAL DEL ECUADOR C++
UNIVERSIDAD CENTRAL DEL ECUADOR C++
 
Jason Tew Portfolio
Jason Tew PortfolioJason Tew Portfolio
Jason Tew Portfolio
 
翡翠為何會變?
翡翠為何會變?翡翠為何會變?
翡翠為何會變?
 
April 2015 assignment 1
April 2015 assignment 1April 2015 assignment 1
April 2015 assignment 1
 

Similar to C++

COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILEAnushka Rai
 
Ejercicios de estilo en la programación
Ejercicios de estilo en la programaciónEjercicios de estilo en la programación
Ejercicios de estilo en la programaciónSoftware Guru
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in cgkgaur1987
 
Presentation R basic teaching module
Presentation R basic teaching modulePresentation R basic teaching module
Presentation R basic teaching moduleSander Timmer
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayUtkarsh Sengar
 
So I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfSo I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfezonesolutions
 
Os scheduling Algorithms
Os scheduling AlgorithmsOs scheduling Algorithms
Os scheduling AlgorithmsNeelamani Samal
 
Testing CLI tools with Go
Testing CLI tools with GoTesting CLI tools with Go
Testing CLI tools with GoRicardo Gerardi
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout source{d}
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysisVishal Singh
 

Similar to C++ (20)

C Language Lecture 22
C Language Lecture 22C Language Lecture 22
C Language Lecture 22
 
Linq introduction
Linq introductionLinq introduction
Linq introduction
 
String Manipulation Function and Header File Functions
String Manipulation Function and Header File FunctionsString Manipulation Function and Header File Functions
String Manipulation Function and Header File Functions
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
Ejercicios de estilo en la programación
Ejercicios de estilo en la programaciónEjercicios de estilo en la programación
Ejercicios de estilo en la programación
 
Mouse programming in c
Mouse programming in cMouse programming in c
Mouse programming in c
 
Day3
Day3Day3
Day3
 
Presentation R basic teaching module
Presentation R basic teaching modulePresentation R basic teaching module
Presentation R basic teaching module
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
Alastair Butler - 2015 - Round trips with meaning stopovers
Alastair Butler - 2015 - Round trips with meaning stopoversAlastair Butler - 2015 - Round trips with meaning stopovers
Alastair Butler - 2015 - Round trips with meaning stopovers
 
C programms
C programmsC programms
C programms
 
So I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdfSo I am writing a CS code for a project and I keep getting cannot .pdf
So I am writing a CS code for a project and I keep getting cannot .pdf
 
Design problem
Design problemDesign problem
Design problem
 
C Language Lecture 13
C Language Lecture 13C Language Lecture 13
C Language Lecture 13
 
Os scheduling Algorithms
Os scheduling AlgorithmsOs scheduling Algorithms
Os scheduling Algorithms
 
Testing CLI tools with Go
Testing CLI tools with GoTesting CLI tools with Go
Testing CLI tools with Go
 
Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout Introduction to source{d} Engine and source{d} Lookout
Introduction to source{d} Engine and source{d} Lookout
 
Numerical analysis
Numerical analysisNumerical analysis
Numerical analysis
 
Java Week4(C) Notepad
Java Week4(C)   NotepadJava Week4(C)   Notepad
Java Week4(C) Notepad
 
Data structures
Data structuresData structures
Data structures
 

Recently uploaded

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

C++

  • 1. CODIGO VISUAL BASIC Sub copia_y_pega() Dim texto As String Dim contador As Integer Dim contador2 As Integer Dim contador3 As Integer Open "C:UsersFreddyDocumentsprueba.txt" For Input As #1 texto = Input(LOF(1), #1) MsgBox ("PROGRAMA PARA CONTAR MAYUSCULAS,MINUSCULAS,VOCALES DESDE UN ARCHIVO DE TEXTO") For i = 1 To Len(texto) If Mid(texto, i, 1) = "b" Or Mid(texto, i, 1) = "c" Or Mid(texto, i, 1) = "d" Or Mid(texto, i, 1) = "f" Or Mid(texto, i, 1) = "g" Or Mid(texto, i, 1) = "h" Or Mid(texto, i, 1) = "j" Or Mid(texto, i, 1) = "k" Or Mid(texto, i, 1) = "l" Or Mid(texto, i, 1) = "m" Or Mid(texto, i, 1) = "n" Or Mid(texto, i, 1) = "ñ" Or Mid(texto, i, 1) = "p" Or Mid(texto, i, 1) = "q" Or Mid(texto, i, 1) = "r" Or Mid(texto, i, 1) = "s" Or Mid(texto, i, 1) = "t" Or Mid(texto, i, 1) = "v" Or Mid(texto, i, 1) = "w" Or Mid(texto, i, 1) = "x" Or Mid(texto, i, 1) = "y" Or Mid(texto, i, 1) = "z" Then contador = contador + 1 End If If Mid(texto, i, 1) = "a" Or Mid(texto, i, 1) = "e" Or Mid(texto, i, 1) = "i" Or Mid(texto, i, 1) = "o" Or Mid(texto, i, 1) = "u" Then contador2 = contador2 + 1 End If If Mid(texto, i, 1) = "A" Or Mid(texto, i, 1) = "B" Or Mid(texto, i, 1) = "C" Or Mid(texto, i, 1) = "D" Or Mid(texto, i, 1) = "E" Or Mid(texto, i, 1) = "F" Or Mid(texto, i, 1) = "G" Or Mid(texto, i, 1) = "H" Or Mid(texto, i, 1) = "I" Or Mid(texto, i, 1) = "J" Or Mid(texto, i, 1) = "K" Or Mid(texto, i, 1) = "L" Or Mid(texto, i, 1) = "M" Or Mid(texto, i, 1) = "N" Or Mid(texto, i, 1) = "Ñ" Or Mid(texto, i, 1) = "O" Or Mid(texto, i, 1) = "P" Or Mid(texto, i, 1) = "Q" Or Mid(texto, i, 1) = "R" Or Mid(texto, i, 1) = "S" Or Mid(texto, i, 1) = "T" Or Mid(texto, i, 1) = "U" Or Mid(texto, i, 1) = "V" Or Mid(texto, i, 1) = "W" Or Mid(texto, i, 1) = "X" Or Mid(texto, i, 1) = "Y" Or Mid(texto, i, 1) = "Z" Then contador3 = contador3 + 1 End If Next i MsgBox ("El numero de mayusculas es: " & contador3) MsgBox ("El numero de consonantes es: " & contador) MsgBox ("El numero de vocales es: " & contador2) Close #1 End Sub
  • 2. LENGUAJE C #include "stdio.h" #include "stdafx.h" #include "string.h" #include "stdlib.h" # include "fstream" int main(int argc, char **argv) { FILE *pfsArchivo; char ch, txt[300] = ""; int j = 0; int a = 0, e = 0, i = 0, o = 0, u = 0, acumulador = 0, suma = 0, acumulador2 = 0; int nas = 0, nes = 0, nis = 0, nos = 0, nus = 0, nbs = 0, ncs = 0, nds = 0, nfs = 0, ngs = 0, nhs = 0, nps = 0, nqs = 0, nrs = 0, nss = 0, nts = 0, nvs = 0, njs = 0, nks = 0, nls = 0, nms = 0, nns = 0, nñs = 0, nws = 0, nxs = 0, nys = 0, nzs = 0; printf("t PROGRAMA PARA ENCONTRAR MAYUSCULAS, VOCALES Y CONSONANTESn"); printf("ttt DESDE UN ARCHIVO DE TEXTOn"); printf("nCONTENIDO DE SU DOCUMENTO:n"); pfsArchivo = fopen("C:UsersFreddyDocumentsprueba.txt", "r"); if (pfsArchivo == NULL) { printf("No se pudo abrir el archivo %s n", "prueba.txt"); } else { while ((txt[j] = getc(pfsArchivo)) != EOF) { ch = txt[j]; switch (ch) {
  • 3. case 'a': nas++; txt[j] = 'a'; break; case 'e': nes++; txt[j] = 'e'; break; case 'i': nis++; txt[j] = 'i'; break; case 'o': nos++; txt[j] = 'o'; break; case 'u': nus++; txt[j] = 'u'; break; case 'b': nbs++; txt[j] = 'b'; break; case 'c': ncs++; txt[j] = 'c'; break; case 'd': nds++; txt[j] = 'd'; break; case 'f': nfs++; txt[j] = 'f'; break;
  • 4. case 'g': ngs++; txt[j] = 'g'; break; case 'h': nhs++; txt[j] = 'h'; break; case 'j': njs++; txt[j] = 'j'; break; case 'k': nks++; txt[j] = 'k'; break; case 'l': nls++; txt[j] = 'l'; break; case 'm': nms++; txt[j] = 'm'; break; case 'n': nns++; txt[j] = 'n'; break; case 'ñ': nñs++; txt[j] = 'ñ'; break; case 'p': nps++; txt[j] = 'p'; break;
  • 5. case 'q': nqs++; txt[j] = 'q'; break; case 'r': nrs++; txt[j] = 'r'; break; case 's': nss++; txt[j] = 's'; break; case 't': nts++; txt[j] = 't'; break; case 'v': nvs++; txt[j] = 'v'; break; case 'w': nws++; txt[j] = 'w'; break; case 'x': nxs++; txt[j] = 'x'; break; case 'y': nys++; txt[j] = 'y'; break; case 'z': nzs++; txt[j] = 'z'; break; }
  • 6. j++; } for (j = 0; j < 100; j++) { if (txt[j] >= 65 && txt[j] <= 90) { suma++; } } printf("n%sn", &txt); } acumulador2 = acumulador2 + nbs + ncs + nds + nfs + ngs + nhs + nps + nqs + nrs + nss + nts + nvs + njs + nks + nls + nms + nns + nñs + nws + nxs + nys + nzs; acumulador = acumulador + nas + nes + nis + nos + nus; printf("nOBSERVACIONES :n"); printf("nEl numero de mayusculas es: %d", suma); printf("nEl numero de vocales es: %d", acumulador); printf("nEl numero de consonantes es: %d", acumulador2); fclose(pfsArchivo); getchar(); return 0; } CODIGO JAVA package javaapplication4; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; public class JavaApplication4 { public static void main(String[] args) { Scanner dato = new Scanner(System.in); int Contador1= 0; int Contador2 = 0;
  • 7. int Contador = 0; System.out.println("t PROGRAMA PARA ENCONTRAR MAYUSCULAS, VOCALES Y CONSONANTESn"); System.out.println("ttt DESDE UN ARCHIVO DE TEXTOn"); System.out.println("nCONTENIDO DE SU DOCUMENTO:"); try { FileReader fr = new FileReader("C:UsersFreddyDocumentsprueba.txt"); BufferedReader bf = new BufferedReader(fr); String sCadena; sCadena="prueba.txt"; while ((sCadena = bf.readLine())!=null) { System.out.println(sCadena); for(int i=0; i<sCadena.length(); i++) { if(sCadena.charAt(i) == 'a' || sCadena.charAt(i) == 'e' || sCadena.charAt(i) == 'i' || sCadena.charAt(i) == 'o' || sCadena.charAt(i) == 'u') Contador1++; else if(sCadena.charAt(i) == 'b' || sCadena.charAt(i) == 'c' || sCadena.charAt(i) == 'd' || sCadena.charAt(i) == 'f' || sCadena.charAt(i) == 'g'||sCadena.charAt(i) == 'h' || sCadena.charAt(i) == 'j' || sCadena.charAt(i) == 'k' || sCadena.charAt(i) == 'l' || sCadena.charAt(i) == 'm'||sCadena.charAt(i) == 'n' || sCadena.charAt(i) == 'ñ' || sCadena.charAt(i) == 'p' || sCadena.charAt(i) == 'q' || sCadena.charAt(i) == 'r'||sCadena.charAt(i) == 's' || sCadena.charAt(i) == 't' || sCadena.charAt(i) == 'v' || sCadena.charAt(i) == 'w' || sCadena.charAt(i) == 'x'|| sCadena.charAt(i) == 'y'|| sCadena.charAt(i) == 'z') Contador2++; else if(sCadena.charAt(i) == 'A' || sCadena.charAt(i) == 'E' || sCadena.charAt(i) == 'I' || sCadena.charAt(i) == 'O' || sCadena.charAt(i) == 'U') Contador++; else if (sCadena.charAt(i) == 'B' || sCadena.charAt(i) == 'C' || sCadena.charAt(i) == 'D' || sCadena.charAt(i) == 'E' || sCadena.charAt(i) == 'F'||sCadena.charAt(i) == 'J' || sCadena.charAt(i) == 'H' || sCadena.charAt(i) == 'K' || sCadena.charAt(i) == 'L' || sCadena.charAt(i) == 'M'||sCadena.charAt(i) == 'N' || sCadena.charAt(i) == 'Ñ' || sCadena.charAt(i) == 'O' || sCadena.charAt(i) == 'P' || sCadena.charAt(i) == 'Q'||sCadena.charAt(i) == 'R' || sCadena.charAt(i) == 'S' || sCadena.charAt(i) == 'T' || sCadena.charAt(i) == 'V' || sCadena.charAt(i) == 'W'||sCadena.charAt(i) == 'X'||sCadena.charAt(i) == 'Y'|| sCadena.charAt(i) == 'Z') {
  • 8. Contador++; } } } System.out.println("nOBSERVACIONES:"); System.out.print("nEl numero de vocales es: "+Contador1); System.out.print("nEl numero de consonantes es: "+Contador2); System.out.print("nEl numero de mayusculas es: "+Contador); } catch (FileNotFoundException fnfe) { } catch (IOException ioe) { } } }