Translation
-
At the end of what? I've yet to determine what you are considering input and what you are considering output. Do something simple like:
When my program sees input like "input data goes here", I want the output to be "output data goes here"
-
"input data goes here" : "output data goes here" A : 010 B : 020 C : 030 D : 040 ............... Z : 026 Y : 025
This won't work. See the problem?
A 010 N 014
B 020 O 015
C 030 P 016
D 040 Q 017
E 050 R 018
F 060 S 019
G 070 T 020
H 080 U 021
I 090 V 022
J 010 W 023
K 011 X 024
L 012 Y 025
M 013 Z 026 -
This won't work. See the problem?
A 010 N 014
B 020 O 015
C 030 P 016
D 040 Q 017
E 050 R 018
F 060 S 019
G 070 T 020
H 080 U 021
I 090 V 022
J 010 W 023
K 011 X 024
L 012 Y 025
M 013 Z 026I am so sorry. I mistype::(( it should look like this: A 010 N 140 B 020 O 150 C 030 P 160 D 040 Q 170 E 050 R 180 F 060 S 190 G 070 T 200 H 080 U 210 I 090 V 220 J 100 W 230 K110 X 240 L 120 Y 250 M130 Z 260 My output should be: A 10 N 14 B 20 O 15 C 30 P 16 D 40 Q 17 E 50 R 18 F 60 S 19 G70 T 20 H80 U 21 I 90 V 22 J10 W 23 K11 X 24 L 12 Y 25 M13 Z 26
-
I am so sorry. I mistype::(( it should look like this: A 010 N 140 B 020 O 150 C 030 P 160 D 040 Q 170 E 050 R 180 F 060 S 190 G 070 T 200 H 080 U 210 I 090 V 220 J 100 W 230 K110 X 240 L 120 Y 250 M130 Z 260 My output should be: A 10 N 14 B 20 O 15 C 30 P 16 D 40 Q 17 E 50 R 18 F 60 S 19 G70 T 20 H80 U 21 I 90 V 22 J10 W 23 K11 X 24 L 12 Y 25 M13 Z 26
You just can't make up your mind, can you? First you state that "it should look like this" and show one table, and then you follow that with "my output should be" and show a completely different table. In the bottom table, do you not see the obvious error? A and J cannot both be 10.
-
You just can't make up your mind, can you? First you state that "it should look like this" and show one table, and then you follow that with "my output should be" and show a completely different table. In the bottom table, do you not see the obvious error? A and J cannot both be 10.
Now I understand what you are saying. I am appreciated for your patient. I am just learning C++, so I am not seeing full picture at first. My project is to translate from alpha to numeric starting with the A=10 increase the next letter by 10 and then delete zero before numbers. I got it to work but I am missing zero after the number if number=10…90. What would you recommended to do with the J? :confused:
-
Now I understand what you are saying. I am appreciated for your patient. I am just learning C++, so I am not seeing full picture at first. My project is to translate from alpha to numeric starting with the A=10 increase the next letter by 10 and then delete zero before numbers. I got it to work but I am missing zero after the number if number=10…90. What would you recommended to do with the J? :confused:
sardinka wrote: My project is to translate from alpha to numeric starting with the A=10 increase the next letter by 10 and then delete zero before numbers. This will do exactly that: sprintf(Tempcrap1, "%d", (Modi[i] - 64) * 10);
-
sardinka wrote: My project is to translate from alpha to numeric starting with the A=10 increase the next letter by 10 and then delete zero before numbers. This will do exactly that: sprintf(Tempcrap1, "%d", (Modi[i] - 64) * 10);
-
I copyed your line of code into my program. here my output(what I am getting). Examples: Entered Value:Should be : :((I am getting 9AB : 90102 : 91020 Z73 : 26073 : 26073 9ZY : 92625 : 9260250
There are still discrepancies. For example, when Z73 is input, you want (and are getting) 26073 as output. Assuming the 26 is for the Z, why does the 7 get a leading 0 but the 3 does not? Use:
sprintf(Tempcrap1, "%02d", Modi[i] - 64);
when converting letters to numbers, and:sprintf(Tempcrap1, "%d", Modi[i] - 48);
otherwise. This will produce:Input : Output
9AB : 90102
Z73 : 260703
9ZY : 92625 -
There are still discrepancies. For example, when Z73 is input, you want (and are getting) 26073 as output. Assuming the 26 is for the Z, why does the 7 get a leading 0 but the 3 does not? Use:
sprintf(Tempcrap1, "%02d", Modi[i] - 64);
when converting letters to numbers, and:sprintf(Tempcrap1, "%d", Modi[i] - 48);
otherwise. This will produce:Input : Output
9AB : 90102
Z73 : 260703
9ZY : 92625 -
I do not need to produce for 7 a leading 0. In this case should be Z-260 and rest of the string.
Do you not find it odd that each time you state what you want, it's different from the time before? Has anyone ever told you it's very difficult to hit a moving target? In this latest post, you want "260" to be the output for "Z", yet in the previous post (i.e., "9ZY : 92625 : 9260250"), you want "26" to be the output for "Z". I think it's time you step back and better define your requirements.