- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
I am a junior c++ developer
- PC Specs
- C++, QT
7 Posted Topics
Re: #include <iostream> #include <string> class Ice { public: void hit(int playerLoco, int iceStrenth, int loco1, int loco2, int loco3); int strenth; class Loco { public: int location; bool hit; }; }; void Ice::hit(int playerLoco, int iceStrenth, int loco1, int loco2, int loco3) { if(playerLoco == loco1 || playerLoco == loco2 … | |
Re: [CODE]#include <fstream> #include <iostream> #include <cstdlib> using namespace std; int main() { char name[100]; int age; char choice[100]; cout<<"Name :"; cin>>name; cout<<"Age :"; cin>>age; cout<<name<<"\t"<<age<<" : Should I Save This ? \n (Y/N)"<<endl; cin>>choice[0]; if(choice[0] == 'y') { cout<<"OK"<<endl; ofstream info; info.open ("info.txt"); info<<name<<age<<endl; info.close(); } else if(choice[0] == 'n') … | |
Re: #include <iostream> #include <iomanip> using namespace std; // Function prototype char grade[10]; double score[10]; double resultNum = 0; int i = 1; // for visual appeal int total_times =1; double avg = 0; double sum = 0; double high = 0; double low = 100; double jjj; double calc_average(double sum, … | |
Re: #include <iostream> #include <fstream> using namespace std; int main() { ifstream inputfile; int number, sum = 0, average, c = 0,rt=0; inputfile.open("ListOfNumbers.txt"); while(inputfile >> number) { cout <<number<<endl; rt=rt+number; c++; } cout << "Number of numbers is " << c << endl; cout << "total is " << rt << … | |
Re: [CODE]#include <iostream> #include <string> using namespace std; struct sample { string name; double num[4]; unsigned elements; }; int main () { sample x = {"Dude", {1., 2., 3., -5.}, 4}; }[/CODE] | |
Re: # include <iostream> using namespace std; void main () { int x=0, y=1, b, n=0,ter; cout<<"Enter The number of terms: "; cin>>ter; cout<<x<<" "<<y<<" "; while (n<ter-1) { b=x+y; cout<<b<<" "; x=y; y=b; n++; } cout<<endl; system("pause"); } | |
Re: #include <iostream> using std::cout; using std::endl; using std::cin; #include <cmath> #include<iomanip> using std::setw; bool prime(int n); int main() { int count = 0; cout << "The prime numbers from 2 to 10000 are:\n"; for (int x =2; x <= 10000; ++x ) if (prime(x)) { ++count; cout << setw( 6 … |
The End.