Reference no: EM13161718
The program will use as the input, the length and width of a rectangle. The output of the program will be the area and perimeter of the rectangle.
Your program will contain a class called Rectangle. The class should also have at least two, and maybe more, member functions. One for getting, from the user, the length and width of the rectangle and the second for printing the area and perimeter of the rectangle. The input provided by the user must be greater than 0 and less than or equal to 20.0. If the user enters data that is less than or equal to 0 or greater than 20.0, then the program should output an appropriate error message.
The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results. The main program should only make calls to the member functions. No input or output should be done from the main program.
Calculations should be as follows.
Area = length * width
Perimeter = (2 * length) + (2 * width)
For the purposes of this program you can assume that that no character data will be used for input. However, do not assume that the input will be within the above specified range.
Also, for the purposes of this program you can use the following main() function.
void main()
{
Rectangle R;
R.getData();
R.printData();
return 0;
}
Method named printgrid
: Write a method named printGrid that accepts two integer parameters rows and cols. The output is a comma-separated grid of numbers where the first parameter (rows) represents the number of rows of the grid and the second parameter (cols) represents th..
|
Minimum contacts test
: Compare the minimum contacts test, as it is applied to the bricks-and-mortar activity of businesses, to their cyberspace activity. If you were a small business
|
Write a function to arrange 10 numbers stored in an arraye
: Writ a funtion to arrange 10 numbers stored in an array forom the largest to the smallest and pass the results to main program.
|
Program should display a menu
: The program should display a menu allowing the user to enter pointer values by selecting option 1, then perform shallow or deep copy by selecting options 2 or 3. After whcich, your program needs to display the new results after the copy is performed.
|
Main program should instantiate an instance
: The main program should instantiate an instance of the class Rectangle and then make calls to the member functions to input the data and output the results
|
Delete all sub-directories within
: Delete all sub-directories within "temp" directory if not empty. In Python program change the current working directory to [temp].
|
Program that reads a series of whitespace
: Write a program that reads a series of whitespace delimited strings from stdin and prints them back out, separated by spaces, in lexicographic order. You may assume that all strings are lower case and that no string has more than 20 characters.
|
The graphics frame class and the drawable interface
: This lab makes use of the GraphicsFrame class and the Drawable interface. Your missions is to create the class Airplane.
|
After the array is created and loaded
: After the array is created and loaded, the problem is then to sort the array and print out the contents of the sorted array. Please use a separate function for the sort routine and also a separate function for the print out of the array.
|