Write a program that adds a check letter to an eight-digit number. The check letter should be computed as follows: Break the number up into 4 two-digit numbers. Add the four numbers together. Find the remainder after division by 26. The check letter is the letter in the alphabet that corresponds to the number just computed. (A=0, B=1, C=2, etc.) Use at least one function that returns a value when you write this program. i need a step by step explanation please help have a test in a week
To split the 8 digit number into 2 digit integers is a matter of division by 10,000, 1,000,000, etc. and the last two digits are the modulus ( remainder ) of dividing by 100. Actually, the modulus of a division by 100 may be a good candidate for your function. You can index a character out of a string for the check letter. Another possible function.
i really did not understand what you were saying
please elaborate ur problem with an example
#include<iostream> using namespace std; int main() { int temp, original; int first, second, third, fourth; cout<<"enter an 6 digit number"<<endl; cin>>original; temp=original/10000; first=original%10000; second=original%100; third=temp%1000; cout<<"the first number is "<<temp<<endl; cout<<"the second number is "<<first<<endl; cout<<"the third number is "<<second<<endl; return 0; } this is the closest that is was able to get with the output of enter an 6 digit number 123456 the first number is 12 the second number is 3456 the third number is 56
i know that this is for 6, but i was just trying to work my way up to the 8 digit so i could understand what i was doing
@rsmith6559 im i going in the right direction
google it.
Yes you are. first = original / 10000 temp = original % 10000 second = temp / 100 third = temp % 100
Join our real-time social learning platform and learn together with your friends!