Create a class line which consists of start -end coordinates

Assignment Help C/C++ Programming
Reference no: EM132101187

Please write in C++

Create a class Line which consists of start and end coordinates, and line type. The default values should be as follows: start coordinate is (0, 0), end coordinate is (0, 0). This class should support two types of lines which are vertical (v) and horizontal (h).

The default value for line type should be vertical. This class has set function which is used to set the start and end coordinates, and line type.

This function should verify that the line can be drawn using the start and end coordinates based on the line type. This class also has draw function which draws a line.

First of all, you need to implement a class Coordinate. Hint: You need to calculate the length of the line in order to draw.

Reference no: EM132101187

Questions Cloud

Prove the logical equivalence of conditional statement : Prove the logical equivalence of conditional statement and contrapositive of two propositional variables using truth table.
Define and integer variable named employeescount : Defines a structure called Employee that contains a character member called id that can hold an id that is up to 9 characters long and a float member.
Create a class with the name student : Create a constructor that initializes all int to 0, float to 0.0, char to ' ', name = "NoName".
Show total distance traveled and total gas consumed : Allow the user to keep entering data in 5 minute increments until the user has no more data to enter. Show total distance traveled, total gas consumed.
Create a class line which consists of start -end coordinates : Create a class Line which consists of start and end coordinates, and line type.The default value for line type should be vertical.
Write a mips program that will read in a base : Write a MIPS program that will read in a base (as an integer) and a value (nonnegative integer but as an ASCII string) in that base.
Give the state of the array after it is max heapified : Give the state of the array after 3 "removes" (we are not really deleting anything) have been performed from the heap in phase 2 of heapsort.
Write a program to ask for the chord : With one cut across the middle of a pizza you can cut off half, that is, 50% of the pizza. With one cut at a different place you can cut off.
Using recursion determine if the string is a palindrome : Using recursion, count how many times each of the letter "a" and "k" are repeated (There may be 0 a and 0 k in the string).

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program in c to ask the user to input a set of characters

Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node. This means that each nod..

  Write a c program that takes an integer argument

Write a C program that takes an integer argument from the command line and outputs the sum of all digits of the integer. For example, the result of the invocation sum of digits 12345 should be 15.

  Show how this priority queue is affected by adding string

To tell if one element in ZooGraph has relation X to another element, you look for a path between them. Show whether the following statements are true, using the picture or adjacency matrix.

  Difference between connectionless and connection-oriented

How does SSH differ from Telnet? How does HTTPS differ from HTTP?

  Expected profit per warranty

If the store charges $15 for the extended warranty, what will their expected profit per warranty be? If the company sells 100,000 projectors and 15% of the customers purchase the extended warranty, what will their expected profits from extended wa..

  Create a second employee object using the multi-argument

Create a second Employee object using the multi-argument constructor, setting each of the attributes with appropriate valid values.

  Write a program which asks the user to enter an integer

Write a program which asks the user to enter an integer. The program will then print out all the numbers between 1 and the entered numberas well as the total.

  Write a program to track hourly employee arrival

A company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock - If the user enters an incorrect value more than 3 times, display a prompt that the prog..

  Write a driver program that tests all the methods

Write a Temperature class that has two instance variables: a temperature value (a floating-point number) and a character for the scale, either C for Celsius.

  Design a class named pet

Pet Class- Design a class named Pet, which should have the following fields: Name - The name field holds the name of a pet

  Write an interactive program that prompts for a desired sum

Write an interactive program that prompts for a desired sum, then repeatedly rolls two six-sided dice until their sum is the desired sum. Here is the expected dialogue with the user.

  Problem related to calculating average in program

Here's the program i must do: 3 evaluators will evaluate 4 parameters ( just name them parameter1, parameter2 ...) the program must ask the evaluators to input those parameters but as letters (N=1,M=2,S=3,B=4,E=5) then I have to do the average for..

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