C/C++ :: Forming Triangle With Border And Fill Characters?

Jan 22, 2014

This code is for a member function called Triangle. It's a Draw() function that uses border characters and fill characters. I've been trying to work it out in a seperate file just so I can get it to work before I add it to my function definition.

#include <iostream>
using namespace std;
int main() {
for(int i=1; i<=8; i++) {
for(int sp=1; sp<=8-i; sp++) {

[code]....

I haven't attempted the fill characters (well... I have, but it was so wrong it was ridiculous). I need to get rid of the extra '*' at the very top. Here's an example of what this should look like...

*
*#*
*###*
*#####*
*#######*
*#########*
*###########*
* * * * * * * *

View 9 Replies


ADVERTISEMENT

Computer :: Fill A Triangle (in 3D) With Equidistant Points

Oct 9, 2014

I'm in need of an algorithm to find the points within a triangle(vertices are known. 3d coordinates). The points are to be at same distance from one another i.e. the points are uniformly distributed within the triangle.

I have done a search about the topic and have come across some ideas like lattice points generation ,tiling polygons with Lattice triangles [URL] .... and taking their centroids as the points.

View 1 Replies View Related

C++ :: Forming A Matrix Multiplication Program

Oct 9, 2013

I just started Linear Algebra for my programming degree and to full understand everything I want to put it into code and make my own "matrix calculator." I have all the theory but I am having issues keeping the matrix variable and moving it around the class' functions to create it and output it. Once I know I have it saved I think I can get the addition/multiplication to work. Here is the code I have so far:

#include <string>
#include <iostream>
using namespace std;
class matrix {

[Code] ....

View 5 Replies View Related

C++ :: Forming Unique String With Single Occurrence Of Words

May 10, 2012

I am trying to form unique string from other string which is having multiple presence of same word as,

string testA = "one
two
three
four
one
seven wo";

now new string should contain single occurrence of words "one" and "two" so that new string will look like,

string testB = "one
two
three
four
seven"

View 3 Replies View Related

C :: Creating Border Around Program

Mar 6, 2015

I am trying to create a border around my program. It looks like this: . I had to read a file in, which is in the attachment and produce the desired output in the image. I have produced the desired output, but without the border.

Here is my code thus far:

insert Code:
#include<stdio.h>
#include<Windows.h>

#define HEIGHT 21
#define WIDTH 78

int map[HEIGHT][WIDTH];
int i = 0, j = 0;

[Code] ....

View 2 Replies View Related

C :: Display The Other Half Of Box Border?

May 9, 2013

how to display the other half of the box's border? where should i put the printf? or is there any other method that you can show me using arrays?

Code:

#include <stdio.h>
#define ROW 15
#define COLUMN 15
void disp_box (char b[ROW][COLUMN])

[Code].....

View 9 Replies View Related

C# :: Draw Border Around TableLayoutPanel Cell

Mar 6, 2015

I would like to draw a border arround a cell in a TableLayoutPanel but without also making a connection between the columns. I just want an outer border.

private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e) {
if (e.Row == 0) {
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Right, e.CellBounds.Top));
e.Graphics.DrawLine(Pens.Black, new Point(e.CellBounds.Left, e.CellBounds.Bottom), new Point(e.CellBounds.Right, e.CellBounds.Bottom));
e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Left, e.CellBounds.Bottom));
}
}

This line

e.Graphics.DrawLine(Pens.Black, e.CellBounds.Location, new Point(e.CellBounds.Left, e.CellBounds.Bottom));

also paints connections, where i don't want them. How can i just make a outerb order arround a cell and is there a easier way to do it? Here's also an image of what i want. I don't know if i described it right.

View 2 Replies View Related

C# :: Erase Inner Border Between 2 Columns Of Table Layout?

Oct 7, 2014

So in my winform form, I have a table layout panel and I attach Controls on the row. I make some control span multiple columns... But since I use transparent for the background of the layout panel, it show the border between 2 cells that I span.. Like this:

How do I erase the border in the middle of IDLabel?

View 14 Replies View Related

C++ :: How To Fill Cards In Deck

Sep 9, 2013

