Design a class named rectangle to represent a rectangle

Assignment Help Programming Languages
Reference no: EM13761941

(The Rectangle class ) Following the example of the Circle, design a class named Rectangle to represent a rectangle. The class contains:

¦ Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.

¦ A no-arg constructor that creates a default rectangle.

¦ A constructor that creates a rectangle with the specified width and height.

¦ A method named getArea() that returns the area of this rectangle. A method named getPerimeter() that returns the perimeter. Draw the UML diagram for the class and then implement the class . Write a test program that creates two Rectangle objects -one with width 4 and height 40 and the other with width 3.5 and height 35.9. Display the width, height, area, and perimeter of each rectangle in this order.

Reference no: EM13761941

Questions Cloud

Backup utility programs : Of the five general categories of data analysis tools, which of the following is most commonly used by local agencies because it allows the investigator to quickly identify questionable graphics files?
Write a theater art essays on play fences and everyman : Write a Theater Art Essays on play fences and Everyman. Consider the following: What does the playwright intended to do? What does the film maker intended to do?
What is the optimal decision : Ken believes that the $300.000 figure for the Sub 100 with a favorable market is too high. How much lower would this figure have to be for Ken to change his decision made in part b?
Latin root in all capital letters : Now is the time for you to create TEN original sentences using derivatives from this module. Do not use the ones in the exercise above. Make sure that your sentences include both a DERIVATIVE from this module and the MEANING of its Latin root. Put..
Design a class named rectangle to represent a rectangle : (The Rectangle class ) Following the example of the Circle, design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named width and height that specify the width and height of the rectangle. The defa..
Bureau of labor statistics releases report : Every First Friday of the Month, the Bureau of labor Statistics releases report about last month's unemployment statistics. Therefore, the first week of July statistics for the month of June will become available.  Consider an economy with the follow..
Assignment-budget planning and control : Use the Internet and / or Strayer databases to research budget planning and control. Imagine that the company that you currently work for, have previously worked for, or would like to work for in the future has tasked you with preparing a budget p..
The effects of dollar inflation : Deflating a time series removes the effects of dollar inflation and permits the analyst to examine the series in constant dollars.True or false
Businesses have revenue that is sensitive to weather : 3. Many businesses have revenue that is sensitive to weather. In cases like these the businesses could hedge their risk using weather derivatives. Discuss an example of a weather derivative and how it is used by companies to mitigate risk. (20 points..

Reviews

Write a Review

Programming Languages Questions & Answers

  Clear description of the program you are building

Your final project will be to analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as function and subprogram calls and uses arrays...

  Create a simple command line program

Create a simple command line program that simulates the rolling of a pair of six sided dice a user given number of times. The number of times to roll the pair of dice should be read as input from the argv array on the command line.

  Create a work breakdown structure

Create a Work Breakdown Structure (WBS), and assign resources and cost by using a project management tool. As the IT project manager, you have been assigned a project to deploy ten (10) wireless access points in your company's warehouse.

  What would be the output of the countdown routine

If the call CountDown(10)was issued, what would be the output of the CountDown routine? If the call CountDown(0)was issued, what would be the output of the CountDown routine

  Prompt for user login to begin using the system

Suggest an application system which is able to perform some arithmetic computations, like commission system, encryption system, timer system, etc, from anyone of the following industry.

  Differentiating client-side and server-side scripting

Understanding difference between client-side and server-side scripting is significant when developing interactive sites. When and why should you use client-side versus server-side scripting?

  Create the logic for a program which merges two files

Create the logic for a program which merges the two files into one file containing list of all students in district, maintaining student id number order.

  Write the program by declaring one-dimensional array

Write the program by declaring one-dimensional array which could be used to hold data for grades (int type) of 10 students. The program will prompt user for numeric grades.

  Design program to asks for number of fat grams

Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows: Make sure the number of fat grams and calories are not less than 0.

  Create a package called my complete system

Author a new class within your newly created package called MySystemGui. In this class, you need to extend the JFrame class and implement the appropriate listeners so that your system will work.

  Explain the contents of the text box

Describe the contents of the text box after the button is clicked

  Write program to permit user to enter last names

Write down the program which permits the user to enter last names of five candidates in local election and number of votes received by each candidate.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd