customer id program

I need help inputing code and checking to see if it is put in correct format and adding letters and numbers if in correct format, and printing out the input.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <iomanip>
#include <iostream>
using namespace std;
char ch, array1, array2, array3, array4, array5, array6, array7;
int alphacount = 0, numcount = 0, tmpnum = 0, tmpLet = 0, tstA, tstB, tstC, tstD, tstE, tstF, tstG, input = 7, totalnum = 0, totallet = 0;
int isDigit(char);
int isUpper(char);
char convToUpper(char);
int main()
{char ui[7];
cout << "Enter user id in format ABC1234: " << endl ;
for (int i = 0; i <= input; i++)
	{ui[7] = cin.get();
	
	
	while (ui[0] != '!')
	{
		while (ui[0] != 10)
		{
			tstA = isDigit(ui[i]);
			tstB = isUpper(ui[i]);
			if (tstA == 1 )
			{
				tmpnum++;
			}
			else if (tstB == 1 )
			{
			tmpLet++;
			}
			else
			{
				ui[i] == convToUpper(ui[i]);
				tmpLet++;
			}
			
			if (tmpLet == 4 && tmpnum == 3)
			{
				cout << ui << "Valid Id" << endl;
				totallet += 3;
				totalnum += 4;
				
				
			}
			else if (tmpLet !=4 && tmpnum != 3)
			{
				cout << ui << " Invalid id" << endl;
			}
			cout << "Enter another customer id in the format AAA1234 " << endl;
			for(int i = 0; i <= input; i++)
		{
			ui[i] = cin.get();
			tmpLet == 0;
			tmpnum == 0;
		}
		}
		
}
cout << "Total number of characters: "  <<setw(8) << totallet + totalnum;
cout << endl << endl << "Alphabetic: " << setw(24) << totallet << endl;
cout << "Numerical: " << setw(25) << totalnum;
	return 0;
}
}
char convToUpper(char d)
{
	if(d >= 97 && d <= 122)
	{return ( d - 32);
	}
	else
	return d;

}
int isUpper(char x)
{
	
	if( x >= 65 && x <= 90)
	return 1;
	else
	return 0;
}
int isDigit(char x )
{
	
	if( x >= 48 && x <= 57)
	return 1;
	else
	return 0;
}
Oh I am kind of stuck in the middle trying to figure out the logic right now. it obviously doesn't work.
Nothing?
You never really asked us for anything. How would you like us to help?

-Albatross
It doesn't work I need help fixing it so it works properly lol.
Okay. Great. That's still not answering my question as to how you'd like us to help. You never tell us what's broken or what you'd like us to do.

Would you mind please reading this?
http://www.cplusplus.com/articles/jLzyhbRD/

-Albatross
But what does "it doesn't work" mean? That's like telling the doctor you are ill, and asking him to make you well again.

Before he can help, he needs to know what are the symptoms.
The first loop will check for the.! To break the loop but the second input prompt doesn't check for the explanation point. And when it prints out the input it's supposed to capitalize the letters but it makes them ascii symbols instead. And it also modifies the numbers in this way too. So a vast majority of it is broken..
Topic archived. No new replies allowed.