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.
// 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.
Comment