49,761 Topics

Member Avatar for
Member Avatar for marc.orocay

can someone give me an example that draws right triangle using asterisk using do-while loop only (without using for loop)

Member Avatar for tinstaafl
-2
182
Member Avatar for Geowil

I am in the final stages of testing a text-based game I have been working on for several years but I am running into some major problems with my database access code and some very strange problems at that. What I am attempting to do is loop through a SQLite3 …

Member Avatar for Geowil
0
1K
Member Avatar for marc.orocay

can someone help me, I need a program like this but it **must not use for loop**. or can someone revise it using **do loop**? I need it badly #here is the code: { int n, i, j; do{ printf("Enter a positive int n: "); scanf("%d",&n); } while (n < …

Member Avatar for NathanOliver
-2
220
Member Avatar for christinetom

Hi everybody. Hope you are all well in the new year. I'm having trouble with joining two chars and displaying the output. For example Any clues as to how to do this? Thanks so much. #include <iostream> #include <string> using namespace std; int main(); { char a = 'x'; char …

Member Avatar for christinetom
0
458
Member Avatar for marc.orocay

Someone help me creating a this program. Well, I need a program that makes a triangle out of asterisk but it doesnt use "for" loop it only requires "do-while" loop. Actually I tried making one but it doesn't look like a triangle instead it jsut display a line of asterisk. …

Member Avatar for marc.orocay
-1
344
Member Avatar for nhrnjic6

void John_is_3D(int dimx,int dimy,int dimz) { int ***John; // pointer to pointer to pointer John = new int**[dimx]; // array of pointers to pointers for(int x = 0;x<dimx;x++) { John[x] = new int*[dimy]; for(int y = 0;y<dimy;dimz++) { John[x][y] = new int[dimz]; for(int z = 0;z<dimz;z++) { John[x][y][z]= x*y*z; cout …

Member Avatar for Ancient Dragon
0
182
Member Avatar for kiya ko

write a c++ program generat a fibonacci series using while loop statement .(Hint0,1,1,2,3,5,8,13,21,34,55,...)

Member Avatar for Banfa
0
195
Member Avatar for mayankjoin
Member Avatar for vipulsrivastava

Design and implement a class named "Vector 5D" using C++ which stores a 40 hypothetical vector having 5 components, you may assume these components as V[1], V[2], V[3], V[4] and V[5] . The class should use array to store these components. The class should have necessary constructors and member functions. …

Member Avatar for Lucaci Andrew
0
147
Member Avatar for gil.nickson

hi, can you help me with my code? actually its running but the total price of products bought is not displaying, can you help me with this one? :( #include<stdio.h> #include<string.h> #include<conio.h> int main(void) { int pno, choice, product, jf=12,d=10,l=107,c=2,cf=22,n=9,b=19,ap,a,total,disc,i,ctr,nSelection; char name[50]; char cname[50]; char y; char x; float price,qty,tax,dis,bill,dprice,ttotal; …

Member Avatar for noah_2
0
283
Member Avatar for pragati gupta
Member Avatar for deceptikon
0
85
Member Avatar for issamsaad

Write a program that allows accepting a positive integer number n and displaying n rows as the following form: Example: n =6 0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5

Member Avatar for issamsaad
0
110
Member Avatar for CreatorZeus

chan someone help me see this problem? its closed and everything. string notename; x = 1; cout << notename[x] << endl; if(remove(notename[x].c_str()) != 0) { perror( "Error deleting file" ); } else { cout << "File successfully deleted"; }

Member Avatar for Ancient Dragon
0
333
Member Avatar for triumphost

I have the following code for 2D dimensional arrays being flattened as 1D C-style arrays: #include <iostream> int main() { int width = 4, height = 10; int arr[width * height]; for (int i = 0, k = 0; i < height; ++i) { for (int j = 0; j …

Member Avatar for Banfa
0
991
Member Avatar for rowen_1

I am trying out sqlite3 create statements and forign keys in c++ and I came up with 4 requirements. 1) a employer can create a job position 2) a employer can view the form reject or shortlist the applicant for interview 3) a applicant may apply for a job position …

0
159
Member Avatar for kamalashraf

