Cis 355 i lab 6 of 6

267 views

Published on

Write a Java GUI application called Index.java that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text. This program is not case sensitive and both upper and lower case must be counted for.

Sample Program output: View Output Description

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
267
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cis 355 i lab 6 of 6

  1. 1. SOLUTIONJUG.COMCLICK HERE TO GET THE SOLUTION !!!!!!!!!!CIS/355 iLab 6 of 6Write a Java GUI application called Index.java that inputs several lines of text and a searchcharacter and uses String method indexOf to determine the number of occurrences of the characterin the text. This program is not case sensitive and both upper and lower case must be counted for.Sample Program output: View Output DescriptionGrading RubricIndex Points DescriptionStandard headerincluded1Must contain programs name, student name, and description ofthe programProgram compiles 1 Program does not have any errorProgram executes 1 Program runs without any errorCorrect GUI interfaceis created3Program contains a text area for text input, text box forcharacter input, and the appropriate labelsCorrect output isdisplayed4Program displays the correct count for both upper and lowercase of the input letterSubtotal 10OUTPUT DESCRIPTION ABOVE:Step 1 Sample Program OutputThe output of Index.java application contains the following user controls and alignment of thecontrols:1. Main form has a title of “Character Finder”2. Upper left corner, a label with the text “Enter Text to be searched”3. At the top of the form, and just to the right of the “Enter Text” label is a multiline text field.
  2. 2. 4. Immediately below the text field, and on the left side of the form, is a label with the text “Enter aCharacter”.5. Immediately to the right of the “Enter a Character” label is a small, textbox that will hold a singlecharacter.The sample output of the application has the following text in the input boxes:1. In the large text field, the sentence “I learned Java strings in Week 6!”2. The “enter the character” textbox, contains the character aA standard dialog, or message box, shows the result the search and contains the results of thesearch and contains the following:1. Dialog label is “Results”2. On the left side is the information icon, which is a circle inset with the character i3. To the right of the information icon, is the output string “Number of a’s: 3A command button with the text “OK” is centered on the bottom of the diagram.STEP 2: Index2 (10 points)Write a Java GUI application Index2.java based on the program in Step 1 that inputs several linesof text and uses String method indexOf to determine the total number of occurrences of each letterof the alphabet in the text. Uppercase and lowercase letters should be counted together. Store thetotals for each letter in an array, and print the values in tabular format after the totals have beendetermined.Sample Program output: View Output DescriptionGrading RubricIndex2 Points DescriptionStandard headerincluded1Must contain programs name, student name, and description ofthe programProgram compiles 1 Program does not have any errorProgram executes 1 Program runs without any errorCorrect GUI interfaceis created3Program contains a text area for text input, text area for charactercount, a button, and the appropriate labels
  3. 3. Correct output isdisplayed4Program displays the correct count for both upper and lower caseof each letter of the alphabetSubtotal 10OUTPUT DESCRIPTION ABOVE:Step 2 Sample Program OutputThe Index2.java form design is a narrow, but long form and contains the following controls:1. Form title is blank2. Centered at the top is a label with text “Enter some text”3. Below the “Enter some text” label is a multiple line text field.4. Below the text field is a command button, with the text “Counter Occurrences of Each Letter”5. Below the command button and centered on the form, is long, multiple line text field.The following sample output of the application has the following text in the fields:1. Entered text is “Write a Java GUI application Index2.jva based on the program in project1 thatinputs several lines of text and uses the string method indexOf to determine2. The output of the application is listed in the long text field, with each letter and frequency of thelatter on the same line, separated by a tab space.STEP 3: ThreeArrayLists (20 points)Write a program in a GUI JFRAME called ThreeArrayLists.java that declares three ArrayListobjects referenced by the objects named priceList, quantityList, and amountList. Each ArrayListshould be declared in main() and should be capable of holding a minimum of 10 double-precisionnumbers.The numbers that should be stored in priceList are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47,6.58, 18.32, 12.15, 3.98.The numbers that should be stored in quantityList are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9 4.8.Your program should pass object references to these three ArrayList objects to a methodnamed extend(), which should calculate the elements in the amountList ArrayList as the product ofthe corresponding elements in the priceList and quantityList ArrayList, for example,amountList.add(priceList.get(i) * quantityList.get(i)).
  4. 4. After extend() has put values into the amountList ArrayList object, create a method that displays theresults of all three lists. Appropriate formatting techniques need to be used to produce a formattedoutput.Tip: It is a good idea to create two arrays of type double to store the values that correspond to theprice and the values that correspond to the quantity, for example:double[] PRICE_ARRAY = { 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, 3.98 };double[] QUANTITY_ARRAY = { 4.0, 8.5, 6.0, 7.35, 9.0, 15.3, 3.0, 5.4, 2.9, 4.8 };Sample program output:1) 10.62 * 4.0 = 42.482) 14.89 * 8.5 = 126.563) 13.21 * 6.0 = 79.264) 16.55 * 7.35 = 121.645) 18.62 * 9.0 = 167.586) 9.47 * 15.3 = 144.897) 6.58 * 3.0 = 19.748) 18.32 * 5.4 = 98.939) 12.15 * 2.9 = 35.2410) 3.98 * 4.8 = 19.1Grading RubricThreeArrayLists Points DescriptionStandard header included 1Must contain programs name, student name, anddescription of the programProgram compiles 1 Program does not have any errorProgram executes 1 Program runs without any errorCreated ThreeArrays class 2ThreeArrays.java is created and contains all requiredmethodspriceList ArrayList is created andcontains the correct values2ArrayList object is created and contains correctvaluesquantityList ArrayList is createdand contains the correct values2ArrayList object is created and contains correctvaluesamountList ArrayList is createdand contains the correct values2ArrayList object is created and contains correctvaluesextend method is created, whichreceives arrays as arguments2extend method exists and contains the requiredparametersextend method calculates theitems in the amount ArrayListobject2extend method calculates the values that go in theamount ArrayList and inserts those values in theamount object
  5. 5. method that displays the valuesof all three ArrayList objects iscreated2display method is created and produces the requiredoutput by formatting and printing the values in eachof the ArrayList objectsCorrect output is displayed 3Output looks like the required output shown in thelab descriptionSubtotal 20CLICK HERE TO GET THE SOLUTION !!!!!!!!!!

×