49,757 Topics

Member Avatar for
Member Avatar for Briki
Member Avatar for sujanthi.kumari

# include <iostream.h> # include <conio.h> int main() { float income=0; int tax=0; float r1=0.0; float r2=0.1; float r3=0.2; float r4=0.3; float r5=0.4; float r6=0.5; cout<<"Enter income:"; cin>>income; if(income>=100,001) tax=income*r6; else if(income<=100,000 && income >=70,001) tax=income*r5; else if(income>=70,000 && income >=50,001) tax=income*r4; else if(income>=50,000 && income >=30,001) tax=income*r3; else if(income>=30,000 …

Member Avatar for new_developer
0
181
Member Avatar for jt1250champ

I need help reading lines from text files. I have been trying to read the first line just using getline(stream,line) assuming that my text file starts on the first line. This line of the text file is supposed to tell you how many lines there are so the next step …

Member Avatar for new_developer
0
837
Member Avatar for soche123

the program exites as soon as it reaches the end but I want it to ask the user if they want to exit or continue again?

Member Avatar for new_developer
0
230
Member Avatar for Doze_4u

I'm a little confused with an assignment here and i just needed someone to point me in the right direction. Design an inventory class that stores the following members: serialNum : An integer that holds a part’s serial number. manufactDate : A member that holds the date the part was …

Member Avatar for joshua.klaser
0
345
Member Avatar for joshua.klaser

Essentially I have two header files, one called 'ACYDTypes.h' that contains the classes for the basic types of this system and the other called 'Settings.h' that contains function for general settings. In the Settings.h file, there is a namespace called 'Ac_Type_Settings', and within that is a class called 'AcTypeSettings'. This …

Member Avatar for joshua.klaser
0
228
Member Avatar for MasterHacker110

I would like to start using the new fetures of c++0x like the constexpr. I currently have visual studio 2010 express c++ and I was wondering if there is a way to update the compiler but still use the same GUI? Oh and if anyone know how to permanantly disable …

Member Avatar for MasterHacker110
0
343
Member Avatar for soche123
Member Avatar for soche123

could you please tell me what is the logic behind different variations of priniting stars e.g **** ** * what loop will determine how many coloumns and rows are to be printed and how? Thank you very much!

Member Avatar for Captain119
0
113
Member Avatar for soche123

sum=0; while(count<20) cin>>num; sum=sum+num; count++; I did made this one but I think it's wrong..can you help out guys? #include <iostream> #include <conio.h> using namespace std; int main() { int sum,num,count; count=0; while (count<20) { cout<<"cin num"<<endl; cin>>num; sum=sum+num; count++; } cout<<"sum="<<sum<<endl; getch(); return 0; }

Member Avatar for soche123
0
2K
Member Avatar for mat0pad

So I'm making a IOS game and when I try testing my game in xcode simulator I get these errors below. Anyone have an idea what's wrong. Btw the behaivor is for unlocking new levels if actor collides with an object: Error in line 49: invalid operands of types 'objc_object*' …

Member Avatar for Labdabeta
0
375
Member Avatar for Lee Stone

What would be the best way to initialize a Multiple array (1,2,3) within an array (1,2,3) within an array(1,2,3)?

Member Avatar for Lee Stone
0
303
Member Avatar for soche123

Write a program that counts words, characters, uppercase letters, lowercase letters, digits and special characters in a phrase

Member Avatar for new_developer
0
180
Member Avatar for dreamcode2412

I have some problem with image processing (24-color bmp and 8-bit grayscale). I have read a *.bmp file. Can anyone help to rotate and flip bitmap image(using C++, without openCV library)? Thanks.

Member Avatar for DeanMSands3
0
379
Member Avatar for new_developer

Hi there, I have read that when we create object of a class, its default constructor is automatically called and default constructor assigns default values to variables e.g. to int it assigns 0 and to float it assigns 0.0 ... But I have write a program in which I have …

Member Avatar for new_developer
0
269
Member Avatar for siddiquedu

Can you please help !! Here, you see that const int size=25; Actually, How can i use infinite number like (n). I used "n" like bellow int n; const int size = n; however it only takes 8 values. My txt file can contained different value(n) evrytime, so, i dont …

