C++ :: How To Put 2 Letters Together And Make Them To Count As 1
Mar 11, 2013
how to put 2 letters together and make them to count as 1?
provided that they must consecutive
for example:
p : count as 0
pxp : count as 0
pp : count as 1
xpxp: count as 0
ppxpp : count as 2
View 1 Replies
ADVERTISEMENT
Mar 16, 2013
I'm just trying to find out if the way I've setup my code currently allows me to count the letters as they occur? I don't yet see how to do it but I need clarification. Ideally the function letterCounter would do the counting but atm I'm just trying to figuring it out in the display function.
View 2 Replies
View Related
May 5, 2014
I am creating a program where I count all the letters of the alphabet from a user submitted string.
How would I go about this?
I am completely new, so simplicity is best. I am suppose to use arrays.
View 4 Replies
View Related
Dec 20, 2014
Write a c++ program to count no of letters in a given line
Write a c++ program to calculate employee salary
validation : for the salary less than 5000
a. HRA IS 15% OF BASIC salary
b. DA is 35% of basic salary
for salary above 5000
a. HRA is 5% of basic salary
b. DA is 25% of basic salary
View 7 Replies
View Related
May 10, 2014
I have to count the letters from a text file into an array so the first spot is the number of A's second spot number of B's and so on then take the array and sort it in decending order how could i do this without loosing track of where the numbers go so if there are more b's than a's they switch but how will i know where each letter has moved in the array after it has been sorted?
View 1 Replies
View Related
Nov 11, 2014
char ch;
int uppercase=0;
int lowercase=0;
file.open(pav.c_str());
while(!file.eof()) {
[Code] .....
So I need to count uppercase and lowercase letters from file, and I always get 0. What is the problem with this part of code?
View 10 Replies
View Related
Oct 11, 2013
how to count and display the palindromes in this randomized letters:
this is my program but it only prints randomized letters and can't count the palindromes words and display it:
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
[Code].....
View 2 Replies
View Related
Apr 10, 2014
I try to use "rand" to create 100 string, I'm happy I succeed, but next step i wanna know how to count each number of letters and the frequency it shows.
Here is the code:
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iostream>
// using namespace std;
int main() {
const char *c = "abcdefghijklmnopqrstuvwxyz";
[Code] ......
View 1 Replies
View Related
Mar 9, 2014
I am supposed to make a scrabble game and randomize 10 of the letters.
Here's my code:
class Spinner
Spinner::Spinner(string things[], int numThings[], int n)
{
currentPosition = 0;
[Code].....
View 2 Replies
View Related
Feb 9, 2015
I have to make a function that i'll later be able to use for a ceasar cypher. The letters should shift a user inputted number. This is what I have so far:
char shiftChar(char c, int s) {
char ch = c;
int shift = s;
int newC;
newC = int(ch) + shift;
return newC;
}
The problem with this, is that it doesn't loop back to the start of the alphabet once i get past z.
View 2 Replies
View Related
Dec 16, 2014
4.1 Write a program that will count from 1 to 12 and print the count, and its square, for each count.
4.2 Write a program that counts from 1 to 12 and prints the count and its inversion to 5 decimal places for each count. This will require a floating point number.
4.3 Write a program that will count from 1 to 100 and print only those values between 32 and 39, one to a line. Use the incrementing operator for this program.
View 2 Replies
View Related
Jan 26, 2013
Code:
#include<stdio.h>
#include<string.h>
#define a 9
#define b 9
#define c 3
int main() {
[Code] .....
In practice section there was a challenge to print up numbers in letters up to billion including negatives I didn't look at the solution and came up with this but it is getting difficult after this point....
View 9 Replies
View Related
Nov 14, 2013
These are the instructions: read a number between 1-26 and build a parallelogram in the size (height&width) of the number entered.
Each row of the parallelogram will be built from each capital letter from 1 to the number read (max 26).for example: by entering the number 3, will be printed:
AAA
_BBB
__CCC
for the number 4:
AAAA
_BBBB
__CCCC
___DDDD
I am struggling with how to change each char in every different row, how do I print this parallelogram ?
View 8 Replies
View Related
Jun 3, 2014
i m trying to write a code that would convert a each letter from a text to their decimal images . while i was able to write the part of entering the text , i cant do the converting part , i searched all day on the internet and found nothing.
View 3 Replies
View Related
Jun 1, 2013
I have a text file in which i need to read only selected letters and substitute them with integers to calculate.
Eg:-
In the text file
f2,h1
Here i need to read only the the letters f & h and substitute them with some integer and add them up.
View 1 Replies
View Related
Nov 28, 2013
I need help writing a program where I use small letter to write names in Big letters. (I dont know if you understand what i mean). Follow link to description.
[URL]
View 6 Replies
View Related
May 3, 2013
I have a function that is suppose to swap positions of 2 letters but It doesn't seem to work. Im passing in the array of char into the function.
void swapletter(char word[]) {
char temp1;
int swap1;
int swap2;
cout<<"What is the first location: ";
cin>>swap1;
[Code] ....
View 6 Replies
View Related
Sep 26, 2013
I am writing a code that requires the user to input either B or b for bright or D or d for dim. Basically, B is bright and D is dim but I have to code the program such that it allows for both he capital letter and the lowercase letter to be recognized.
View 1 Replies
View Related
Aug 13, 2014
i'm trying to replace letters in a word...here's the code so far
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main (){
string s;
[Code] ...
The problem is if i type "nm" i'm not getting "mn" as the output, it's "mm"
I'm not trying to swap letters between them
View 1 Replies
View Related
Mar 20, 2014
Just wrote this extremely simple program but it seems to be malfunctioning. It counts correctly the number of uppercase letters in a string so long as i don't use the space-bar. once I add a space it only counts the number of uppercase letters of the first word..
printf("I ..........ing love programming");
Code:
#include <stdio.h>
main()
{
char text[200];
int i = 0;
int uppercase = 0;
printf("Enter text:");
scanf("%s", text);
[code]....
View 6 Replies
View Related
Feb 11, 2014
I have to develop script in C to print the alphabets in given notation.
Please check the attachment.
View 4 Replies
View Related
Oct 15, 2013
Im still new to this but i dont quite understand whats wrong with this code
Code:
#include <stdio.h>
int num1, num2, num3;
char resp;
int main()
{
printf("Quer os seus numeros em ordem crescente ou decrescente?
[Code] ....
It is in portuguese but the thing is, when i type the C when it asks for the response it still reads as if it was D the response
View 5 Replies
View Related
Mar 6, 2015
I'm doing error checks in C and I'd like to know how to restrict the input of a string to 2 letters and if it is exceeded, i'd like to loop and ask for the code to be re-entered.
Code:
for (i = 0; i < code7; i++)
{
printf("Enter number of items: ");
scanf("%d", &item_qty[i]);
[Code].....
View 2 Replies
View Related
Dec 25, 2014
Okay, so I have a science fair project and I decided on doing a series of programs that show the simpleness behind hacking a password. Each program increases in complexity starting with a four digit password, and ending with a 10 digit letter and number combo that is case sensitive. Right now I need to figure out a way to have my program be able to convert chars into ints, so that I can do a counter and then I also need to be able to convert the ints, back into chars.
View 19 Replies
View Related
May 12, 2014
I am trying to write a program to get user's input but only accepts alphabetic characters, nothing else and I want it to ask the user to enter a valid word until they have finally entered a valid one. I have the following code for it but it does not work properly.
void CheckBound (char word1[], int SIZE1) {
int i;
int w1[SIZE4]= {0};
int found;
for (i=0;i<strlen(word1);i++) {
[Code] .....
View 2 Replies
View Related
Feb 27, 2014
I am trying to make a program into which you writre for example ten Names or words or etc. and it would find the longest name/word write it and the numbers of characters too but I have problem with displaying that name. Here is me source code, the problem is here "vitaz=szInput;" i don't know how to save that longest name/word.
#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
int main () {
char a;
char szInput[256],vitaz[256];
[Code] .....
View 5 Replies
View Related