From: <mi...@na...> - 2010-09-03 18:17:16
|
No one is going to do a homework question for you. You joined the class to learn something, not have someone else write your code for you. Either write it yourself, or drop out of the class. Sometimes you just have to man up and do some work in your life. Especially if you plan to do this professionally some day. As for your homework, all of those are extremely easy, trivial coding problems that can be solved in any language in a matter of minutes. Open your text book and look into allocations, I/O and parsing. All you need to know will be there. ----- Original Message ----- From: Ronnill Delos Reyes To: dev...@li... Sent: Friday, September 03, 2010 11:53 AM Subject: [Dev-C++] need help can you make me a program.. just a easy one not that complicated one.... PROBLEM 1 Write a program that displays the menu such as the following: [A] Input integers [B] Input strings [C] Exit program Enter your choice: If choice A or B is selected, the program prompts the user to input a positive integer value, say n, which determines the number of elements (either integers or string) to input. It then prompts the user to input n elements and stores them in an array with a maximum size of 100. After the input, the program displays a menu that looks like the one below (choices A and B should have the same menu): [1] Search an element [2] Display elements [3] Insert an element [4] Delete an element [5] Edit an element [6] Sort elements [7] Back to main menu What do you want to do? If option 1 is selected, the user is prompted with the element to be searched. If the element is found, its position number (index+1) is displayed (e.g. element is found at position 1). Otherwise, an error message is displayed. If there are elements that are the same, all the position numbers are displayed. If option 2 is selected, it displays all the elements currently stored in the array. If option 6 is not yet selected, the elements are displayed in unsorted order. If option 6 has already been selected, the elements are displayed in sorted order. If option 3 is selected, the user is prompted with the element to be inserted and the position number to which the element is inserted. The element is then inserted at the specified position thereby increasing the number of elements currently stored in the array. If option 4 is selected, the user is prompted with the element to be deleted. It uses the search routine to search for the element to be deleted. If found, the element is then deleted which decreases the number of elements in the array. If not found, an error message is displayed. If option 5 is selected, the user is prompted with the position number. Using the search routine, the program displays the current element stored in the position number specified. It then prompts the user for the new element to replace thus replacing the original element stored in the position number specified. If option 6 is selected, it prompts whether the elements are to be sorted in ascending or descending order. Given the choice, the elements are then displayed in sorted order using the display routine. If option 7 is selected, the program goes back to the main menu. The program exits only when choice C is selected from the main menu. Every after routine execution, the program displays the MAIN MENU. PROBLEM 2 Write a program that inputs a string. It then counts and displays the number of characters (including white spaces), and words in a string. Sample run: Input string: My name is Maui! Characters: 16 Words: 4 PROBLEM 3 Write a program that inputs a string. It then displays the string first with the words reversed and the second with the characters reversed in each word. Sample run: Input string: My name is Maui! Maui! is name My !iuaM si eman yM PROBLEM 4 Write a program that inputs a string. It then deletes all the white spaces, punctuations and other special characters leaving and displaying only the letters and digits. Sample run: Input string: My name is Maui! The date today is 02/15/08. MynameisMauiThedatetodayis021508 plzz.... plz repz as much as possible.. i'm going to need this program this monday... ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ------------------------------------------------------------------------------ _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |