VideoHelp Forum




+ Reply to Thread
Results 1 to 16 of 16
  1. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    #include<iostream.h>
    main()
    {
    char selection;
    cout<<"menu"<<endl<<"contacts"<<endl<<"messages"<< endl<<"ringer tones"<<endl<<"lastcalls"<<endl;
    cin>>selection;
    if(selection=='c')
    {cout<<"contacts"<<endl<<"call"<<endl<<"insert"<<e ndl<<"remove"<<endl<<"edit"<<endl;
    cin>>selection;
    if(selection=='c'){cout<<"contacts-call";} else
    if(selection=='i'){cout<<"contacts-insert";} else
    if(selection=='r'){cout<<"contacts-remove";} else
    if(selection=='e'){cout<<"contacts-edit";}} else
    if(selection== 'm')
    {cout<<"write"<<endl<<"open"<<endl<<"reply"<<endl< <"erase"<<endl;
    cin>>selection;
    if(selection=='w'){cout<<"messages-write";} else
    if(selection=='o'){cout<<"messages-open";} else
    if(selection=='r'){cout<<"messages-reply";} else
    if(selection=='e'){cout<<"messages-erase";}} else
    if(selection=='r')
    {cout<<"ringer tones"<<endl<<"melody"<<endl<<"volume"<<endl<<"dis creet"<<endl;
    cin>>selection;
    if(selection=='m'){cout<<"ringer tones-melody";} else
    if(selection=='v'){cout<<"ringertones-volume";} else
    if(selection=='d'){cout<<"ringertones-discreet";}} else
    if(selection=='l')
    {cout<<"last calls"<<endl<<"outgoing"<<endl<<"incoming"<<endl<< "missed"<<endl;
    cin>>selection;
    if(selection=='o'){cout<<"last calls-outgoing";} else
    if(selection=='i'){cout<<"last calls-incoming";} else
    if(selection=='m'){cout<<"last calls-missed";}
    } }
    Quote Quote  
  2. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    sorry about posting this program, but i could'nt save it to a floppy in linux so i pasted it here so i could save it with windows...... does anyone see any errors in this program? it's for a project!
    Quote Quote  
  3. Besides the fact that it is the worst organized source I've ever seen, it looks like you may have screwed up on your number of brackets, of course, it's really hard to read it the way it's set up.
    If you were a parsley farmer, could they garnish your wages?
    Quote Quote  
  4. Whoops, that was just the formatting messing with me, you need to make main() an int return type like:

    int main()
    If you were a parsley farmer, could they garnish your wages?
    Quote Quote  
  5. No Longer Mod tgpo's Avatar
    Join Date
    Feb 2002
    Location
    The South Side
    Search Comp PM
    Originally Posted by EaBa
    Whoops, that was just the formatting messing with me, you need to make main() an int return type like:

    int main()
    or you could do void main() then you don't have to return 0 at the end.
    Quote Quote  
  6. Member
    Join Date
    Apr 2002
    Location
    California
    Search Comp PM
    WHAT THE HELL IS THIS SHIT!!!
    There is always one who is always greater. Never give up.
    Quote Quote  
  7. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    i've got a new project:
    obile Phone Implementation � PART II
    Most mobile phones allow the user to maintain a list of important numbers or numbers dialled regularly or frequently. The list consists of a collection of entries having a name and an associated number. As the phone usually only has digit keys typing the names can be a little tricky. The problem is solved by assigning letters to each of the digit keys. For example, the Siemens C25 phone uses the following assignments
    Digit Key Associated Letters
    none
    1 none
    2 ABC
    3 DEF
    4 GHI
    5 JKL
    6 MNO
    7 PQRS
    8 TUV
    WXYZ
    For example, when a user is entering the name BERTIE they have to press the following keys
    2 2 for B
    3 3 for E
    7 7 7 for R
    8 for T
    4 4 4 for I
    3 3 for E
    What is not obvious in this example is the fact that each sequence of presses to determine a letter is separated by a short (usually one second) pause to enable the device identify the letter. The pause is necessary because the keys are overloaded (i.e. each key is associated with more than one letter). For example, without the pause it is impossible to correctly enter the names Simon or Monica as the following sequences show
    7777 S 6 M
    444 I 666 O
    6 M 66 N
    666 O 444 I
    66 N 222 C
    2 A
    In both cases the MON sequence requires the entry of 666666 which could be interpreted as OO or MMMMMM or NN or NMO. By introducing a pause at the appropriate point (i.e. 6-666-66 where � represents a one second pause) the user distinguishes the letters and provides the device with the cues necessary to interpret the input correctly.
    An alternative would be to have the user press a particular key (e.g. the 1 key which is not associated with any letters) to signal a break in the sequence. Thus, SIMON would be entered as 777714441616661661 and MONICA as 6166616614441222121. For the purposes of this assignment we will adopt the second approach and oblige the user to press the 1 key between each character entered as indicated in the SIMON and MONICA examples above..
    Write a program to allow users enter names using the regime described above. Your program should continue to display letters on the screen until the user presses the # key. Thus, the # key will act as a sentinel value for the digit stream.

    can anyone help me with this? should i use a "for" loop? i'm stuck!
    Quote Quote  
  8. No Longer Mod tgpo's Avatar
    Join Date
    Feb 2002
    Location
    The South Side
    Search Comp PM
    This project doesn't seem to make much since..but from what I understood....which it little. The program will mostlikely require a while statement.
    Quote Quote  
  9. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    while? i think i need to use arrays. oh, who is lionel cosgrove?
    Quote Quote  
  10. No Longer Mod tgpo's Avatar
    Join Date
    Feb 2002
    Location
    The South Side
    Search Comp PM
    He is the main character in Dead Alive. The quotes I use are from the movies shown in my Avatar.
    Quote Quote  
  11. You're going to want to create a while loop kind of like this:

    while(cin >> a)
    {
    .......
    }

    And in the while loop, you'll need some if then statements. One condition will be If a==1, then you'll need to go to a function that you will pass an array of length 3(This is the array you will fill with the numbers) to, and the function will determine what letter it is. Another condition will be if (a == #), then you will end the progrm. Then, the last condition you'll just need to do some ascii checking, and determine if they entered a number, then add then add that number to the appropriate part part of the array.

    Hope that helps, there are probably better ways, but that's the way I see it.
    If you were a parsley farmer, could they garnish your wages?
    Quote Quote  
  12. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    thanks for the help, but how do i get the program to move across the array?
    Quote Quote  
  13. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    here's what i've done so far:
    include<iostream.h>
    #include<string.h>
    #include<getch.h>
    main()
    char arr[20][20]={" ","ABC","DEF",
    "GHI","JKL"};
    int digit=0;
    cout<<"please enter a number";
    int number=0,lastdigit=0;
    getche>>number;
    while(number!='#'){if(number==lastdigit){lastdigit ++;}
    else

    cout<< arr[number][lastdigit];}
    cout<< arr[number][lastdigit];
    }
    Quote Quote  
  14. Some of you guys have entirely too much time on your hands...
    Quote Quote  
  15. Member
    Join Date
    Apr 2002
    Location
    Ireland
    Search PM
    very funny. this project was for university!!
    Quote Quote  
  16. No Longer Mod tgpo's Avatar
    Join Date
    Feb 2002
    Location
    The South Side
    Search Comp PM
    Originally Posted by fmctm1sw
    Some of you guys have entirely too much time on your hands...
    And some people have so much time on their hands that they tell others that they have too much time on their hands.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!