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, input/output, 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: -3
Invalid length. Make sure to enter a positive number.
Enter length: 7
Enter width: 5
Area is: 35
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 2 characters.
The possible pairs of two characters will be 00 or FF. A color is defined by two characters for
red, two characters for green, and two characters for blue. For example, #FF0000 is just red,
whereas #00FFFF 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 00 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 0000 will be used. As you can see not all possible
color choices can be generated (e.g., #FF00FF). 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? (Yes/Yeah/No): Yes
Do you want green and blue? (Yes/Yeah/No): No
Project #1, Java Basics/Conditionals
2
Final Color: #FF0000
Do you want red? (Yes/Yeah/No): No
Do you want green and blue? (Yes/Yeah/No): Yes
Final Color: #00FFFF
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: 8
Enter y: 0
Value of y cant be 0.
Enter y: 3
Remainder: 2
8 is NOT divisible by 3
Enter x: 8
Enter y: 4
Remainder: 0
8 is divisible by 4
Submission
Submit three .java files (one for each program).
Submit three Word/PDF documents; one for each program. Each document should have a
test table with test case #, input, expected output, actual output, and pass/fail 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!