473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Prog help

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
1 1297
Banfa
9,065 Expert Mod 8TB
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

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

Similar topics

9
by: Bastian.Zacher | last post by:
Hello NG, I want to write a c-prg. which examines the current memory-usage and cpu-usage of the system (win32), and writes the values to a logfile. Does anybody know which librarys or...
2
by: facicad | last post by:
I would like to set topmost another prog. from my program. Ex: I use AutoCAD, run my prog. from autocad. My prog. is topmost but went I would like to pick some object in autocad, I set TopMost to...
4
by: Signeg | last post by:
Hey guys, I have some work for university and i never used C++ in my life so i'm kinda lost.. But i've still managed to write something woth it. But too bad for me the prog does compile and lunch...
0
by: erekose666 | last post by:
I need to make a prog that will 1) Allow the user to select a make of car from a list of say 6 cars in an array I am assuming using get (I think) 2) Allow the user to select a predetermined trip...
2
momotaro
by: momotaro | last post by:
This is what am i asked to do: Implement a priority queue to manage patients in an emergency room You MUST use the files “patient.h” and “ER.c” as given. You should write the files...
3
by: McCarthy | last post by:
Im writing a command-line program in unix. Whenever I run the prog in unix it gives me 49 output files instead of the user entered amount. Im not sure what the problem is with my main prog the loop...
1
by: laptop | last post by:
hello frnds im new to this forum, please help me . i have a question paper webpage from where i will be taking answers in form of prog in different languages(perl,php,java,c,c++,python).now since im...
1
by: true blue | last post by:
hi, can anyone plz help by giving a code snippet on how to implement two threads in a single prog. i was trying with difeerent classes and different run (start) calls but only the thread in init()...
10
by: ImortalSorrow | last post by:
Hey, I hope you can help me with a prog i'm making. Everything is working well except a part where i want to repeat the riddle if the answer isnt correct. here's the bit of the bode where i need help...
8
by: tvnaidu | last post by:
I am running prog with GDB - throws SIG32, why? @localhost config]# gdb prog GNU gdb Red Hat Linux (5.3.90-0.20030710.40rh) Copyright 2003 Free Software Foundation, Inc. GDB is free software,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.