49,761 Topics

Member Avatar for
Member Avatar for monroe85

#include <iostream> using namespace std; int main(){ double w,x,y,z,avg; cout <<" PLEASE ENTER FOUR ENTRIES OF MARKS"<<endl; cin >> w >> x >> y >> z; avg=((w+x+y+z)/4); if(avg>60){ cout <<"YOU PASS"<<endl;} else{ cout<<"YOU FAIL"<<endl; } cout<<"YOUR AVERAGE MARK IS "<<avg<< endl; return 0; }

Member Avatar for Necrolis
0
71
Member Avatar for harisshafiq

A machine with 32-bit integers can represent integers in the range of approximately 2 billion to +2 billion. This fixed-size restriction is rarely troublesome, but there are applications in which we would like to be able to use a much wider range of integers, such as factorial. This is what …

Member Avatar for ithelp
0
367
Member Avatar for tlox

I am trying to write a C++ program that will prompt the user to enter an angle value and calculate its sine,cosine and tangent without using c math library.The angle value denoted x,should be in radian,otherwise the program will convert it into radian before it computes its sin,cos and tan.So …

Member Avatar for ithelp
0
197
Member Avatar for GPXtC02

Just wondering if i can re-read something i just read in? [code] if(in_stream.is_open()) while(i<50 && in_stream.getline(temp, 50) && temp>0) { if(isdigit(temp)) PX1>>temp; else length=strlen(temp); [COLOR="Red"]if(length>1) { string1[]=temp; in_stream.getline(temp, 50) if(isalpha(temp)) string2[]=temp; else } else PX2>>temp;[/COLOR] i++; } in_stream.close();[/code] Hope it doesn't come across as vague but if towards the end …

Member Avatar for GPXtC02
0
799
Member Avatar for Bastler

Below was my original problem now i have done the following. Which is really just the structure for what needs to happen. Where i have written after my // basically i dont know how to do that part any help would be great. Cheers [code] #include <cstdlib> #include <iostream> #include …

Member Avatar for ravenous
0
82
Member Avatar for paradox814

