Prepare a program in c++ using the class as defined

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

Program: Prepare a program in C++ using the class as defined below.

Put the class definition in a separate header file, and put all the functions' code in a separate Resource file. Then write the main program in another file that will read in some numbers and test out whether your functions all work.

As you can surmise from the names, the class has two constructors test both of them, and it has two access or functions test both of them, and a function to evaluate the perimeter of the quadrilateral.

You can think of a quadrilateral as having at most only two distinct values for its sides ( a rectangle, say).

The friend function is to allow comparison of the perimeters of two quadrilaterals. Test out this function too. Keep the class definition as it is written here.

Use this as your header files

#include <iostream>

using namespace std;

class Quadrilateral

{

Public:

          Quadrilatearl()

          Quadrilateral (int s1, int s2);

          void Perim();

          int GetSide1();

          int GetSide2();

          friend char Compare (Quadrilateral sh1, Quadrilateral sh2);

Private:

                 int p;

                 int side1, side2;

};

You have to use C++ language to evaluate the perimeter of the quadrilateral.

Reference no: EM13704472

Questions Cloud

Calculate c with various sets of values for a and b : Even if we were to declare variables a and b as integers, why might we still need to declare c as a ?double?
Will the direction and magnitude be integers or doubles : Define a Physics_vector class which consists of a struct containing the direction and magnitude, and also define a function
Subnetting and supernetting : What are the key differences between the following two terms: subnetting and supernetting? Provide examples for each - Do you expect IPv6 will replace IPv4 completely in the coming future
What is difference between colorname0 byte and db : What is the difference between ColorName0 BYTE "New is Blue ", 0 and ColorName0 db "New is Blue ",  0 ?
Prepare a program in c++ using the class as defined : Prepare a program in C++ using the class as defined below - Then write the main program in another file that will read in some numbers and test out whether your functions all work.
Write a recursive definition that reverses the elements : Write a recursive definition that reverses the elements in intArray between low and high.
Write and debug a mips program : Write and debug a MIPS program that performs the given operations - Display one of the following statements depending on if a>b, or a=b or a
Determines if the input string is a valid lock combination : Write a Java program that satisfies the given requirement - Prompts the user to input exactly nine characters, which constitute a valid lock combination.
Write a program that reads a list of integer : Write a program that reads a list of integer and stores the integers in an array and write a function compact that eliminates all zeroes from its array parameter

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Definition of two queues

Write a code in C lenguage for the definition of two queues, one to hold the process in ready state and one to hold the process in waiting state. The queue should be designed to manage a process structure. Please comment the code.

  Define a string of four characters and converts

Write an assembly program that defines a string of four characters and converts it into an unsigned 16-bit integer.

  C program to randomly generate more than ten ip address

Write C or C++ program which Randomly generates more than 10 IP addresses written in decimal format and write results in text file (e.g. Dec_IPAddresses.txt)

  Lu decomposition with gauss elimination

The LU decomposition with Gauss elimination and what is the physical interpretation of the elements of ? Write C++ programs for steps 2, 3, and 4.

  Random permutations

Write a program in C++ that gives a prompt to the users, asking for an integer M.It then prints out a M different random permutations, one on each of M lines, of the numbers 1, 2, ... , 10, separated by spaces or tabs.

  Create a constructor that initializes the data

After the user answers the question, just put the actual answer down below the one entered. You do not need to check if they were correct.

  The two major modifications are the instruction of pointers

the two major modifications are the instruction of pointers and the calculation of mortgage interest rates.requirements

  Use the convention that all years have 360 days

In writing the days() function, use the convention that all years have 360 days and each month consists of 30 days. The function should return the number of days for any Date structure passed to it. Write a main () function to test your function.

  Part asuggest an application system which is able to

part asuggest an application system which is able to perform some arithmetic computations like commission system

  Change this code to read in strings from a text file

code takes in a string from a user, checks if the paranthesis are ballanced (as defined by my class) and also returns the variable from my line (also from my class). All like to change this code to read in strings from a text file (each line is a str..

  Write a program to calculate existing angles and do if and

write a program to calculate existing angles and do if and then from this and to place fixed angles at certain position

  Determine the position in the x-y plane

Every circle has a center and a radius. Given the radius, we can determine the circle's area and circumference. Given the center, we can determine the position in the x-y plane.

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