473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to read list of elements in seperate files like in this program

1 New Member
Write an interactive program that reads three (3) lists of numbers, which are stored in three separate files, and creates one (1) sorted list. Each file should contain not more than 15 numbers. First, you need to create a program that randomly chooses a size (<= 15 numbers) for the list1 and then randomly generates a list of numbers and store them in the file1. Repeat this procedure to select the other two lists (list2 and list3) and stores them in the corresponding files (file2 and file3) for sorting and merging them into one.

file1(list 1) 32 12 5 990 1
file2 (list 2) 2000 3
file3 (list 3) 30 6
Output in a separate file:
1 3 5 6 12 30 32 990 2000
Mar 2 '07 #1
1 1530
DeMan
1,806 Top Contributor
Unfortunately it's not as easy as posting the problem and getting an instant solution.....

However....

Have you thought about how to approach this problem...
what's the first thing the program needs to do?
If you can split the problem into more manageable pieces, you might find you discover a solution for yourself.
If not, try to explain exactly what it is that is making this problem difficult for you, and we can try to point you toward a solution.
Do you know much about file operations, or is this what is making the task difficult?
Mar 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4830
by: newtothis | last post by:
Being new to the use of C++ I have written a linked list program. It seems to crash after I delete from the list and then add a new node. Also this is not college homework, I have also looked at various postings here on the topic. They do not seem to help.
10
3041
by: Jason | last post by:
Hi, I have a few million data items being received by my program and I wish to store them in a list, with each item being inserted in any position in the list. Any performance tips so that my program runs ok? I have checked out the STL and have thought of using vector, set, list, deque and map. I dont know how these things are...
2
8297
by: Raghu Gupta | last post by:
Hi, Actually i am facing some problem using quickbooks and presently i am not so expert in using it. I am using c# code to retrive the data from quickbooks. it doesn't matter which language we are using. So i have .iif file of employee list,so through code i have to read .iif file and get the data out of it and store that data in database....
8
1869
by: kepioo | last post by:
I currently have an xml input file containing lots of data. My objectiv is to write a script that reports in another xml file only the data I am interested in. Doing this is really easy using SAX. The input file is continuously updated. However, the other xml file should be updated only on request. Everytime we run the script, we track...
6
1967
by: citlaly | last post by:
Hi!! I'm a beginner in python and I'm trying to use the files from a "folder" as a list. What I want to do is read each one as a list, but just the name of the file, the data inside doesn't matter. How can I do it? I was trying using a list, but I don't know how "convert" the elements (files) to a list that I can read and manipulate... ...
6
5307
by: Fazana | last post by:
I was doing one of the question but my program was not working properly. Can anyone help me with it pliz........ Here is the question for the program Question. Part 1. Add the function splitAt to split a linked list at a node whose Data is given. Suppose you have a list with the elements
10
6555
by: AZRebelCowgirl73 | last post by:
This is what I have so far: My program! import java.util.*; import java.lang.*; import java.io.*; import ch06.lists.*; public class UIandDB {
8
718
by: dmp | last post by:
What are Linked list? Please somebody show some ready made programs of linked list
36
2870
by: pereges | last post by:
Hi, I am wondering which of the two data structures (link list or array) would be better in my situation. I have to create a list of rays for my ray tracing program. the data structure of ray looks like this: typedef struct { vector origin; /* vector is an array of 3 doubles */
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.