please tell me whats wrong in this code, i am getting error, help me to fix this. Course *array[10][5]; Course *array2[10][5]; while(!coursefile.eof()) { for (int i=0;i<10;i++) { for (int j=0;j<5;j++) { coursefile >> array[i][j]->getBook(); coursefile >> array2[i][j]->getSection(); } } }

Member Avatar for Moschops
0
139
Member Avatar for kamalashraf

consider this class class Course { string book; char section; public: Course (string bk, char sec) : book(bk), section (sec){} string getBook(){return book;} char getSection (){return section;} void print() { cout <<"book name is: "<<book<<endl << "section is: " << section << endl; } }; i want to make array …

Member Avatar for Ancient Dragon
0
107
Member Avatar for kamalashraf

i have 10 students, each student is associated with 5 courses and the section of course, i want to do this in array, please help regarding this. thanks. for example john book1 A book2 A book3 C book4 D book5 B marry book1 C book2 B book3 A book4 B …

Member Avatar for deceptikon
0
99
Member Avatar for CreatorZeus

I'm having a simple i/o with file problem. I have the name coming from a string but it just wont open at all. Incoming code: string notename[] = {"NULL","empty"}; ifstream readnote; readnote.open(notename[x].c_str(),ios::in|ios::out); if(!readnote) { cout << "Read Error"; } its prolly something small but i keep getting the error, can …

Member Avatar for CreatorZeus
0
283
Member Avatar for thomas_14

I have a function changeUserPassword() in user.cpp and I wanted to do a cppUnit test on it. here are some possible unit test for changeUserPassword 1. changing a password several times. 2. changing password to the same password. 3. changing a non existing password. 4. Changing the password on one …

0
92
Member Avatar for bramsever

can any body write QT calculator GUI application - to QT command mode program (in batch mode ) we need to give inputs from command mode

Member Avatar for alan.fontenele.1
-1
118
Member Avatar for mayyy

I have to write a program that generate 7 random numbers from 1 to 39 to write condition which don't allows to repeat the same number twice , and to sort them from the smallest to the greatest in the end to have this result **** LOTO GAME 7 TO …

Member Avatar for Ancient Dragon
0
93
Member Avatar for Seba Sama

Hello, I came across a strange pointer (in my opinion): `void *(*foo)(int *);` Why are so many stars there? It was explained like: "...read inside-out; notice that the innermost element of the expression is *foo, and that otherwise it looks like a normal function declaration. *foo should refer to a …

Member Avatar for Seba Sama
0
222
Member Avatar for breezett93

Hi Everyone, For a couple weeks, I have been developing a pi approximation program and making little upgrades. Right now, the program asks for an input of iterations and then prints out the approximation. Now, I want to have every iteration printed out into an excel file with an approximation …

Member Avatar for duskoKoscica
0
233
Member Avatar for user4678

I have the code for the first part of a problem, which is to write a program that reads an angle x (in radians) from the keyboard. Then, in a function, compute the cosine of the angle using the first five terms of this series. Print the value computed along …

Member Avatar for duskoKoscica
0
6K
Member Avatar for daviddoria

Should I use cmath to use PI and trig functions? I dont think math.h has it - and cmath and math seem like redefine alot of the same things. What is standard practice? Thanks, Dave

Member Avatar for duskoKoscica
0
2K
Member Avatar for CreatorZeus

so, im trying to make a simple funtion to see if there is a file in a folder. been looking everywhere but havent found one that worked out. annnnnnnnnnnnnd code snippet: ` WIN32_FIND_DATA FindFileData; HANDLE hFind; hFind = FindFirstFile(_T"C:\\Dev-Cpp\\notes", &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { cout << "No File found\n"; …

Member Avatar for duskoKoscica
0
518
Member Avatar for emorjon2

hi everybody! I really need your help here. I am developing a 3D game. so far I have came no further than finishing the 3D engine and print out some basic 3D-models. everything works okay, with exception of a bug, occuring after a couple of minutes of running time. it …

Member Avatar for mike_2000_17
0
553
Member Avatar for William Hemsworth
Member Avatar for Labdabeta

Hello, I have a quick question about c/c++ syntax. Basically I am wondering when it is allowable to have numbers in identifiers. My compiler happens to allow numbers in: * Function names * Class names * Variable names * Pre-processor names As long as they do not begin with numbers. …

Member Avatar for Labdabeta
0
225

The End.