Member Avatar for siddiquedu
0
406
Member Avatar for kamalashraf

hi, i have written a program to find area of triangle, but i meet some errors, i can not fix this error, kindly help me to fix the error. thanks. //******area of triangle******// #include<iostream> using namespace std; float trianglearea (float a, float b, float c, float d) { float r=a*b*c*d; …

Member Avatar for tinstaafl
0
266
Member Avatar for soche123

What's wrong with this code guys? #include <iostream> #include <conio.h> #include <cmath> using namespace std; int main() { char 'A''B','C','D','E','F'; int numbers; cout<<"Enter numbers"<<endl; cin>>numbers; if (numbers==90) {cout<<"Grade is A"} else if(numbers==80) {cout<<"Grade is B"<<endl;} else if (numbers==70) {cout<<"Grade is C"<<endl;} else if (numbers==60) {cout<<"Grade is D"<<endl;} else if(numbers < …

Member Avatar for tinstaafl
0
621
Member Avatar for Suzie999

Hi. In a project of mine, I have many different files 1.h, 1.cpp, 2.h, 2.cpp, 3.h, 3.cpp etc. Some of the functionality in them depend on veriables or functions in the others. If I juggle the #includes around I can get around most of it, for instance, if functionality in …

Member Avatar for Suzie999
0
201
Member Avatar for siddiquedu

I choose a program that can read data from a txt file. Now, I input two column from txt file and i want to substract first value of 2nd column to every value of 2nd column. finally I want the sum of substracted values. Can anyone please help me. Actually, …

Member Avatar for siddiquedu
0
246
Member Avatar for aslam.junaid786

**Create a class Employee with name, Id and salary as data members. Provide appropriate constructors, set, get and display methods in the class. In the main program, use a do-while loop to enter data for employees as long as the user desires and save all data to a file. Once …

Member Avatar for Schol-R-LEA
0
239
Member Avatar for Rasool Ahmed

Hello guys, I'm using MapViewOfFile to map a file and try to edit its data and save it on the file. The problem I have extra data to the file required to expand its size. So, how to append data to the end of memory mapped file using CreateFileMapping and …

Member Avatar for Rasool Ahmed
0
695
Member Avatar for Kesarion

Hi, Im trying to connect to a database but it doesn't seem to work. This is the code I'm using: [CODE] #include "stdafx.h" #include <iostream> #include <my_global.h> #include <mysql.h> using namespace std; int main(int argc, char **argv) { MYSQL *conn; conn = mysql_init(NULL); if (conn == NULL) { printf("Error %u: …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for nitish.mohiputlall
Member Avatar for Bchandaria
-2
106
Member Avatar for aps1003

I'm getting some error when compiling this code, could any one help me understand how to make primatives members of the iterator? template <class Type> void perfectShuffle(linkedListType<Type>& list) { linkedListIterator<int> tmp1; // Use for the topHalf of the list linkedListIterator<int> tmp2; // Use for the lowerHalf of the list int …

Member Avatar for ybkumar77
0
102
Member Avatar for shubam
Member Avatar for pipsy17

When there is a if while else in pseudocode how do you interpret it in a flow chart. For example, a1 if c1 { a2 while c2 { a3 } } else { a4 } is the else statement connected to the if statement or the while statement and if …

Member Avatar for mrnutty
0
234
Member Avatar for luislupe

Please consider the code below. This is a smaller version of what I'm trying to accomplish. Point instances will get random values to be printed in a 2D grid. In order not to have duplicates, I'm inserting them in `positions`. `ret` pair is used by me in order to know …

Member Avatar for mrnutty
0
2K
Member Avatar for DanDaMan

I'm including these three files in my C++ program: [CODE] #include <stdio.h> #include <cstdlib> #include <iostream.h> [/CODE] The C++ compiler I am using (Dev-C++ 4.9.9.2) Allows me to run this program. but I still receive an error message saying: [CODE]#warning This file includes at least one deprecated or antiquated header. …

Member Avatar for sanjila007
0
1K
Member Avatar for gobiking

I have been getting used to c++ as I have been trying various scenarious on programs and exand on them with new concepts. This is my first try at exporting data from command line to a text file and the program runs fine with all the calculations. The real issue …

Member Avatar for gobiking
0
245

The End.