Found 9 repositories(showing 9)
Mustafa-Hassan2001
No description available
AnuarGH
1.) The aim of the project: Comparing the true errors of different classifiers. 2.) How it is done: We were given source files that were written by professor Amin Zollanvari, and we should remove all redundant codes, and add new codes of different classifiers. I, Zhumazhenis Dairabay, have coded all classifiers during this group project as my part was coding and math. 3.) Project was done for LEVEL 4, and we got 114. See FinalProject/ProjectDescription_updated.pdf (Level 1 can get at most 70 out of 100, Level 2 can get at most 95 out of 100, Level 3 can get at most 105 out of 100, Level 4 can get at most 115 out of 100). 4.) Language that is used in project: C++ 5.) What topics included: Loops, Arrays, Functions, Struct, working with files (reading and writing .txt files) 6.) Difficulties I have faced during coding: In the project, determinant of the matrix should be evaluated. At the beginning I used recursion to code the determinant and it worked nice for small dimension matrices(e.g. 5x5, 6x6). But, it did not work for larger dimension matrices(e.g. 20x20, 50x50). After some brainstorming, I have found out that recursion does too much operations and it leads non-responding of the computer (computer freezes and does not repond even the click of the mouse). Then, I found out that, Cholesky decomposition can be used for evaluating the determinant of the matrix. Then I used it, after that, determinant of high dimension matrix is evaluated. See classifiers.cpp and matrixOperations.cpp source file. 7.) The source files I have worked with: calculateErrors.cpp, classifiers.cpp, main.cpp, calculateErrors.h, classifiers.h. 8.) Project is too big and there are some parts of source files that I do not understand. But, for this project it does not need to understand all parts of source files. 9.) The project also concerns math as we need to deal with probability and matrices. 10.) BENG 146 Programming for engineers course: It covers C++ and Java. See BENG146_course_specification.pdf file. 11.) My achievements: International Zhautykov Math Olympiad - bronze (individual), Asian-Pacific Math Olympiad - bronze (individual), Silk-Road International Math Olympiad - bronze (individual), Republican Math Olympiad - bronze (individual), NU Math Battle - 3rd place (team) 12.) How this project helps me for participating nFactorial Incubator: I got acquainted with basic theories about machine learning (classifiers). I understood how classifiers work. For developing my application, I need to learn TensorFlow which is an open source library. In addition, I started to learn developing android apps from thenewboston android developing for beginner (youtube) and I have some practices with .xml files (layout), activities (java, android library). 13.) How to compile and run project: a.) Compile project using command line (Windows+R, cmd.exe). Open the src folder in command line using cd and dir. Then compile the project using mingw32-make. (firstly, change PATH to C:\Program Files (x86)\CodeBlocks\MinGW\bin). Command lines shows some errors, but do not look at them. b.) Then enter to bin folder using cd and dir. Copy and paste from commands.txt file (project.exe will run). After you have runned, there will occur new .txt files in ChenLiver2004_10237x157 or other folders depending on the command. 14.) Developing machine learning related applications. Furhter research in machine learning during my study at university.
smiky0403
Leetcode practices - Explore cards rename each file to main.cpp to compile and practice
PerretDavid
Participation to https://github.com/cpp-best-practices/game_jam/blob/main/README.md
SuvrojyotiDey
This is a repo for all the practice files done in cpp. Requirements Mingw and vs code. Main branch : dev-cpp
lanalukacevic
Practice breaking down a program into multiple files (header files, implementation cpp files, and the main files) which verify the credentials of a user for your system.
AbdalsalamShamsAlldeen
# 🧮 Math Game A simple math quiz game built with C++ to practice arithmetic skills. ## ✨ Features - Addition, subtraction, multiplication, and division problems. - Score tracking. - Timer-based challenges (if applicable). ## 🚀 How to Run `bash g++ main.cpp -o math_game ./math_game
KlimentPaskalev27
The JUCE DJ app is an audio playback and audio control program that is written in C++ and is based on the JUCE Framework. The application’s main features are importing audio files from the user’s PC into the app’s playlist component. From there, the user can load two audio files into two separate DJ decks and play the audio simultaneously. Mixing of the audio can be done by different sliders and coordinate axis plots which control and amend the sound output from the audio files. The program follows the SOC best-practice and separates its components into different .cpp and .h files.
aryanarora9638
In this lab, you are going to create a C++ dynamic array class that inserts values and sums those values. This lab will guide you through the process of creating the class. The first parts of the implementation will be given to you. A dynamic array is an array that grows as necessary. In practice, this entails creating a new array when the old array is full and copying the existing values into that new array. Writing a C++ Class .h and .cpp Files C++ classes are made up of a header file and an implementation file. Both files should have the same name except that the header file has a .h extension while the implementation has a .cpp extension. The header file contains the class interface, and the .cpp file contains the implementation. The header file consists of the class name, and the name (and type) of the member variables and the header for each of the methods. The .cpp file consists of the definition for each of the class methods. Public or Private? Class member variables and methods should be specified as being either private or public. Private variables or methods can only be accessed from within the class, whereas public variables and methods can be accessed from outside the class. There are a couple of good general design principles to follow when deciding whether or not to make a method or variable public: · Only make something public if it needs to be public; note that not all methods need to be public, many classes have private helper methods that never have to be accessed directly from outside the class. · Make all member variables private, if necessary write public getter and setter methods for the variables. This allows you to write the setter methods to ensure that any class invariants are maintained (e.g. such as ensuring that an array size is a positive number). There are exceptions to this principle but you won’t encounter any in this example. Constructors and Destructors Every class requires at least one constructor that creates new objects of that class. A class will often have multiple constructors that build new objects in slightly different ways. A constructor is a method that has exactly the same name as the class and has no return type; it is responsible for setting the initial values of the member variables of an object. C++ classes also require destructors. A destructor is responsible for de-allocating any dynamic memory that an object uses. If you don't write a destructor for a class a default one is created for you. This class will allocate dynamic memory for the array so will require a destructor. Class Description The class creates an array in dynamic memory which increases in size as necessary. The class will have the following public methods § default constructor – allocates space in dynamic memory for an integer array of size 2 § destructor – deallocates dynamic memory associated with the array § insert(int) – sets the value of the next free element of the array to the parameter § sum() – returns the sum of the values in the array § size – returns the number of values currently stored in the array The class should also have the following private attributes § a pointer to an int (that will refer to the array) § an integer that records the actual size of the array § an integer that records the number of values stored in the array Header File The header (ArrayClass.h) file should contain the class definition, which should be separated into public and private sections. Here is the entire class definition. #pragma once class ArrayClass { public: // Constructors and Destructors // Default constructor // POST: Creates an ArrayClass object with an array of size 2 // PARAM: ArrayClass(); // Destructor // POST: De-allocates dynamic memory associated with object ~ArrayClass(); // Accessors (getters) and mutators (setters) // Sets the value of the next free element // PRE: // POST: Sets index n to value, doubles size of arr if n == arrSize, increments n // PARAM: value = value to be set void insert(int value); // Returns the sum of the values stored in the array // PRE: // POST: Returns sum of the first n elements of arr int sum(); // Returns the number of elements stored in the array // PRE: // POST: Returns n int size(); private: int* arr; int arrSize; int n; }; The header should also include any files whose contents are referenced in the header (none in this case). Notes § PRE stands for pre-condition - something that must be true for the method to function correctly; POST stands for post-condition – the state of the program after the method has run; PARAM stands for parameter § All the methods are public because they might be used (called) by modules or functions outside the class, for example a function might want to know the size or sum of an ArrayClass object § All the attributes are private so that their values can be protected from inappropriate changes by non-class functions, for example changing the currentSize of the array without actually adding a new value to the array Starting the Implementation File The implementation file (ArrayClass.cpp) should contain the definitions (i.e. implementations) of each of the class methods. The connection between the class definition in the .h file and the method definition in the .cpp file is the result of two things – neither of which are that the files were both created by an IDE or that they have the same name! The .cpp file should include the header file and each method should be given its fully qualified name, which includes the name of the class. Both of these are illustrated below. Constructor, Destructor and Size Methods Here is the first part of the .cpp file which contains the default constructor and the destructor #include "ArrayClass.h" // Default constructor // POST: Creates an ArrayClass object with an array of size 2 // PARAM: ArrayClass::ArrayClass() { arrSize = 2; arr = new int[arrSize]; n = 0; } // Destructor // POST: De-allocates dynamic memory associated with object ArrayClass::~ArrayClass() { delete[] arr;; } // Returns the number of elements stored in the array // PRE: Creates an ArrayClass object with an array of size 2 // POST: Retruns n int ArrayClass::size() { return n; } Notes § A constructor initializes the attributes of an object, for this class this entails setting the size of the array, creating the array in dynamic memory and setting the number of elements currently stored in the array to zero. § The variables arrSize and n are attributes of an ArrayClass object, and are not variables declared in the constructor; changing the first line to int arrSize = 2 would mean that arrSize was a local variable belonging to the constructor and the object’s arrSize attribute would remain un-initialized – which would be problematic § Constructors have the same name as the name of the class and unlike other methods (and functions) do not have a return type. § Each method must be preceded by the name of the class and the scope resolution operator (::). This informs the compile that the function definitions are the implementations of the ArrayClass methods. § The destructor is responsible for de-allocating any dynamic memory that has been allocated for an object. The name of the destructor is always the name of the class preceded by a tilde (~), like constructors, destructors do not have return types. Destructors should never (or at least very rarely) be called explicitly. They are invoked either explicitly by a call to delete or automatically when an object’s lifetime has expired. § The delete command deletes any dynamic memory associated with a pointer; in this case it must be followed by []s since arr points to an array. Implementing Insert The insert method should set the value of the next free element to its parameter and increase the size of the array as necessary. The steps of this method are set out below in comments. // Sets the value of the next free element // PRE: // POST: Sets index n to value, doubles size of arr if n == arrSize, increments n // PARAM: value = value to be set void ArrayClass::insert(int value) { // Check to see if array is full – if( … // Double arrSize // Assign arr to temp // Assign new array of arrSize to arr // Copy values from temp // Deallocate memory assigned to temp // end if // Insert new value at index n and increment n } Complete the method. Testing Insert Copy and paste the code shown below into a second .cpp file (i.e. this should be a separate file from your ArrayClass .cpp). This is a brief test of the class constructor and insert method. In practice, each method should be rigorously tested as it is implemented before moving on to the next. This is particularly important when one method relies on another. For example, I would suggest never starting to implement a method that removes items from a data structure before you are absolutely certain that your insertion method works perfectly. #include <iostream> // for cout #include "ArrayClass.h" using namespace std; // Function Prototype void arrayClassTest(); // Main function that is called when the program is executed int main(){ arrayClassTest(); return 0; } void arrayClassTest(){ ArrayClass ac; ac.insert(1); ac.insert(2); cout << "ac.size() = "<< ac.size() << endl; // Insert the values 1 to 7 in ac1 for(int i=3; i <= 40; ++i){ ac.insert(i); } cout << "ac.size() = "<< ac.size() << endl; } Implement Sum Given time, implement and test the sum method.
All 9 repositories loaded