+ Reply to Thread
Results 1 to 9 of 9

Thread: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

  1. #1
    Newbie Kyram143 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    4

    Unhappy [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    Problem:

    Write a C++ program that will ask the user to enter not greater than to 15 numbers (decimal numbers are accepted). Please observe the output format below. Trace the program from logic to syntax especially for no inputs and inputs that have zeros (0s). Take note as well that if the data to be searched in element, index, or value is not found, the program will display “No such data located!”. Hint: for menu I, you can use any of the sorting algorithms such as insertion sort, selection sort, bubble sort, and the rest.


    Output:

    -------------------------------------------------------------------------------------------------------------------------------------------

    MAIN MENU:

    [C]Input Values
    [P]Display Elements, Index, and Values
    [R]Search by Element
    [O]Search by Index
    [G]Search by Value
    [I]Sort the Values
    [T]Display the Member’s Complete Names with Course, Year, & Section
    [E]Exit

    Your choice is:
    --------------------------------------------------------------------------------------------------------------------




    SAMPLE MENU ACTIONS:

    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose C:

    Enter 15 numbers: 1 2 3 4 5 6 7 8 9 10 11 12.1 13 14 1

    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose P:

    Element Index Value
    1 0 1
    2 1 2
    3 2 3
    4 3 4
    5 4 5
    6 5 6
    7 6 7
    8 7 8
    9 8 9
    10 9 10
    11 10 11
    12 11 12.1
    13 12 13
    14 13 14
    15 14 1

    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose R:

    Search by element: 2
    2 is located at index 0 with the value 1

    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose O:

    Search by index: 10
    10 is located at element 11 with the value 11

    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose G:

    Search by value: 1
    1 is located at element 1 and 15 and at index 0 and 14

    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------
    If user opts to choose I:

    Sorted values are: 1 1 2 3 4 5 6 7 8 9 10 11 12.1 13 14
    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose T:

    The members are Henry William Gates and Grace Murray Hopper, BSIT 2D

    Return to Main Menu? Y or n for yes to exit the program, N or n for no and exit the program.
    --------------------------------------------------------------------------------------------------------------------------------------------

    If user opts to choose G:

    Do you want to close the program? Y or n for yes to exit the program, N or n for no, and return again to the main menu.
    --------------------------------------------------------------------------------------------------------------------------------------------


  2. #2
    Newbie Kyram143 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    4

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    HELP me please

  3. #3
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,640
    Blog Entries
    57

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    We can't help you until you ask us a question. For example: do you know how to do input/output? Do you know how to process input? Something else? What have you written so far?
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #4
    Newbie Kyram143 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    4

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    im newbie to C++ sir i dont know how to program i need a code for that problem can you help me please? but im starting to learn on how to program C++. I really appreciate your help sir

  5. #5
    Newbie Kyram143 is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    4

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    HELP me please

  6. #6
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,640
    Blog Entries
    57

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    Returning to basics: Are you familiar with how to get input, display out, use an if statement, and use a while loop?
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #7
    Newbie wenkang is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    4

    Unhappy Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    Sorry.I can't help you.

  8. #8
    MeTh0Dz is a name known to all MeTh0Dz is a name known to all MeTh0Dz is a name known to all MeTh0Dz is a name known to all MeTh0Dz is a name known to all MeTh0Dz is a name known to all
    Join Date
    May 2008
    Posts
    473

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    Entering a topic just to tell someone you can't help them...

  9. #9
    Programming God thegamemaker has a spectacular aura about thegamemaker has a spectacular aura about thegamemaker's Avatar
    Join Date
    Nov 2009
    Location
    At the end of the rainbow.
    Age
    14
    Posts
    618
    Blog Entries
    1

    Re: [HELP] C++ program that will ask the user to enter not greater than to 15 numbers

    Dude nobody has any Idea what your wanting here.
    I just wrote up a thing that only let you enter a number under 15.
    Code:
    #include<iostream>
    
    using namespace std;
    
    int main()
    {
    double number = 0;
    char again = 'y';
    
    while(again == 'y')
    {
    cout << "Enter a number below 15.";
    cin >> number;
    
    if (number <= 15)
    {
    cout << number << endl;
    }
    else
    {
    cout << "Sorry invalid number." << endl;
    }
    
    cout << "Do you want to enter another number? (y/n) ";
    cin >> again;
    }
    cin.get();
    return 0;
    }
    You need to tell some one your question.
    My Web Site

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Tutorial: Starting C# with C# 2008 Express Edition
    By Jordan in forum CSharp Tutorials
    Replies: 20
    Last Post: 07-27-2009, 04:45 AM
  2. Windows XP Tricks & Tips!!!!..new ones.
    By pranky in forum Tutorials
    Replies: 9
    Last Post: 08-23-2008, 03:22 PM
  3. Replies: 5
    Last Post: 07-07-2008, 09:54 PM
  4. Help with Square root and calculator program!!!
    By 123456789asdf in forum C and C++
    Replies: 10
    Last Post: 12-02-2007, 04:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts