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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started