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

  Write application to calculate average of temperature

Write the application to calculate average of set of temperature readings. Application prompts user to enter the number of temperature readings to be entered, then prompts user to enter temperature.

  Write program to calculate miles per gallon for automobile

Write down the program which calculates miles per gallon for automobile. The program must ask for beginning milage reading on odometer at first.

  Falling letters game

Generic queue in the first project and generic list in the second project - In the second project, the player clicks the mouse on any falling letter to remove that letter from the window.

  Describe issues-web site designers when adding multimedia

Describe some of the issues web site designers must consider when adding multimedia to a web site. Consider issues such as bandwidth, server load, or others you consider to be important. Please provide references.

  Building airline reservation system

Problem Description The aim of this project is to build airline reservation system. System must give two basic sets of services to an airline: First set of services allows the airline to provision its system.

  Write a class player contain attributes for player

write a class player contain attributes for the player name average and team.write three functions to input change and display these attributes.also write a constructor that asks for input initilize all the attributes?

  Program to calculate cost of purchase-requests from user

Program calculates cost of purchase, requests another item selection from user, and so on. User enters 0 from item menu to quit.

  Important factors in the design of your application

What do you think will be the most important factors in the design of your application and what are the most important principles that you want to include in the design of your application?

  The code to implement a state diagram to recognize

The code to implement a state diagram to recognize one form of the comments of the C-based programming languages, those begin with /* and end with */.

  General layout for a web-based source document

Suggest the general layout for web-based source document that prospective sellers could use to explain their antiques. Information must include the user ID, password, item, dimensions, origin, condition, and asking price.

  Develop procedure to returns recent order information

Develop a procedure that returns the most recent order information for aparticular basket. This procedure must determine most recent stage entry from the BB_BASKETSTATUS table

  Write program to reads student-s name together with score

Write a program that reads a student's name together with his or her test score. The program should then compute the average test score for each student.

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