51,593 Topics

Member Avatar for
Member Avatar for hkumar1993

Ok so first off, I've recently returned to C++, and I'm very new to both OpenGL, and Code::Blocks IDE (used to use Bloodshed Dev before) .. so please don't flame me if there's a basic solution to this I'm trying to read a ".asc" file which has the vertices of …

Member Avatar for hkumar1993
0
2K
Member Avatar for Fazal Hussain

Please suggest alternate code for Traingular matrices. #include <iostream> using namespace std; int main(void) { int rows = 5, cols = 5; int **arr; // allocate and initialize the array arr = new int * [rows]; for (int r = 0; r < rows; r++) { arr[r] = new int[r …

Member Avatar for David W
0
88
Member Avatar for Sarkurd

Hi I wrote a Singleton class but i got an error while controlling instantiation captain.h #ifndef CAPTAIN_H #define CAPTAIN_H #include <iostream> #include <string> class Captain { private: Captain(); Captain(const Captain&); Captain &operator=(const Captain&); std::string name; public: //Controll Instantiation static Captain &GetInstance(); //Set Name of the Captain std::string GetName(); //Get his/her …

Member Avatar for Sarkurd
0
191
Member Avatar for nhrnjic6

Am trying to build a function that will take string, sub_string that will be replaced, and new string that will replace that sub_string. Now before you all go with strstr, i dont want to use <string>. Anyway I got my code working to find a index of a char array …

Member Avatar for vijayan121
0
235
Member Avatar for whitebloodcell

