I need some C++ help :'(?

tips on how to Write a new function known as nRandomNumbers( ) that
Generates D random integers concerning -250 along with 250 (inclusive) and saves them in a file known as number.txt, (Use the function srand()).
Prints all the generated integers.
Finds the common skin color negative integers, and the maximum skin color positive integers.
Returns the usual and greatest values.
After that, write your main system that
Prompts an individual to input the value of IN.
Message or calls the functionality nRandomNumbers( ).
Prints the common skin color negative integers, and the maximum skin color positive integers.

Piece of input/Output:

Enter internet of N:5
The 5 randomly integers tend to be:-112 -119 -233 197 -92
Usual of all negative integers is usually -139
Maximum of all positive integers is usually 197
Press any crucial to continue

include
#include
#include
#include
#include

void nRandomNumbers(int n)

int my spouse and i, num, maximum, tot, count number;
time_t to;
ofstream out(“number.txt”, ios::beg);
srand((unsigned) time(&t));

cout<<"\n The "<<n<<" hit-or-miss numbers tend to be ";
max=-300;
tot=count=0;
for(i=0; i<n; i++)

num=(rand()%501)-250;
cout<<num<<" ";
out<<num<<" ";
if(num<0)

tot+=num;
count++;

else if(num>max) max=num;

out there.close();
cout<<"\n Usual of all negative integers is usually "<<tot/count;
cout<<"\n Maximum of all positive integers is usually ";
if(max>=0) cout<<max;
else cout<<"(none)";

void main()

int n;
clrscr();
cout<<"\n\n Enter internet of N:";
cin>>n;

nRandomNumbers(n);
cout<<"\n Press any crucial to continue";
getch();

This will never a challenging program once you learn its concept
If you don’t know how to generate a new txt track and accomplish these calculation then you need to learn C++ again i am talking about You have not sufficient knowledge to make sch any program
Relating to studied minor C++ throughout school and allow me to do almost all work with the exception of.txt track generation that is not seems even hard in your case

What aspect exactly seeking help along with Writing performs Generating haphazard numbers Writing data that will files What

If you cannot do any of those things, then you may should as well as something less complicated, like publishing “Hello World” to the screen.

If not, you need to show what you might have so significantly, and just what part you simply can’t figure released.

Leave a Reply