By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

Prog help

P: 2
Hi I need help with h.w asignment. The result E836 NOT SHOWING.

// week3home.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iomanip>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
//convert licence plate into code
char a,b,c;
int num;
int sum;
char p;
cout << "Enter licence plate: ";
cin >> a >> b >> c >> num;
sum = a+b+c+num;
//cout << "\n" << sum << endl;
p = sum % 26; //f. Determine the 4th letter in the alphabet after the letter 'A': 4th letter after 'A' is E.
cout << "\nCar Rental code: " << p << " " << sum;
return 0;
}

Enter licence plate: CPR 607
Car Rental code: ♦ 836Press any key to continue

Thanks alot.
Nov 1 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
It isn't clear what the logic behind

p = sum % 26; //f. Determine the 4th letter in the alphabet after the letter 'A': 4th letter after 'A' is E.

is

Actually it is terribly clear what the logic behind

sum = a + b + c + num;

is
Nov 2 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.