Design and implement a timedate adt that can be used

Assignment Help Basic Computer Science
Reference no: EM131313010

1. Design and implement a TimeDate ADT that can be used to represent both a date and time as a single entity.

2. A line segment is a straight line bounded by two endpoints. The Line Segment ADT, whose operations are described below, represents a line segment defined by points in the two-dimensional Cartesian coordinate system. Use the Point class from Appendix D and implement the Line Segment ADT.

* LineSegment( ptA, ptB ): Creates a new Line Segment instance defined by the two Point objects.
* endPointA(): Returns the first endpoint of the line.

* endPointB(): Returns the second endpoint of the line.

* length (): Returns the length of the line segment given as the Euclidean distance between the two endpoints.

* toString (): Returns a string representation of the line segment in the format (Ax, Ay)#(Bx, By).

* isVertical(): Is the line segment parallel to the y-axis?

* isHorizontal(): Is the line segment parallel to the x-axis?

* isParallel( otherLine ): Is this line segment parallel to the otherLine?

* isPerpendicular( otherLine ): Is this line segment perpendicular to the otherLine?

* intersects(otherLine ): Does this line segment intersect the otherLine?

* bisects( otherLine ): Does this line segment bisect the otherLine?

* slope(): Returns the slope of the line segment given as the rise over the run. If the line segment is vertical, None is returned.

* shift( xInc, yInc ): Shifts the line segment by xInc amount along the x-axis and yInc amount along the y-axis.

* midpoint(): Returns the midpoint of the line segment as a Point object.

Reference no: EM131313010

Questions Cloud

Implement the counting bag adt : A Counting Bag ADT is just like the Bag ADT but includes the numOf(item) operation, which returns the number of occurrences of the given item in the bag. Implement the Counting Bag ADT and defend your selection of data structure.
Effectively with the management of a business : From which two sources does a union get its power to negotiate effectively with the management of a business? What is the significance of unions to managers?
Organization benefit from using publicity : What types of public-relations tools can organizations use? How might an organization benefit from using publicity?
History of the farmworker movement in the united states : Each section contains primary source materials that document the history of the Farmworker Movement in the United States between 1962-1993. For example, you may want to read a couple of essays written by farmworker strikers and volunteers.
Design and implement a timedate adt that can be used : Design and implement a TimeDate ADT that can be used to represent both a date and time as a single entity.
Illustrate the revenue cycle using a flowchart tool : Illustrate the revenue cycle using a flowchart tool. Take the patient through the cycle from the initial point of contact through the care and ending at the point where the payment is collected.
What is the expected return on stock y for next year : If there is a 50% chance that the economy will recover, and a 50% that it will not, what is the expected return on Stock Y for next year?
Do they give back to the community : Do they give back to the community? Do you feel employees are happy working there? What do you think the prospects are for future growth and profitability? Please elaborate on any / all of the above items or anything else you found to be interesti..
Design a student file writer adt that can be used to display : Design a Student File Writer ADT that can be used to display, or store to an output device, student records contained in a StudentRecord object.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write program reads in the length and width of a rectangular

Write a program that reads in the length and width of a rectangular yard (in meters) and the length and width of a rectangular house (in meters) placed in the yard. Your program should compute the time (in minutes) required to cut the lawn around ..

  Computer with three hard disks

You have a computer with three hard disks. A RAID 0 volume uses space on Disk 1 and Disk 2. R RAID 1 volume uses space on Disk 2 and Disk 3. Disk 2 fails. Which of the following is true?

  Proposals coming from contractors who have unique skills

Proposals coming from contractors who have unique skills in providing goods and services are called:    a. best and final offers (BAFOs)    b. negotiated proposals

  Why is it important to educate users about risks

what is a primary security risk that users should acknowledge when using macros? Why is it important to educate users of these risks once their dilemma is resolved?

  Track the following employee information

A local company is starting that will provide pet sitting services for the local community. This company will provide in-house and daily pet sitting services for dogs, cats, fish, birds and reptiles. Each of their employees is insured and are certifi..

  Estimate the constant factors for the runtime equations

Using empirical testing, try to estimate the constant factors for the runtime equations of the two algorithms. How big must n be before Strassen's algorithm becomes more efficient than the standard algorithm?

  Variety of locks available

Within a database their are a variety of locks available, many developers do not use locks explicitly. They use stored procedures which lock the data that they need. Stored procedures also promote code reuse in multiple applications. How far ca..

  Estimate created by senior management

Why is the cost estimate generated by the project team likely to be different from the cost estimate created by senior management?

  Do a lot more than calculations and reporting

Project managers do a lot more than calculations and reporting; they must keep the team on track, ensure ethical decisions are made, deal with conflict, and, depending on the type of organization, they may perform employee evaluations, issue bonuses,..

  Quadratic expression is of the form

To exemplify pointers, we will be doing quadratics. Remember that a quadratic expression is of the form: ax2 + bx + c where a, b, c are constant and a is not 0. You will scan in the values a, b, and c. With these values, you will write three funct..

  Health insurance portability and accountability act

The case described in the Introduction is not atypical, even with as much emphasis as there is on information security; it is a good example of where an organization has violated the HIPAA and/or state laws.

  Create a class named vehicle that acts as a super class for

Create a class named Vehicle that acts as a super class for vehicle types

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