I am working with a function declaration of: int func1(char *, unsigned int) to the best of my understanding, I am not allowed to modify this. Now my question is that when I actually write this program what is the name of argument 1 and 2 for example [code]int intToHexStr(char …

Member Avatar for paradox814
0
125
Member Avatar for sauron84

Hello, I am a novice user of VC ++ and I have built an interface using MFC. I have created a form and now I have to link the form components (buttons, etc..) to my source code. For example, I need to know what to do so that when i …

Member Avatar for sauron84
0
153
Member Avatar for mathmagic

Hi all, Just wanted to know if i could change the font style in text mode. I'm using Turbo C++.

0
75
Member Avatar for Bastler

Ok i have to do the following *Just a console program * Have a program with three lists, List 1 = Adjectives, List 2 = Adjectives, List 3 = Nouns. * The user will say if they want to input a word into the list, delete a word from the …

Member Avatar for Lerner
0
79
Member Avatar for amitahlawat20

Could someone please tell me how to overload ++ operator in the postfix form. ++ sholud increment the instance variable avar of following class: class A { int avar; public: A() { avar=0; } A(int a) { avar=a; } void display() { cout<<endl<<avar; }

Member Avatar for Lerner
0
63
Member Avatar for d0ugg

Hi all, So I'm creating a program that will calculate the grade average of students in a class. I'm suppose to read a file into an array and I'm having problems with that. Here is part of my code. [CODE] //Output Func void StudentStat::Output() { for (int i = 0; …

Member Avatar for Lerner
0
147
Member Avatar for guitarrick

Hey out there. Lerner had given me some great ideas for searching (scouring) a string. Only problem I'm having now is I can't get past the error for 'cannot convert const to a std' I also don't think I can use this function like I am within my prgm (at …

Member Avatar for guitarrick
0
128
Member Avatar for Jennifer84

I am trying to resize a panel through a if-statement like this but am a bit unsure how the if-statement should look like. I am trying to put if size is (0, 694) for the panel1. [code] if ( panel1->Size() == System:: Drawing:: Size(0, 694) ) { this->panel1->Size = System:: …

Member Avatar for Jennifer84
0
102
Member Avatar for yarita

I'm having problems with displaying the total payment amount in the invoice when I enter courses and with the first step of entering 6 courses that i need to put if i want to try again or not. here is what it's suppose to look like... Please if anyone can …

Member Avatar for Lerner
0
159
Member Avatar for Cpp123

I just started using C++ and have a practice exercise, can anybody do this? It seems complicated. You have been requested by “Honest Dave’s Used Cars” to write a program to calculate the monthly car payment for their customers.. As much as possible you are to develop the code as …

Member Avatar for Cpp123
0
223
Member Avatar for Jennifer84

I have a little wondering what the third element "0" stands for in the accumulate function. [code] std::vector<double> vec(10); double sum = std::accumulate( vec.begin() + 1, vec.begin() + 5, 0); [/code]

Member Avatar for Jennifer84
0
190
Member Avatar for noob.cpp

Hi, I don't know if anyone can help but I'm trying to figure out this switch case problem for my read file function. This is just the read file portion. I'm reading in a text file (bottom), and at this point I'm trying to determine electoral votes based on who …

Member Avatar for mr.cool
0
200
Member Avatar for jeffige

[CODE]In relation to another post, I did enroll in the Game Institute. [URL="http://www.gameinstitute.com/"]http://www.gameinstitute.com/[/URL] Thanx for the input Thanx for the help "lAmoebal". It actually is helping more then when I was following along with other tutorials I have tried. Maybe it 's the structure. I still find C++ difficult. for …

Member Avatar for Ancient Dragon
0
117
Member Avatar for prayami

Hi, I got one, two dimensional array. MyArray[1000][2]. Both the array i.e. MyArray[0][0]........ MyArray[0][1]....... are filled with some values. Now I got he given values for both: e.g. value_0 = 4.056 and value_1 = -201.375. I have to search the arrayMyArray[0]...MyArray[999] and find the closest value row for the given …

Member Avatar for prayami
0
170
Member Avatar for arlene1

[QUOTE]Problem: write a function named powfun() that raises an integer number passed to it to a positive integer power and displays the result. The positive integer should be the second value passed to the function. Declare the variable used to store the result as a long integer data type to …

Member Avatar for Ancient Dragon
0
171
Member Avatar for Jennifer84

If I am serching this substring within a string. Is there any function that can search this just if the letters are correct, not if it is uppercase or lowercase. So it wouldn´t matter if the string looked like ex: Number[ number[ numBer[ etc... [code] string stringToFind = "Number["; [/code]

Member Avatar for Ancient Dragon
0
188
Member Avatar for arlene1

Please help, I do not understand the correlation between the function definition and the call in main. My program is receiving build errors- please assist with determining what the definition of this program should be. Thank you! [code=c++] #include <iostream> using namespace std; void yrCalc(int totalDays, int& year, int& month, …

Member Avatar for Ancient Dragon
0
104
Member Avatar for mamaChaos

Hello, everyone, This program is supposed to read roman numerals from a file and convert them to ints using functions. My functions work fine as standalone programs, but they aren't giving me the results I'm expecting. The weird results point to problem with my do/while loop. The goal is to …

Member Avatar for mamaChaos
0
94
Member Avatar for mathmagic

how to generate random numbers between a and b? is there any in-built function?

Member Avatar for BlackJavaBean
0
183
Member Avatar for shamin

k hi every1, im kinda new to C++, anyways..this is an assignment for my college. im supposed create a program that displays the username in a "creative" way. so first thing is do i use the get and ignore functions to get the initial if the user enters the whole …

Member Avatar for vijayan121
0
105
Member Avatar for hellokitty88

I am trying to do a sequential string, but when I run my program I recieve three errors:the first one talks about 'searchList' : cannot convert parameter 3 from 'const char [4]' to 'std::string [] ( I tried putting code tags by inserting my code between the [code] [/code], but …

Member Avatar for Ancient Dragon
0
114
Member Avatar for dkwantee

Hello! i have the following data in a file student_id student_name maths_score english_score physics_score can i use a nested structure to read the file? [CODE] struct student { int id; char name[40]; }; struct score { int maths; int english; int physics; }; [/CODE] if yes, how will i read …

Member Avatar for dkwantee
0
492
Member Avatar for Crazycfk

i am doing a decimal to binary conversion and i have figure out how to do the conversion i just don't know how to make it cout so that it is in reverse.... i was also told that it could done in a while loop here is the code [code] …

Member Avatar for VernonDozier
0
2K
Member Avatar for HIGHER LEARNING

Ive been trying to understand the below code for a while and need to know if it "acts like a record" for a single user. At the `end users[userdb]` is like an array for 6 struct user records? #define userdb 5 /* DataBase*/ struct user {char username[10]; char userid[9]; char …

Member Avatar for vijayan121
0
219
Member Avatar for flash2007

I need help in C++ .Class name Driller has three data member (int Code Private, int Quantity private and Name public) it has 3 function: 1. Depth, the drills drills is based on the following: code 2000 depth(m) 300, code 3000 depth 500 and code 4000 depth 1000. 2. Cost …

Member Avatar for flash2007
0
180

The End.