Here is my source code i am trying to write a function (fillAll) to fill all 52 cards in a deck and i would like to use my data struct for the function and make Deck one of my parameters.

enum suit{HEARTS, CLUBS, DIAMONDS, SPADES};
enum face{TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE};
struct Card{
suit suitType;
face faceType;

[Code] .....

View 10 Replies View Related

C++ :: SDL Fill Screen With Image?

Jul 19, 2013

so im trying to make a background for a menu, but it is only so big. its not the kind of picture where i can just reapply it. is there a function to make it fill to the screen?

View 4 Replies View Related

C# :: SQL To XML To Fill Empty List

Apr 2, 2014

So this is my working code with sql i want convert it so i can read it from xml, basiccl i need to fill empty list with xml column BrivDat..

var connStr = @"Data Source=(LocalDB)v11.0;" +
@"AttachDbFilename=C:dbaseAdaPlus.mdf;Integrated Security=True";
List<DateTime> Holidays = new List<DateTime>();
using (SqlConnection conn = new SqlConnection(connStr))
using (SqlCommand cmdd = new SqlCommand("select * from Brivdienas", conn))

[Code] ......

View 5 Replies View Related

C :: How To Print Characters But No String Just Array Of Characters

Mar 20, 2014

so my question is i want to print characters,no string just an array of characters,i do this but it s not working,maybe i have to put the '' at the end?

Code:

int main() {
int i;
char ch[5];
for(i = 0; i < 5; i++) {
scanf("%c",&ch[i]);

[Code]...

View 6 Replies View Related

C/C++ :: Find The Common Characters Between Two String Characters

Jul 6, 2014

Im supposed to find the common characters between two string characters, assuming that the user wont input duplicate letters like ddog. When I run my code I get an output of a question mark upside down. Here is my code with comments on what each part is supposed to do

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char str1[20], str2[20],remp = '';
int size1,i,j,temp;
printf ("Input the first string");

[Code]...

View 6 Replies View Related

C++ :: Fill Between Lines Of A Graph (koolplot)

Apr 16, 2014

I am using koolplot plot graph and able to plot two lines in a graph. My question is how to fill between the lines? Is it possible to do so with koolplot? or i should use another library?

View 2 Replies View Related

C++ :: Program To Fill Grid With Values Between 1 And 100

Aug 27, 2014

Write a menu driven program that will fill grid with values between 1 and 100. Begin the program by declaring a array of type int. Then present the user with the following menu

Enter 1 to add
Enter 2 to edit
Enter 3 to delete
Enter 4 to search
Enter 5 to display
Enter 0 to Quit

Each item of the menu must be implemented as a function. The program should Only allow values between 1 and 100

Always ask the user to apply coordinates for the cell to be changed

Flag an error when try to delete or edit a cell with a zero (0)

Flag an error when try to add to a cell that is not blank

Display the complete and nicely formatted grid when option 5 is selected

View 2 Replies View Related

C++ :: Circle Fill Color In - FLTK

Aug 28, 2014

I installed FLTK 1.3.X (from here [URL] ...) on my visual studio 2012 compiler and use PPP book for programming (this: [URL] ..... ). My problem is about filling a Shape in. For example , this code:

#include <Simple_window.h>
using namespace Graph_lib;
int main() {
Simple_window win(Point(100,100), 1000, 600, "Binary_tree");
Graph_lib::Circle c(Point(200,200),50);
c.set_color(Color::red);

[Code] ....

When I run the program, All three Shapes are drawn but only the Rectangle is filled in! Why?

set_color works for the three and apparently the set_fill_color is defined for all Shapes and it too should work but why it doesn't work for Circle and Ellipse?

This is the .CPP and .h files [URL] ....

View 3 Replies View Related

C Sharp :: No Definition For Fill (WinForms)

Feb 13, 2013

I'm working on a personal project, where I have a database (SQLite) and a dataGridView. Now This is what I have:

 public Form1() {
            DataSet ds = new DataSet();
            SqlConnection connection = new SqlConnection(@"Data Source=testingsql2.s3db");
            SqlDataAdapter SQLda = new SqlDataAdapter("Select * from User", connection);
            SqlCommandBuilder SQLcb = new SqlCommandBuilder(SQLda);
            dataGridView1.Fill(ds, "User"); //Error here
            dataGridView1.DataSource = ds;
            dataGridView1.DataMember = "User";
        }

I've marked where I get the error.

And the Error description:
Error    1    'System.Windows.Forms.DataGridView' does not contain a definition for 'Fill' and no extension method 
'Fill' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be found 
(are you missing a using directive or an assembly reference?)

View 2 Replies View Related

Visual C++ :: Fill Array With Even Numbers Only

Dec 7, 2014

I need to fill two 2D arrays, the first one with even numbers from 1 to 50, the second one with odd numbers from 1 to 50.

Code:
#include <iostream>
#include <ctime>
#include <iomanip>
using namespace std;
int main() {
srand(time(NULL));

[Code] ....

View 5 Replies View Related

C :: Trying To Fill A Character Array With Scanf Function

Oct 5, 2014

I'm trying to make a character array, and be able to custom fill it by using the scanf() function to ask the user for each character spot in the array.

Code:
#include <stdio.h>
int main() {
int i;
char character_array[11];
char *charpointer;
charpointer = character_array;

[Code] .....

And this is the output i get when i run it:

Code:
root@kali-Tulips:~# ./myown
what letter would you like in the [0] spot of the array? :
a
what letter would you like in the [1] spot of the array? :
what letter would you like in the [2] spot of the array? :
b
what letter would you like in the [3] spot of the array? :
what letter would you like in the [4] spot of the array? :

[Code] .....

Obviously I'm trying to grasp C programming and am very new. I don't understand why this isn't working, and i think its more than my lack of knowledge of C syntax. I believe the correct memory is allocated but when examined with gdb i don't find what i expect....

View 4 Replies View Related

C :: Simple Get Function To Fill Instance In Structure

Apr 2, 2013

Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct employee {
char firstName[20];
char lastName[20];
float rate;

[Code] .......

View 5 Replies View Related

C++ :: Fill Array Of Size 16 A-P Forward And Backward

Apr 28, 2014

I am trying to fill an array of size 16 A-P forward and backward but im having a hard time filling the array with A-P. Here's what i have so far.

#include<iostream>
#include<iomanip>
using namespace std;
int main() {
int arr[16];
char mych='A';

[Code] ....

View 1 Replies View Related

C :: Change / Fill List Without Changing Function Type

Feb 13, 2013

I am an IT student currently learning linked list. I have a problem with my code here. After I call addFront() my list doesn't change when I display it. How do I somewhat change/fill my list without changing the function type? I know it works on pointers still messed up with linked list.

Code:

typedef struct node *nodeptr;
struct node{int item;
nodeptr next;};
typedef nodeptr List;
}

[code]....

View 3 Replies View Related

C# :: Fill A TextBox On WebPage Using OnKeydown HTML Element

Oct 31, 2014

Is it possible to fill a textbox on a webpage using the onkeydown html element in c# using the web control built in. i am totally aware of the normal methods of doing this but the normal methods have failed to work....

i am referring to this [URL] .....

View 6 Replies View Related

C Sharp :: How To Fill In HTML Textbox From Windows Application

Apr 19, 2012

1. Open a browser and navigate to a URL (manually)

I would like to do the following from a windows application:

2. I will click "Fill data" button from Windows screen,

3. We have to identify what are the browsers opened in the PC and which browser has correct URL

4. Once the correct browser is identified with the URL, we have to fill in data (received from scanner) in the html page opened in the browser.

How to achieve above functionality.

View 2 Replies View Related

C/C++ :: Check For Set Of Characters In Array Of Characters?

Mar 26, 2014

I have an array of characters. I am trying to find "houston". The only way I can think of to do this is to use a for loop and check each individual character. Is there an easier way to do this?

char string[] = "Fishing tourism miami atlanta dallas houston";

View 9 Replies View Related

C++ :: Create A File And Fill 6x6 Array With Random Positive Integers

Nov 24, 2014

This is my code!! but it's not working at all.

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main () {
ofstream fout("datain.txt",ios::out);
int array[6][6];

[Code] .....

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved