Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
Reply
Posted 2003-11-20, 06:41 PM in reply to Hades-Knight's post "Need help"
Ugh comments suck. Can I do it tomorrow?
D3V said:
This message is hidden because D3V is on your ignore list.
What is it they say about silence being golden?
Old
Profile PM WWW Search
Medieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzMedieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
Medieval Bob
 



 
Reply
Posted 2003-11-21, 04:15 PM in reply to Hades-Knight's post "Need help"
Ok its already 1 day, times up
Old
Profile PM WWW Search
Hades-Knight is neither ape nor machine; has so far settled for the in-between
 
 
Hades-Knight
 



 
Reply
Posted 2003-11-21, 06:07 PM in reply to Hades-Knight's post "Need help"
Well, I don't feel like doin it now. Also, I'm not your bitch, so... if I decide to do it later, I might.
D3V said:
This message is hidden because D3V is on your ignore list.
What is it they say about silence being golden?
Old
Profile PM WWW Search
Medieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzMedieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
Medieval Bob
 



 
Reply
Posted 2003-11-23, 04:38 PM in reply to Hades-Knight's post "Need help"
puh-lease can you do it now?
Old
Profile PM WWW Search
Hades-Knight is neither ape nor machine; has so far settled for the in-between
 
 
Hades-Knight
 



 
Reply
Posted 2003-11-24, 06:32 PM in reply to Hades-Knight's post "Need help"
due tomorrow help with comments!!!
Old
Profile PM WWW Search
Hades-Knight is neither ape nor machine; has so far settled for the in-between
 
 
Hades-Knight
 



 
Reply
Posted 2003-11-24, 09:05 PM in reply to Hades-Knight's post "Need help"
Can you add some comments and edit these to fit the criteria? kthx




#include<stdio.h>
#include <iostream.h>
int main() //Main function
{
int i; //Define variables
int previous = 0;
int num;
int total = 0;
int flag = 0;
int key = 0;
int repeat = 1;
char roman[50]; //defines roman char for input
char roman2[50]; //defines roman char for output
char pchar = 'z';

cout << "Enter the Roman numeral(in caps!!): "; //prompt for user input
cin >>roman;

for (i = 0; i < 50; i++) //count what the input value range is
{

if (roman[i] == 'M') //assigns 1000 to input M
num = 1000;
else if (roman[i] == 'D') //assigns 500 to input D
num = 500;
else if (roman[i] == 'C') //assigns 100 to input C
num = 100;
else if (roman[i] == 'L') //assigns 50 to input L
num = 50;
else if (roman[i] == 'X') //assigns 10 to input X
num = 10;
else if (roman[i] == 'V') //assigns 5 to input V
num = 5;
else if (roman[i] == 'I') //assigns 1 to input I
num = 1;
else if (roman[i] == '\0') //if input is 0 flag=1 for error
flag = 1;


/****************************Start Calculation for order of input******************/
/* If input has a value next to it, it checks to see if its more or less than first */
/* If it has less value than the one to the right, substract, if it has higher value add */
if (num == previous)
repeat = repeat + 1;
else
repeat = 1;

if (repeat == 4 && num == 1)
{

flag = 1;
}
if (repeat == 2 && num == 5)
{

flag = 1;
}
if (repeat == 4 && num == 10)
{

flag = 1;
}
if (repeat == 2 && num == 50)
{

flag = 1;
}
if (repeat == 4 && num == 100)
{

flag = 1;
}
if (repeat == 2 && num == 500)
{

flag = 1;
}

if (flag == 0)
{


if (num > previous)
{
if (key == 1)
{

i = 50;
}
total = (total - (2 * previous)) + num;
key = 1;
}
else
total += num;

previous = num;
num = 0;
}
else
{

i = 50;
}

}


cout<<total << endl; //Output the calculated number given that roman characters are calculated right
/*******************************START DOUBLING****************************************/
total = total * 2; //doubles the number you got from convertion
repeat = 1;

for (i = 0; i < 50; i++)
{ //Given then total in int , assign character to each int value

if (total >= 1)
roman2[i] = 'I';
if (total >= 5)
roman2[i] = 'V';
if (total >= 10)
roman2[i] = 'X';
if (total >= 50)
roman2[i] = 'L';
if (total >= 100)
roman2[i] = 'C';
if (total >= 500)
roman2[i] = 'D';
if (total >= 1000)
roman2[i] = 'M';
if (total == 0)
roman2[i] = '\0';

if (roman2[i] == pchar)
repeat = repeat + 1;
else
repeat = 1;

if (repeat == 4 && roman2[i] == 'I')
{
roman2[i - 2] = 'V';
roman2[i - 1] = '\0';
}

if (roman2[i] == 'M') // After getting the range value calculate exact value by substracting the value character to the left
total -= 1000; //and assign character to integer value , convertion.
else if (roman2[i] == 'D')
total -= 500;
else if (roman2[i] == 'C')
total -= 100;
else if (roman2[i] == 'L')
total -= 50;
else if (roman2[i] == 'X')
total -= 10;
else if (roman2[i] == 'V')
total -= 5;
else if (roman2[i] == 'I')
total -= 1;
else if (roman2[i] == '\0')
i = 50;

pchar = roman2[i];
}

cout<<roman2; //outputs the double value in roman characters

return(0);
}
Old
Profile PM WWW Search
Hades-Knight is neither ape nor machine; has so far settled for the in-between
 
 
Hades-Knight
 



 
Reply
Posted 2003-11-24, 09:26 PM in reply to Hades-Knight's post "Need help"
You could just do it yourself, you know. Ask someone from your class. And if you can't find anyone in your class who can do it, you can hope to be graded on a curve.
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2003-11-24, 09:32 PM in reply to Hades-Knight's post "Need help"
Don't know what all you want done... How's this?