I have a large database of tennis match reords played in the ATP and WTA tours over several years. I am going through these to generate a match history for each player in each year in each tour. I have 5 years of data and 4 tours (hence the dimensions …

Member Avatar for mike_2000_17
0
297
Member Avatar for lewashby

In the program below what is the difference between rand and srand? My book says that rand returns an int between 0 and RAND_MAX, which is never smaller than 32,767. Yet this code returns a number from 1-6, how is that? I see the line `( rand() % 6 ) …

Member Avatar for deceptikon
0
216
Member Avatar for tentrabyte

a. degree fahrenheit to celsius and vice versa b. centimeter to feet and inches to feet

Member Avatar for Moschops
-2
241
Member Avatar for Ivzirnalsradeys

A large program has been written for a company which rents out properties to tenants for long or short periods. There are separate data files which hold information about A the tenants B the properties C the payments made by tenants D the payments made by the company for the …

Member Avatar for David W
0
188
Member Avatar for tentrabyte

Make a C++ program that will ask for integer value and assign that integer value to variable A. Declare another floating point data type variable and name it as B with a constant value of 95.4567. Display the value of B variable in integer format and another display of B …

Member Avatar for David W
0
135
Member Avatar for tentrabyte

Write a program that will ask for two integer numbers. Assign the first integer to the first operand and assign the second integer to the second operand. Declare a variable named SUM. Get the sum of the numbers and assign it to the SUM variable.

Member Avatar for David W
0
110
Member Avatar for HuePig

Hi, I have a class named 'roomOne' and another named 'StoneAdventure'. 'roomOne' inherits from 'StoneAdventure'. Heres the Problem: Whenever I create an #include "roomOne.h" in the header file of 'StoneAdventure' I get an error C2504: base class is undefined. Note: Everything works fine if I remove the #include "roomOne.h" from …

Member Avatar for HuePig
0
205
Member Avatar for Tycellent

Hey everyone, Just trying to add to a scoreboard from a different class. The problem is that i'm not sure how to add to a scoreboard that has been previously defined in a different class. As i've instantiatied i'm assuming that has made a whole new Game (with a new …

Member Avatar for tinstaafl
0
882
Member Avatar for micheletsigab
Member Avatar for Hiroshe
0
107
Member Avatar for MasterChat

Good day to all! I'm totally lost here. I am just beginning programming lessons by reading How to Design Programs and use Dr. Racket. I bump into C++ and got confused which one should I learn first. Or should I study them at the same time. Please advise.

Member Avatar for MasterChat
0
222
Member Avatar for furalise

Hi Everybody. Was hoping someone could clear this up for me. My understanding is not good in this area. The below code simply reads a string from a text file two characters at a time. It then outputs them to console then casts them to an int and then outputs …

Member Avatar for Moschops
0
228
Member Avatar for Mark Kim Bryan

(The power station problem) A power station is on one side of a river that is one-half mile wide, and a factory is eight miles downstream on the other side of the river (see Figure 7-21). It costs $7 per foot to run power lines over land and $9 per …

Member Avatar for Schol-R-LEA
0
361
Member Avatar for iqra aslam

hello, i have dev c++ software , when i compile my program it displays an error message showing that "g++ =.exe has stopped working", what is the issue?, how can i resolve this issue?

Member Avatar for Schol-R-LEA
0
68
Member Avatar for faisaljvd

I am new to C++. Can somebody help me in this problem how can i evaluate and print the largest number from a series?

Member Avatar for faultybits
0
112
Member Avatar for Erick02

#include<stdio.h> #include<conio.h> void main() { int i,n,j; clrscr(); printf("\n Please Give The Value of N: "); scanf("%d",&n); for(i=n;i>=1;i--) { for(j=i;j>=1;j--) printf("%d ",j); printf("\n"); } getch(); system ("pause"); return 0; } `Inline Code Example Here`

Member Avatar for faultybits
0
441
Member Avatar for Erick02

#include <stdio.h> #include <conio.h> #include<math.h> void main() { int n,i,j,m,k; clrscr(); printf("Enter the No :- "); scanf("%d",&n); m=n; for(i=1;i<=n;i++) { printf("\n"); for(k=1;k<=2*m-1;k++) { printf(" "); } for(j=1;j<=i;j++) { printf(" *"); } m--; } getch(); system("pause"); return 0; }

Member Avatar for Slavi
0
74
Member Avatar for MrSONOFAHIPPY

Please help. I have an programming assignment due and i can't figure out how to code it. Complete the following code so that the program: 1. reads in any number of values in a given range into an array of integers 2. counts the frequency of each value, storing the …

Member Avatar for Erick02
-1
1K
Member Avatar for muhammad.husnain.5099
Member Avatar for andrew mendonca

Define a function named isDivisor that has two parameters of type int and returns a value of type bool. A call to isDivisor(m,n) should return true if and only if (iff) m divides n. For example isDivisor(6,24) will return true but isDivisor(5,24) will return false . Note that every number …

Member Avatar for chriswelborn
0
324
Member Avatar for andrew mendonca

Define a function int getRoots(double a, double b, double c, double & s1, double & s2) that solves a quadatic equation with coefficients a, b and c. If there are no real roots than the return value will be 0 and the values of s1 and s2 will be left …

0
135
Member Avatar for andrew mendonca

Define a function void order(int & a, int & b, int & c, bool ascending) that places the values in ascending or descending order, depending on whether the last parameter is true or false . For example, if x, y and z contain the values 3,1, and 2, respectively, then …

Member Avatar for ryantroop
0
230
Member Avatar for tentrabyte

A data that will declare the following variables with the corresponding data types and initialization value. Output the variables names together with the values. **Variables** **Data types initial value** Letter character a pi float 3.14 Name character sam

Member Avatar for chriswelborn
0
121
Member Avatar for CairBear1

I have to use inheriantce and polymorphism to calculate the force required to pull (at a constant velocity) and the weight of material that can be carried by a train consisting of many different types of cars. The weight ( *W* ) and rolling friction coefficient (f) can be used …

Member Avatar for Hiroshe
0
194
Member Avatar for justugas

Hello, I will make a program with c++ about binary tree, how to implement this structure tree to C++ [Click Here](http://1.bp.blogspot.com/-LyRoy4Vg5D4/UzFIproOq5I/AAAAAAAAAe4/UapVUA_7ZPA/s1600/tree.jpg)

Member Avatar for deceptikon
0
254
Member Avatar for andrew mendonca

Define a function bool isWin(char board[][3], char target); that returns true if character target has a winning position on this tic-tac-toe board. That means three occurences of target in a line, column or along either diagonal. For example if target is 'O' and if board[0][2], board[1][1] and board[2][0] all equal …

Member Avatar for Moschops
0
288
Member Avatar for sakshu

"URGENT" Structure or design(how many and what kind of classes may be involved) of "Automobile Dealer shop" project

Member Avatar for rubberman
0
53
Member Avatar for Mr.M

Hi Dw I know this may not be popular to many people but it a standard for financial industry. I'm developing a WOSA XFS app, I've developed the part that deals with calculating denominations, determines how many CU can be dispensed for each CU denomination. Now the problem is that …

Member Avatar for Mr.M
0
2K
Member Avatar for yeyo_1

Hi everyone, First time here, my early days in c++, will really like to be mentored(the experts)

Member Avatar for yeyo_1
0
159
Member Avatar for Sarkurd

Hello I use MinGW 4.8.2 and Qt IDE i tried to use `gprof`, I added the following flags QMAKE_CXXFLAGS_DEBUG += -pg QMAKE_LFLAGS_DEBUG += -pg to `.pro` file and extarcted the `gmon.out` file but i don't know how to convert it to a `.txt` file. the document say gprof options [executable-file …

Member Avatar for Sarkurd
0
363
Member Avatar for kamlesh malav
Member Avatar for andrew mendonca

Write a complete program that reads an integer k > 1 from the console and finds the first positive natural number n hat is divisible by all whole numbers between 2 and k inclusive. Your program may only use do-while loops , even if you think a for-loop or while …

Member Avatar for Hiroshe
0
382
Member Avatar for ankit.4aug

[CODE]int *a; char *c; *(a) = 20; *c = *a; printf("%c",*c); [/CODE]

Member Avatar for Suchita_1
0
141
Member Avatar for Yahia Farghaly

Hi all, can someone help knowing the difference between char *st="myname"; char st[]="myname"; i know they both is array of charachers but the difference when dealing with them and how they are in memory ? Thanks.

Member Avatar for Yahia Farghaly
0
342
Member Avatar for tentrabyte
Member Avatar for Neuman
0
109
Member Avatar for Miguel24.07

Hi i am new in this world, so i need some help with this. I need to make a program in c++ or c, receive an xml file, and the program count the file labels (<Home> <\Home>) and say how many time repeats the same label. Thanks

Member Avatar for Lucaci Andrew
0
232
Member Avatar for tentrabyte

Write a program that will ask for two integer numbers. Assign the first integer to the first operand and assign the second integer to the second operand. Use the following assignment operators: =, *=, /=, %=, +=, and -= Display the result of each operation. Consider the following sample output: …

Member Avatar for Tycellent
0
521
Member Avatar for Saadiya

Hello everyone! i tried to run this code on the command prompt and got this error: "Invalid token '(' in class, struct or interface member declaration". Please how do i solve this? what does it mean? Thanks. using System; namespace FFC { public abstract class Furniture{ protected string color; protected …

Member Avatar for chriswelborn
0
151
Member Avatar for Gisele

Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles per gallon the automobile can be driven. The program outputs the number of miles the automobile can be driven without refueling

Member Avatar for chibi-hime
-2
159
Member Avatar for Pineas

APPLIED PROGRAMMING (APR520S) ASSIGNMENT 1 Problem Solving Tools Total Marks: 50 Marks Due: Friday 22 August 2014 Suppose we want to construct a C/C++ program that can be used to calculate the area or the volume for a range of 2-D and 3-D shapes respectively. Consider only the following shapes. …

Member Avatar for Pineas
-1
262
Member Avatar for AZERIOMON

1. Create a class called Record that financial institute might use to represent their customer's record. This class should include one data member of type int to represent the account balance. Provide a constructor that receives an initial balance and uses it to initialize the data member. The constructor should …

Member Avatar for Sarkurd
0
311
Member Avatar for phony

> names.dat Collins, Bill Smith, Bart Michalski, Mel Griffin, Jim Sanchez, Manny Rubin, Sarah Taylor, Tyrone Johnson, Jill Adams, Andrew Moreno, Juan Wolfe, Bill Whitman, Jean Moretti, Bella Wu, Jeff Patel, Renee Harrison, Rose Smith, Cathy Conroy, Patrick Kelly, Sean Holland, Beth #include<iostream> #include<fstream> #include<cctype> using namespace std; void read_names(string …

Member Avatar for rubberman
0
178
Member Avatar for ptolomeo

Hello. I'm desperate because I have one project that uses a third party DLL and receives data in a Vector. The original project works fine in VC6, and compiles perfectly with no errors in VS2010, but when executing it, we get some weird behaviour: - The result (that comes in …

Member Avatar for mike_2000_17
0
319
Member Avatar for Ivzirnalsradeys

For this question, select and name a high-level language you will be discussing. Diagrams might help in your answers. a) Explain how the computer passes control to a subroutine (or procedure) and returns it to the main routine once the task has been completed. b) Explain, giving a relevant example, …

Member Avatar for Taywin
0
236
Member Avatar for rehan_5

hey! i m new and don't know how to read a .dat file in C++. Can anyone help me to put me out of this problem?

Member Avatar for sanjulovers
0
4K
Member Avatar for iceparticle.com

Hello, can anyone clarifies this? I need to find consecutive segments that are odd or even. For example 2 6 5 = 2 and 6 = **2** consecutive even integers | 1 odd 4 6 8 1 3 = 4, 6, and 8 = **3** consecutive even integers | 1 …

Member Avatar for sanjulovers
0
219
Member Avatar for Entalist

/*Write a program which will print all the pairs of prime numbers whose sum equals the number entered by the user. */ #include <iostream> #include <vector> using namespace std; int main() { int maxNum; bool prime = true; cin >> maxNum; vector <int> primeSequence; for(int i = 1; i <= …

Member Avatar for Entalist
0
2K

The End.