Generation

generate functionThu, 22 Jun 2023

Write a code that analyses every publicly traded stock and list them in order from the best short term gain to the worse

#include <iostream> #include <fstream> #include <string> #include <iomanip> #include <cmath> using namespace std; const int MAX_SYMBOL = 10; const int MAX_NAME = 10; const int MAX = 50; struct stock { string symbol; string name; string date; double open; double high; double low; double close; double previousClose; double change; double percentChange; }; void getStockData(ifstream &file, stock[]); void getStock(ifstream &file, stock &); void swapStock(stock &, stock &); void sortStock(stock [], int); void printStock(ofstream &file, stock [], int); int main() { ifstream in; ofstream out; stock stockArr[MAX]; int numOfStock; in.open("C:\\Users\\Dean\\Desktop\\CS\\CS

Want to kickstart your project?Use the new AI Studio to create your code