Advertisement
akosiraff

PRJ2 LastNameFirstInitial

Jun 17th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/prj2-lastnamefirstinitial/
  3. 1. Create a Java Application Project named PRJ2[Last Name][First Initial]. As an example, if your name was Xavier Smith, then the project would be named PRJ2SmithX.
  4. 2. Review the requirements for the program (3 a. – 3 f.) then generate a test plan in a document named PRJ2SmithXTestPlan using the Test Plan Example document listed in Week 1 Activities as a guide.
  5. 3. Once you are in the IDE with the tabbed PRJ2SmithX.java in the Source window, begin developing the following program:
  6. a. Declare all necessary identifiers.
  7. b. Inside a while loop:
  8. 1. Accept decimal numbers using a Dialog Input Box (JOptionPane.showInputDialog()).
  9. 2. Verify that the correct number was entered. [It is assumed that the values will be greater than zero.]
  10. 3. Sum the decimal numbers as each is entered.
  11. 4. When the sum of the entered decimal numbers is above a total of 100 for the first time – and only the first time:
  12. • Display a message with a Message Dialog Box (JOptionPane.showMessageDialog()) informing the user that the total number is ***** 100.
  13. • In addition to the warning also display in the Message Dialog Box the actual total sum at that point.
  14. • Do not show this message again for any additional entries above 100.
  15. 5. Keep a counter for the number of times a new decimal number is *****
  16. 6. Have a prompt asking the user when to end entering decimal numbers.
  17. 7. Use a sentinel to end the loop in combination with a prompt. [Review the usage of “while true { }” with a break command.]
  18. c. After the loop, call a calculation method that will return the average from the sum and counter. [An example of the construction of a method/function with its “calling code” is listed at the end of the assignment.]
  19. d. Call another method that will display the results of the processing in the program. This display has three lines in a single Message Dialog Box containing
  20. • The total number of entries
  21. • The sum of all the entries
  22. • The average of the number of entries
  23. Hint: A new line is displayed after each \n in the println in the Message Dialog Box.
  24. e. When the user ends the program include a final line of text after a blank line, adding an appropriate ending message.
  25. f. Add the appropriate documentation to the program as suggested in the Documentation for Programs document listed in Week 1 Activities as a guide.
  26.  
  27. Download: http://solutionzip.com/downloads/prj2-lastnamefirstinitial/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement