1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivan
4 years ago
13

Write a fragment of code that opens a file named numbers.txt, reads in pairs of number until end of file and sends the smaller o

f the two to a file named min.txt and the larger of the two to a file named max.txt (one number per line). You can assume there are no ties. (basic file input/output)
Computers and Technology
1 answer:
jok3333 [9.3K]4 years ago
8 0

Answer:

See explaination for code

Explanation:

int x, y;

ifstream numbers;

numbers.open ("numbers.txt");

ofstream min;

min.open ("min.txt");

ofstream max;

max.open ("max.txt");

while(numbers>>x>>y )

{

if(x>y)

{

max<<x<<endl;

min<<y<<endl;

}

else

{

max<<y<<endl;

min<<x<<endl;

}

}

numbers.close;

min.close;

max.close;

You might be interested in
1 pts Question 5 Which of the following calculations would evaluate to 12? (36) + 2/2, 3* ((6+2)/2), 3* 6+2/2, (306+ 2)/2​
julia-pushkina [17]

Answer:

Could you seperate them if they are different answers? I'm lost, sorry!

Explanation:

5 0
3 years ago
An IT code of conduct is a written guideline that helps determine whether a specific computer action is which of the following?
nadezda [96]
The answer to the question above is the last option: ETHICAL. The IT code of conduct, which is a written guideline, helps in determining whether a specific action is acceptable or ETHICAL. Basically, the IT code of conduct's purpose here is to maintain that the actions being done to the accepted and proper practices.
8 0
4 years ago
Which letter would appear in the third position of the standard wheel marking of a hard-grade wheel?
torisob [31]
B is the correct answer you are looking for 

6 0
4 years ago
Read 2 more answers
Why are computers assigned IP addresses?
ladessa [460]

Answer:An Internet Protocol address (IP address) is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.

6 0
3 years ago
Help please this is my last assignment of the year
krek1111 [17]

Answer:

the answer is in the website that are there

5 0
3 years ago
Other questions:
  • Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 percen
    13·2 answers
  • 30 POINTS!!
    15·2 answers
  • Addison, Inc. uses a perpetual inventory system. Below is information about one inventory item for the month of September. Use t
    15·1 answer
  • A certain computer game is played between a human player and a computer-controlled player. Every time the computer-controlled pl
    8·1 answer
  • One modeling technique drawn from systems analysis and design that can provide an excellent way to illustrate how a business fun
    13·1 answer
  • What does a coder do on a daily basis?
    8·1 answer
  • CAN YOU PLEASE HELP WITH THIS DUE IN 10 MINUTES
    8·1 answer
  • FREE BRAINLIEST!!!!
    7·2 answers
  • you need a storage device that has very large storage capacity, is fast, and is relatively inexpensive. which storage device wil
    10·1 answer
  • The area of ai that investigates methods of facilitating communication between computers and people is?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!