Simple C++ Question

pac1085

Diamond Member
Jun 27, 2000
3,456
0
76
Boy, do I feel stupid asking this question...lol...well this is only like the 2nd month in my highschool c++ class and I havent been to half of em so heres what it says i gotta do...:
---
Write a function SpanishNum() that displays the spanish equivalent of its int parameter that is in the rage 1 to 5:

1 uno
2 dos
3 tres
4 quattro
5 cinco

Write a program where main() uses a loop to display a table similar to the one above.
---

I have not a damn clue what to do...any help would be appreciated...

 
Jun 18, 2000
11,209
775
126
#include <iostream.h>

void SpanishNum(int inputValue)
{
switch(inputValue){
case 1: cout<< inputValue<< &quot; uno&quot;<< endl<< break;
case 2: cout<< inputValue<< &quot; dos&quot;<< endl<< break;
case 3: cout<< inputValue<< &quot; tres&quot;<< endl<< break;
case 4: cout<< inputValue<< &quot; quattro&quot;<< endl<< break;
case 5: cout<< inputValue<< &quot; cinco&quot;<< endl<< break;
default: cout<< &quot;Value out of range.&quot;<< break;
}
}

int main()
{
int value;
cout<< &quot;Enter an integer. &quot;;
cin>> value;

SpanishNum( value );

return 0;
}

Something like that perhaps?
 

CarpeDeo

Golden Member
Feb 10, 2000
1,778
0
0
Hehe- nice . . . he looks for help, and you give the answer.

I'll come to Anandtech when it's time for my project . . . we have to write the game checkers. With AI and remote computer access and stuff. Hopefully somebody will just give me the answer. (=
 

MC

Platinum Member
Feb 23, 2000
2,747
0
0
I think we should have another forum for Academic!
How about that? hehe
 

pac1085

Diamond Member
Jun 27, 2000
3,456
0
76


<< I'll come to Anandtech when it's time for my project . . . we have to write the game checkers. With AI and remote computer access and stuff. Hopefully somebody will just give me the answer. (= >>


lol...theyd probly only be able to help you out a little unless there 1) really bored or 2) you pay them :)
Yeah...we should have a forum for academic stuff...im sure lots of people here are in highschool and/or college.