You need to implement three programs: Area, Divisible, and ColorGenerator.
Overview
You need to implement three programs: Area, Divisible, and ColorGenerator.
Specifications
You need to implement four programs: Perimeter, EvenNumber, FormulaEval, and PickColor. 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
read the length and width values and display the perimeter. The following is an example of
running the program. The example illustrates the messages used to read data and to display
the area.
Enter base: 7
Enter height: 5
Area is: 17.5.
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
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. 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: 3
Remainder: 2
8 is NOT divisible by 3
Enter x: 8
Enter y: 4
Remainder: 0
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 5 images