#include<stdio.h>
#include <iostream.h>
int main() //Main function
{
int i; //Define variables
int previous = 0;
int num;
int total = 0;
int flag = 0;
int key = 0;
int repeat = 1;
char roman[50]; //defines roman char for input
char roman2[50]; //defines roman char for output
char pchar = 'z';

cout << "Enter the Roman numeral(in caps!!): "; //prompt for user input
cin >>roman;

for (i = 0; i < 50; i++) //count what the input value range is
{

if (roman[i] == 'M') //assigns 1000 to input M
num = 1000;
else if (roman[i] == 'D') //assigns 500 to input D
num = 500;
else if (roman[i] == 'C') //assigns 100 to input C
num = 100;
else if (roman[i] == 'L') //assigns 50 to input L
num = 50;
else if (roman[i] == 'X') //assigns 10 to input X
num = 10;
else if (roman[i] == 'V') //assigns 5 to input V
num = 5;
else if (roman[i] == 'I') //assigns 1 to input I
num = 1;
else if (roman[i] == '\0') //this is the end of input

/****************************Start Calculation for order of input******************/
/* If input has a value next to it, it checks to see if its more or less than first */
/* If it has less value than the one to the right, substract, if it has higher value add */
if (num == previous)
repeat = repeat + 1;
else
repeat = 1;

if (repeat == 4 && num == 1)
{

flag = 1;
}
if (repeat == 2 && num == 5)
{

flag = 1;
}
if (repeat == 4 && num == 10)
{

flag = 1;
}
if (repeat == 2 && num == 50)
{

flag = 1;
}
if (repeat == 4 && num == 100)
{

flag = 1;
}
if (repeat == 2 && num == 500)
{

flag = 1;
}

if (flag == 0)
{


if (num > previous)
{
if (key == 1)
{

i = 50;
}
total = (total - (2 * previous)) + num;
key = 1;
}
else
total += num;

previous = num;
num = 0;
}
else
{

i = 50;
}

}


cout<<total << endl; //Output the calculated number given that roman characters are calculated right
/*******************************START DOUBLING****************************************/
total = total * 2; //doubles the number you got from convertion
repeat = 1;

for (i = 0; i < 50; i++)
{ //Given then total in int , assign character to each int value

if (total >= 1)
roman2[i] = 'I';
if (total >= 5)
roman2[i] = 'V';
if (total >= 10)
roman2[i] = 'X';
if (total >= 50)
roman2[i] = 'L';
if (total >= 100)
roman2[i] = 'C';
if (total >= 500)
roman2[i] = 'D';
if (total >= 1000)
roman2[i] = 'M';
if (total == 0)
roman2[i] = '\0';

if (roman2[i] == pchar)
repeat = repeat + 1;
else
repeat = 1;

if (repeat == 4 && roman2[i] == 'I') //I has been repeated too many times
{
roman2[i - 2] = 'V';
roman2[i - 1] = '\0';
}

if (roman2[i] == 'M') // After getting the range value calculate exact value by substracting the value character to the left
total -= 1000; //and assign character to integer value , convertion.
else if (roman2[i] == 'D')
total -= 500;
else if (roman2[i] == 'C')
total -= 100;
else if (roman2[i] == 'L')
total -= 50;
else if (roman2[i] == 'X')
total -= 10;
else if (roman2[i] == 'V')
total -= 5;
else if (roman2[i] == 'I')
total -= 1;
else if (roman2[i] == '\0')
i = 50;

pchar = roman2[i];
}

cout<<roman2; //outputs the double value in roman characters

return(0);
}
D3V said:
This message is hidden because D3V is on your ignore list.
What is it they say about silence being golden?
Old
Profile PM WWW Search
Medieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzMedieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
Medieval Bob
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 06:19 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.