49,761 Topics
| |
#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; } | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
Hi all, Just wanted to know if i could change the font style in text mode. I'm using Turbo C++. | |
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 … | |
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; } | |
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; … | |
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 … | |
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:: … | |
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 … | |
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 … | |
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] | |
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 … | |
[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 … | |
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 … | |
[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 … | |
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] | |
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, … | |
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 … | |
how to generate random numbers between a and b? is there any in-built function? | |
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 … | |
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 … | |
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 … | |
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] … | |
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 … | |
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 … |
The End.