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
 

Similar to VB, C, Java code to count characters

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 VB, C, Java code to count characters (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
 

More from CamiEscobar1995

UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++CamiEscobar1995
 
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARSUNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARSCamiEscobar1995
 
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARSUNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARSCamiEscobar1995
 

More from CamiEscobar1995 (6)

UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ C+++
 
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARSUNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
 
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARSUNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
 
C++
C++C++
C++
 
Getchars
GetcharsGetchars
Getchars
 
Getchars
GetcharsGetchars
Getchars
 

Recently uploaded

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
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)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
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
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
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
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
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
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
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
 

VB, C, Java code to count characters

  • 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) { } } }