Question: Objectives This project will allow you to practice Java's expressions, input / output , and conditionals. In addition, you will learn how to use course
Objectives
This project will allow you to practice Java's expressions, inputoutput and conditionals. In addition,
you will learn how to use course tools.
Overview
You need to implement three programs: Area, Divisible, and ColorGenerator.
Specifications
For this project you are expected to use good variable names and good indentation.
Area Program Write a program that will compute the area of a rectangle. The program will
call a method to read the length and width values and return the area. You need to call
another method to validate the length and width and make sure they are positive. Continue
asking the user until both length and width are valid.The following is an example of running
the program. The example illustrates the messages used to read data and to display the
area.
Enter length:
Invalid length. Make sure to enter a positive number.
Enter length:
Enter width:
Area is:
ColorGenerator Program Write a program that computes a CSS color. We define a CSS
color as a string that starts with a # character and it is followed by three pairs of characters.
The possible pairs of two characters will be or FF A color is defined by two characters for
red, two characters for green, and two characters for blue. For example, #FF is just red,
whereas #FFFF is the combination of green and blue. Your program will ask users
whether they want to have red as part of the CSS color. If the user answers "Yes", FF will be
used for the red component; otherwise will be used. The program will then ask the user
whether they want both green and blue in the CSS color. If the user answers "Yes", FFFF will
be used for green and blue; otherwise will be used. As you can see not all possible
color choices can be generated eg #FFFF The following are examples of running the
program. The examples illustrate the messages to use when reading data and displaying the
result. Notice that in addition to use "Yes", users can use "Yeah" to accept a choice. Any
other value entered is considered a No answer.
Do you want red? YesYeahNo: Yes
Do you want green and blue? YesYeahNo: No
Project # Java BasicsConditionals
Final Color: #FF
Do you want red? YesYeahNo: No
Do you want green and blue? YesYeahNo: Yes
Final Color: #FFFF
Divisible Program Write a program that reads two integer values x and y computes the
remainder, and determines whether x is divisible by y Call a method that takes y as a
parameter and validates that y is not equal to zero; the method should return true or false.
The following are examples of running the program. The examples illustrate the messages to
use to read data and the messages to display when x is divisible by y and when it is not
divisible by y
Enter x:
Enter y:
Value of y cant be
Enter y:
Remainder:
is NOT divisible by
Enter x:
Enter y:
Remainder:
is divisible by
Submission
Submit three java files one for each program
Submit three WordPDF documents; one for each program. Each document should have a
test table with test case # input, expected output, actual output, and passfail columns. You
need to have at least three test cases for each program. If the program validates input, you
need to have at least one test case with invalid input. You need to provide a screenshot for
every test case.
Other
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
