You need to implement three programs: Area, Divisible, and ColorGenerator.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

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

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Knowledge Booster
Database connectivity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education