This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//update: | |
/// this is just some exercise code in the book i study so i thought it could be useful to some people about the methods in the code | |
/// changes: | |
/// added: | |
/// class operator function Date operator(Date&) - with this you can now assign a date object to another date object | |
/// class JulianDate: methods ->> object.jdatedisplay() - displays the julian date | |
//// ->> object.Date(); - converts and diplays the julian date to gregorian date | |
/// ->> overloaded constructor -> JulianDate(int month, int day, int year); expects to have the values | |
//// and converts to julian date | |
/// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// this is just some code snippets i do in some exercise in the book i'vs studied i thought it could be useful to some people | |
/// about this class | |
/// object.CoordDisplay(); - displays the converted values | |
/// object.conToCartesian(); - converts the following argument values into cartesian values | |
/// you can edit this code if you want | |
//// declare a class Coord before using one of the class methods.. | |
#include <iostream> | |
#include <cmath> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// just a small exercise program in c++ book that i study so if anyone encounters the same problem this | |
/// this program i created will do its job according to the problem | |
/// expect that when to input a invalid number the program will have infinite loop | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Employee |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// a food type info storing exercise written in c++ | |
/// if some peole encounter a exercise problem like this it may be helpful | |
/// this program will do its job properly according to the problem given | |
#include <iostream> | |
#include <string> | |
#include <algorithm> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///simple data structure program --> a simple exercise program from the book i've been study it might help to some people :D | |
//// for class Studentrecord --> methods | |
/// object.display(); - displays the values in the object :: expects no argument | |
/// object.setIdnum(int); - sets the id number :: expects a integer value argument | |
/// object.setCredits(double); - sets the credits value :: expects a double or integer value argument | |
/// object.setGradeave(double); - sets the average grade :: expects a double or interger value argument | |
//// for class Studentinfo --> methods | |
/// object.display(); - displays the values in the object :: expects no argument | |
/// object.setStudentname(string); - sets the name of the student :: expects a string argument | |
/// object.setDate(int, int, int); - sets a date :: expects a three integer argument |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
using namespace std; | |
bool chck_email(string); | |
int main() | |
{ | |
string str; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
int main() | |
{ | |
vector<int> comp = {1 , 3, 2, 1, 2, 3, 1, 1, 2, 3}; | |
vector<string> attacks = { "rocks", "paper", "scissors" }; | |
string decided_atk = "none", user_decided_atk = "none", results = "none"; | |
int user_input = 0, rounds = 0, counter = 0, user_points = 0, ai_points = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
#include <numeric> | |
using namespace std; | |
int main() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
int num1 = 1, num2 = 1, max_num = 0, sum = 0, counter = 0; | |
cout << "enter a number of values to generate a fibonacci numbers: "; | |
cin >> max_num; | |
cout << num1 << endl | |
<< num2 << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
int curr_num = 0; | |
for(int n = 50; n <= 100; n++) { | |
if(curr_num == 0) { | |
curr_num = n; | |
} |
OlderNewer