-
Feb 3rd, 2013, 01:27 PM
#1
Thread Starter
Member
Text Files & Coding
Hi I need help with this task:
Create a user defined type of student information (name, age, contact number, gender). Create an array of your type to store 5 records (get user to populate this via the console). Then, write the contents to file in BINARY format.
So far I have a basic algorithm and a little bit of code which isn't even worth showing. Here's my algorithm. If anyone could help it would be brilliant!
OPEN File
SET Structure As Student
strStudentName
intStudentAge
intStudentContact
strStudent Gender
SET Array = arrStudent(4)
For i = 0 to 4
GET StudentName
GET StudentAge
GET StudentContact
GET StudentGender
WRITE to file
Next
Thanks a lot!
-
Feb 3rd, 2013, 11:12 PM
#2
Re: Text Files & Coding
Is this just pseudo code? Or, do you have something written so far? Sounds like a homework project, so i'm not just going to post you a solution. What do you need help with? You haven't asked a question so my first impression was that you just wanted someone else to write it for you unfortunately.
~Ace
<<<------------
.NET Programming (2012 - 2018)
®Crestron - DMC-T Certified Programmer | Software Developer <<<------------
-
Feb 4th, 2013, 12:25 AM
#3
Re: Text Files & Coding
Hi,
I agree with AceInfinity so I will only help you to fix your own posted code examples. That said, there are four main principals that you need to complete and design for your project to work. They are:-
1) Creating a custom class / structure. See here:-
http://msdn.microsoft.com/en-gb/library/ms973814.aspx
http://www.codeproject.com/Articles/...ures-in-VB-NET
2) Holding your information in an array. See here:-
http://msdn.microsoft.com/en-gb/libr...reatingAnArray
http://msdn.microsoft.com/en-gb/libr...v=vs.100).aspx
3) Using a loop to get the information you need. See here:-
http://msdn.microsoft.com/en-us/libr...v=vs.100).aspx
4) Saving your information in a Binary file. See here:-
http://msdn.microsoft.com/en-us/libr...code-snippet-1
Hope that helps.
Cheers,
Ian
-
Feb 4th, 2013, 02:47 AM
#4
Thread Starter
Member
Re: Text Files & Coding
Hi it's not a homework task, I'm practicing some solutions at the moment. I don't want the code, I just wanted to know how to go about doing it. My algorithm gives some kind of indication however I'm completely baffled when it comes to the code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|