can someone edit my c++ code where it will output to a file. I
am currently...
can someone edit my c++ code where it will output to a file. I
am currently using xcode.
#include <iostream>
#include <cctype>
#include <cstring>
#include <fstream>
using namespace std;
bool inputNum(int [],int&,istream&);
void multiply(int[],int,int[],int,int[],int&);
void print(int[],int,int,int);
int main()
{ifstream input;
int num1[35],num2[35],len1,len2,num3[60],len3=10,i;
input.open("multiplyV2.txt"); //open file
if(input.fail()) //is it ok?
{ cout<<"file did not open please check it\n";
system("pause");
return 1;
}
while(inputNum(num1,len1,input))
{inputNum(num2,len2,input);
multiply(num1,len1,num2,len2,num3,len3);
print(num1,len1,len3,1);
print(num2,len2,len3,2);
for(i=0;i<len3;i++)
cout<<"-";
cout<<endl;
print(num3,len3,len3,1);
//cout<<len1<<" "<<len2<<"
"<<len3<<endl;
cout<<endl;
}
system("pause");
}
void...
Using C programming
I have a file that contains earthquake data that I will copy and...
Using C programming
I have a file that contains earthquake data that I will copy and
paste below. I want to use either bubble or insertion sort to sort
the file by latitude in ascending order, then create a new file
containing the sorted data. I also want to do this program using
multiple threads concurrently in order to speed up the sorting
process.
example file to sort:
time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net
2020-10-17T17:22:03.840Z,32.877,-116.2991667,0.31,1.16,ml,21,119,0.07747,0.26,ci
2020-10-17T17:17:29.980Z,34.1611667,-116.452,2.75,0.87,ml,17,66,0.05224,0.22,ci
2020-10-17T17:03:54.460Z,33.5396667,-116.4613333,8.66,0.63,ml,18,126,0.06084,0.16,ci
2020-10-17T16:55:01.080Z,63.254,-151.5232,8,1.4,ml,,,,0.9,ak
Language:C++
HAS TO WORK IN VISUAL BASIC
I have errors on line 102 "expression must have...
Language:C++
HAS TO WORK IN VISUAL BASIC
I have errors on line 102 "expression must have a constant
value
line 107,108,123,124,127,128: array type int[n] not
assignable
#include<iostream>
#include <fstream>
using namespace std;
#define size 10000
// Displays the current Inventory Data
void Display(int box_nums[],int nboxes[],double ppBox[],int n) //
Prints Box number , number of boxes and price per box.
{
cout<<"Box number Number of boxes in stock Price per
box"<<"\n";
cout<<"-------------------------------------------------------------\n";
for(int i=0; i<n; i++)
{
cout<<box_nums[i]<<" "<<nboxes[i]<<"
"<<ppBox[i]<<"\n";
}...
I'm having a warning in my visual studio 2019, Can anyone please
solve this warning.
Severity ...
I'm having a warning in my visual studio 2019, Can anyone please
solve this warning.
Severity Code Description
Project File Line Suppression
State
Warning C6385 Reading invalid data from
'DynamicStack': the readable size is '(unsigned int)*28+4' bytes,
but '56' bytes may be read.
Here is the C++ code were I'm having the warning.
// Sstack.cpp
#include "SStack.h"
// Constructor
SStack::SStack(int cap) : Capacity(cap), used(0)
{
DynamicStack = new string[Capacity];
}
// Copy Constructor
SStack::SStack(const SStack& s) : Capacity(s.Capacity),
used(s.used)...
15.4 Zip code and population (class templates)
Complete the TODOs in StatePair.h and main.cpp.
StatePair.h
Define...
15.4 Zip code and population (class templates)
Complete the TODOs in StatePair.h and main.cpp.
StatePair.h
Define a class StatePair with two template types (T1 and T2),
and constructor, mutators, accessors, and PrintInfo() member
functions which will work correctly with main.cpp. Note, the three
vectors (shown below) have been pre-filled with StatePair data in
main() and do not require modification.
vector<StatePair <int, string>> zipCodeState: ZIP
code - state abbreviation pairs
vector<StatePair<string, string>> abbrevState:
state abbreviation - state name pairs
vector<StatePair<string, int>>...