Question: IN C++, First, your program should have a file called mynumbers.txt which has 5 numbers from 1-100 (you create them). Your program should have 5

IN C++,

  • First, your program should have a file called "mynumbers.txt" which has 5 numbers from 1-100 (you create them).

    Your program should have 5 variables in the main to read the numbers from the file. Create 5 more int variables for another 5 random numbers (using the rand() function to generate numbers 1-100).

    Once the 10 variables have numbers in them, you will compare the first number from the file to the first number from the random function. You will compare the 2nd numbers of each the same way up until you have compared all the way to the 5th numbers.

    Your program is going to keep track of how many times the numbers from the file were bigger and how many times the numbers from the random function were bigger.

    Display the results.

    Calculate also how many odd and even numbers show up among the 10 variables.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!