Basically when I type in different widths and heights for the col and rows, the buttons that make up the width get cut off. Something is messed up but I'm not sure what!
InitializeComponent();
int _col = int.Parse(cols);
int _row = int.Parse(rows);
int width = groupBox1.Width;
int height = groupBox1.Height;
int bW = width / _col;
int bH = height / _row;
Define functions n(), s(), e(), w(), center(), ne(), se(), sw() and nw(). Each takes a Rectangle argument and returns a Point. These functions define connection points on and in the rectangle. For example, nw® is the northwest (top-left corner) of a rectangle called r.
I wrote below code for that:
#include <Simple_window.h> Point n(const Graph_lib::Rectangle& r); Point s(const Graph_lib::Rectangle& r); Point e(const Graph_lib::Rectangle& r); Point w(const Graph_lib::Rectangle& r); Point ne(const Graph_lib::Rectangle& r); Point se(const Graph_lib::Rectangle& r);
[Code]...
As you see, this just mark the top-left corner of the rectangle r. In other functions I need the specifications of that rectangle, for example its height and width. How to use these specs in those functions?
How would I make it so that I can have someone input the length, width and height for all 3 boxes and then have it output the sum and average volume? Here's an example of what I would like:
INPUT - Enter Box 1 (Length, Width, Height): 10.1 11.2 3.3 INPUT – Enter Box 2 (Length, Width, Height): 5.5 6.6 7.7 INPUT – Enter Box 3 (Length, Width, Height): 4.0 5.0 8.0 OUTPUT – The sum of the volume is 812.806 OUTPUT – The average volume is 270.935
Here's my original code:
#include <iostream> using namespace std; double box(double length, double width, double height); // use double data int main() { double sum; sum = box(10.1, 11.2, 3.3) + box(5.5, 6.6, 7.7) + box(4.0, 5.0, 8.0);
Provide the definitions for the following class declaration and then write a program that demonstrates usage of each member function using the test data of 10 for width and 8 for height. Remember to put your main program, class header and class source into separate files. This is an easier version of the exercise than the one you have been asked to practice. Only provide code for the methods specified in the class declaration. Note that the displayRectangle() method should output an appropriate ‘box’, its dimensions, area and perimeter to the screen.
class Rectangle { public: Rectangle(int height, int width); ~Rectangle(void);
I looking for method which can give me the height difference of an AVL_tree.
The method i come up with up now is this.
int avl_tree::balance(node* pointer) { while (pointer->left != NULL) { int left = balance(pointer ->left); } while (pointer->right != NULL) { int right = balance(pointer->right); } return left - right; }
Which recursively calls itself, but the problem is that i get stuck on the first line..
Is there a way to set the height of a listBox to show all of the items without having to kick in the vert scrollbars? I've searched on this question but can't find how to do this.
I want to kind of auto-size my listBox height to accommodate my items (within reason and perhaps set a max height which would kick in the vert scroll bars.
The program is when a person clicks a button this button updates 2 separate listbox one tracks the total rolls the other displays the total amounts of frequency afterwards adjusting labels as a scaling measurement.
The problem I am having is right at the end where I am trying to adjust the width of the label this is what I have. It is highlighting the word "Items" for each label and says that Non-Invokable member 'System.Windows.Forms.ListBox.Items' Cannot be used like a method L2 is a label. Additionally I have added in the information for one of my loops below the line I am having trouble with this loop is created to determine how many lines are in the listbox of rolls and I have no trouble with this just thought id add it for additional information I dont think I need to add the rest of the code but I can if needed.
L2.Width = int.Parse(lstfrequency.Items(0).ToString()); TL = 0; for (I = 0; I <= 10; I++) { TL += int.Parse(lstfrequency.Items[I].ToString()); } lstfrequency.Items.Add(TL);
I am drawing two circle (inner circle and outer circle) using DrawElipse method. I have created two pen object named OuterPen and InnerPen and creating Outer Circle using OuterPen and Inner Circle using InnerPen. Problem that I am facing is that when I increase the size of outer pen lets say 10px then it overlaps the inner circle and inner circle is hide. How can I increase the size of OuterPen outwards and not inwards so that it don't overlap the inner circle?
In a MDI-app with some toolbars and statusbar I created also a controlbar which can be docked to the left side. My problem now: how do I get the exact height of the controlbar?
In CalcDynamicLayout I set the height for the docked state to the height of the mainframe. This value is too big, but it will work basically.
But how can I get the exact height of the controlbar?
Code: #include <stdio.h> int main() { float number1, number2; printf("Enter two numbers separated by a comma "); scanf("%f,%f", &number1, &number2);
[Code] ....
When it prints the values, it prints them as I want. the problem is, what happens when someone puts in values with different width and precision? Here I had to write in the width and precision to display the values that are specified in the book. but what happens when someone puts in something that doesn't have those width/precision?
I end up with a lot of zeros after the number. initially I got 24.000000 (zeros are not accurate amount) I needed to show just 24. (with the decimal)
So I included %2.0f which gave me 24 (without the decimal point) what if some one put in 24.556. I got 25 as a result.
Does the width mean how many numbers in total including the decimal point and that is a minimum?
I am trying to set the width of the data values which the user will input when using the program but I don't know how to get it to show the values when I tryto set the width of the variables in a nice column .
I derived a class from CRecentFileList in order to set the number of displayed chars for MRU.
The problem is that if I open the app with 256 set for this number (it is read from .ini file) the display is correct. But after I change it to 10 for e.g., File menu width remains unchanged altghough MRU are correctly displayed on 10 (or at least file name lenghts) chars.
how can I tell to the menu to shrink to actual width?
I understand that I have to find the height by using _left->height() and _right->height() as long as it is not a null-pointer , each time I do this the values of _left and _right change. That way you can check if it is possible to go further down in the tree. I also have to use a counter to keep track of the number of layers at each side of the root. I don't understand how to implement it.
I am attempting to write a simple C program, in which the user is asked to input their name and height in inches and the output is the user's height in centimeters.
I have attached my program and what happens when I try to run it.
I need a ownerdraw CListBox where I can change the item height during working with the list. The msdn says that I can specify the height in OnMeasureItem when the listbox will be created (ownerdrawfixed) or when an item will be inserted (ownerdrawvariable).
How to change the height e.g. when I click a button?
I made also some tests with CListCtrl. There I can change the height. But there is only one height for all items. How to set individual heights for the items?
How to read and write an arbitrary number of bits from/to a file stream.
For instance, how to repeatedly read 9 bits from a file, then change to 10 bits, then 11 bits, and so on?
Obviously one way is by doing a lot of bit shifting, and masking. But honestly, I'm too dumb to get it right. Then I thought about using std::bitset and std::vector<bool>.
I am having trouble with calculating the volume of a cone
Assignment: Using the knowledge you already have, create, build, run, and correct if necessary a program that will calculate the volume of a cone. Insert into your code values for diameter of the base and the height. Use variables, constants, literals, and mathematics as necessary.
The formula for the volume is:
1/3 π x Radius2 x Height
Hint: you will need to add to your program two lines where appropriate:
#include <cmath> const double PI = 2*acos(0.0);
Here is my current code:
#include <iostream> using namespace std; int main () { //diameter of the base float diameter = 3;