1 Replies - 677 Views - Last Post: 28 September 2012 - 01:59 AM Rate Topic: -----

#1 Lynwood  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-September 12

using loops, conditionals, and file processing concepts

Posted 28 September 2012 - 01:36 AM

The Eversoft Eraser Company has a list of its customers' names ( not necessiarly in alphabetical order)and telephone numbers in a file named customers with records of the following form:
last name, first name, phone number
A. allow the user to input a last name: then search the file and display all names and phone numbers corresponding to that last name
B. load the file into parallel arrays and display the list of customers' names and phone numbers in alpahbetical order.

This is part of the code i have came up with so far and i can't seem to get it to work:
Declare Last Name as String
Declare First Name as String
Declare Phone Number as Integer
Open “LastName, FirstName,PhoneNumber” For Output As NewFile
Write “FirstName,LastName, and PhoneNumber”
Write “Enter 0 For All When Done”
Input LastName, FirstName, PhoneNumber
While Name !=”0”
Write NewFile, Name, Number
Write “Enter Name, Number.”
Write “Enter 0 For Both When Done.”
Input Name, Number
End While
Close NewFile

I cant seem to come up with the rest of the file and need some help with it

Is This A Good Question/Topic? 0
  • +

Replies To: using loops, conditionals, and file processing concepts

#2 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 407
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: using loops, conditionals, and file processing concepts

Posted 28 September 2012 - 01:59 AM

View PostLynwood, on 28 September 2012 - 02:06 PM, said:

The Eversoft Eraser Company has a list of its customers' names ( not necessiarly in alphabetical order)and telephone numbers in a file named customers with records of the following form:
last name, first name, phone number
A. allow the user to input a last name: then search the file and display all names and phone numbers corresponding to that last name
B. load the file into parallel arrays and display the list of customers' names and phone numbers in alpahbetical order.

This is part of the code i have came up with so far and i can't seem to get it to work:
Declare Last Name as String
Declare First Name as String
Declare Phone Number as Integer
Open “LastName, FirstName,PhoneNumber” For Output As NewFile
Write “FirstName,LastName, and PhoneNumber”
Write “Enter 0 For All When Done”
Input LastName, FirstName, PhoneNumber
While Name !=”0”
Write NewFile, Name, Number
Write “Enter Name, Number.”
Write “Enter 0 For Both When Done.”
Input Name, Number
End While
Close NewFile

I cant seem to come up with the rest of the file and need some help with it


If you can tell us what language this is, we may be in a better position to help you.

regards,
Raghav
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1