Unit 5 Assignment | Complete Solution
- AceTutor
- Rating : 33
- Grade : A+
- Questions : 0
- Solutions : 823
- Blog : 1
- Earned : $26606.70
Unit 5 Assignment
Grading Information: This Program is due on Date Specified.
Comments are REQUIRED;; flow charts and pseudocode are NOT REQUIRED.
Directions Points
The file must be called <LastInitialFirstInitialUnit5.java>
Proper coding conventions required the first letter of the class start with a capital
letter and the first letter of each additional word start with a capital letter.
Only submit the .java file needed to make the program run. Do not submit the .class
file or any other file.
5%
Style Components
Include properly formatted prologue, comments, indenting, and other style elements
as shown in Chapter 2 starting page 64 and Appendix 5 page 881-892.
5%
Topics covered in chapter
Topics with * are covered in this assignment. Ensure you use every item listed below with
an * in your completed assignment.
*The API Library
*Match Class
*Wrapper Classes for Primitive Types
Character Class
*String Methods
*Formatted Output with the printf Method
*Problem Solving with Random Numbers
LiFiUnit5.java - Main Method
• Get input for maximum random number into a String variable. Allow a
maximum of 8 (see example).
• Use the Integer wrapper class to parse the integer out of the string and store
in an integer variable.
• Get input for number of rounds into an integer. Allow a maximum of 8 (see
example).
• Create a Header and Data format string to output results as shown in the
sample at the bottom.
• Utilizing a for loop, output results meeting following criteria:
o One line should be output for each round.
90%
o Each line should contain:
§ Round Number.
§ Random number chosen.
§ The random number raised to the round number.
• Utilize Math class to calculate using exponents.
• Example: Round 2 random number 6 = 62 = 36
§ The modulus of the random number % round.
• Modulus returns the remainder, see page 81 in Chapter 3.
• Example: 8%3 = 2 (2 is the remainder or modulus)
§ The random number divided by the round number.
• Ensure you output the result as a float with 2 decimal
places.
• Output “End Run…” after all lines have been output.
Mimic the output in the sample below exactly. Numbers will change due to random
and selection but format will be the same.
Sample output is provided below. Be sure to mimic the layout exactly. Output will
vary based on input. 10%
NOTE: Complete your activity and submit it by clicking “Submit Assignment”
Total Percentage 100%
Sample
Max Random Number and Number of Rounds will vary based on
input:
Below are 3 different random examples based on the input
given. Your output will vary but the format will be the same.
Sample when 8 and 8 are entered.
Max random and number of rounds both entered with values above
[Solved] Unit 5 Assignment | Complete Solution
- This solution is not purchased yet.
- Submitted On 10 Jul, 2016 05:02:46
- AceTutor
- Rating : 33
- Grade : A+
- Questions : 0
- Solutions : 823
- Blog : 1
- Earned : $26606.70