+1(251)732-3555 Support@tutorsgallery.com
Select Page

module_seven_assignment_guidelines_and_rubric___it_145_paint.pdf

paint1.zip

Never use plagiarized sources. Get Your Original Essay on
complete the Paint program by adding code
Hire Professionals Just from \$11/Page

Unformatted Attachment Preview

4/21/2020
?
Module Seven Assignment Guidelines and Rubric – IT-145-T4543 Found in App Development 20EW4
? Listen
?
Overview
In this ac vity, you will revisit the Paint program from Module Six. Your original program calculated the amount of paint needed, but
depending on the width and height, that value could be a long decimal. Your program will be er suit the needs of the user if it can
calculate the number of cans needed as an integer value. For example, given that 1 gallon = 1 can of paint, we might expect the Paint
program from Module Six to output:
Paint needed: 2.142857142857143 gallons
Cans needed: 3.0 can(s)
You might at ?rst think that you could just cast the gallonsPaintNeeded variable from a double to an integer type. However, that would
merely cut o? the decimal por on of the value, resul ng in an underes mate of the number of cans needed. You might also consider
rounding the number, but that would not work for the sample output provided above since normal rounding rules would suggest 2.0
cans, an underes mate. So, the computa onal problem you are faced with is to calculate the number of cans and round up to the
nearest whole number. In order to determine if that method for rounding up exists as part of one of Javas core classes, we need to
consult the documenta on. There might be a single method that we can use or we might have to use more than one method.
Prompt
For this assignment, you will complete the Paint program by adding code that calculates the number of cans of paint needed. Use the
1. Consult the o?cial Java documenta on for the Math class.
a. Scroll to the Method Summary sec on of the Math class and review the methods and their descrip ons. Look for a method
b. If a method looks promising, click on its name to see a more detailed descrip on. Pay special a en on to the argument(s) and
the data type of the return value.
c. Based on your review, select one or more methods from the Math class to use in your solu on.
https://learn.snhu.edu/d2l/le/content/375590/viewContent/7898843/View
1/3
4/21/2020
Module Seven Assignment Guidelines and Rubric – IT-145-T4543 Found in App Development 20EW4
d. When using a method from the Math class, use the syntax Math.methodname() when you implement the method. For
example, if you decided to use the absolute value method, you would write something like: Math.abs().
2. Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your IDE and upload the Paint2.zip folder.
Review the code for the Paint2.java class. Look for where it says //Complete this code block. Make sure the code you write does
the following:
a. Calculates the number of paint cans needed to paint the wall
b. Rounds up to the nearest integer (use the test cases below to check your work)
c. Outputs the number of cans needed for the user
Input:
30
25
Input:
7.5
22.8
Output:
Paint needed:
2.142857142857143
gallons
Cans needed: 3.0 can(s)
Input:
20
35
Output:
Paint needed:
0.48857142857142855 gallons
Cans needed: 1.0 can(s)
Input:
25.4
21.6
Output:
Paint needed: 2.0 gallons
Cans needed: 2.0 can(s)
Output:
Paint needed:
1.5675428571428571 gallons
Cans needed: 2.0 can(s)
Guidelines for Submission
A ach your completed Paint2.java ?le to the assignment submission page.
Module Seven Assignment Rubric
https://learn.snhu.edu/d2l/le/content/375590/viewContent/7898843/View
2/3
4/21/2020
Module Seven Assignment Guidelines and Rubric – IT-145-T4543 Found in App Development 20EW4
Criteria
Pro?cient (100%)
Selects a method that
Method Selec on
appropriately handles all
test cases
Needs Improvement
(75%)
Not Evident (0%)
Value
Meets some Pro?cient
criteria but with errors,
Does not a empt
such as not handling all
test cases
criterion
65
Uses the selected
Method
Implementa on
method such that the
Meets some Pro?cient
accurate value is
calculated and output to
criteria, but with errors
or exclusions
Does not a empt
criterion
35
the user is correct
Total:
https://learn.snhu.edu/d2l/le/content/375590/viewContent/7898843/View
100%
3/3