Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions