A small business wants to create a file to store its customer information. Each record in the file is to

contain the following data: customer ID number, first name, last name, city, zip code, and account balance.
Write a program to create such a customer file named “customer.txt”. Write the file with space-separated
fields.
Write another program that displays the contents of the file “customer.txt” in column form with
appropriate column headings.

We do not do your homework for you. Although it might take more effort to do the work on your own, you will profit more from your effort. We will be happy to evaluate your work though.

Why did the small business go to a therapist? Because it couldn't handle the pressure of storing customer information!

But don't worry, I'm here to help you create the "customer.txt" file and display its contents in column form. Here's a code snippet in Python to get you started:

```python
# Creating the customer.txt file
customer_data = [
[1, "John", "Doe", "New York", "10001", 500],
[2, "Alice", "Smith", "Los Angeles", "90001", 1000],
[3, "Bob", "Johnson", "Chicago", "60601", -200]
]

with open("customer.txt", "w") as file:
for record in customer_data:
file.write(" ".join(map(str, record)) + "\n")

# Displaying contents of customer.txt in column form
with open("customer.txt", "r") as file:
print("{:<6} {:<10} {:<10} {:<15} {:<10} {:<6}".format(
"ID", "First Name", "Last Name", "City", "Zip Code", "Balance"
))
print("-" * 58)
for line in file:
record = line.strip().split()
print("{:<6} {:<10} {:<10} {:<15} {:<10} {:<6}".format(*record))
```

This code creates the "customer.txt" file using the provided customer data. Each record in the file is written as a line with space-separated fields.

Then, the program reads the file and displays its contents in column form with appropriate column headings, aligning the data properly. You can adjust the formatting by modifying the field widths and adding more columns as needed.

Now, you can have a good laugh as you manage your customer information!

To write a program to create a customer file named "customer.txt" with space-separated fields and another program to display the contents of the file in column form, follow these step-by-step instructions:

Program to create the customer file "customer.txt":

1. Open a new Python file and save it with a suitable name (e.g., "create_customer_file.py").

2. Import the necessary modules:

```python
import csv
```

3. Create a list of customer information records:

```python
customer_data = [
["12345", "John", "Doe", "New York City", "10001", "1000.50"],
["54321", "Jane", "Smith", "Los Angeles", "90001", "2500.75"],
["98765", "Mike", "Johnson", "Chicago", "60601", "500.25"]
]
```

4. Define the file name and fields:

```python
filename = "customer.txt"
fields = ["Customer ID", "First Name", "Last Name", "City", "Zip Code", "Account Balance"]
```

5. Open the file in write mode and write the customer data using the CSV module:

```python
with open(filename, "w", newline='') as file:
writer = csv.writer(file, delimiter=' ')
writer.writerow(fields)
writer.writerows(customer_data)
```

6. Save and run the program. The "customer.txt" file will be created with the specified customer information.

Program to display the contents of "customer.txt" in column form:

1. Open a new Python file and save it with a suitable name (e.g., "display_customer_file.py").

2. Import the necessary modules:

```python
import csv
```

3. Define the file name:

```python
filename = "customer.txt"
```

4. Open the file in read mode and read the customer data using the CSV module:

```python
with open(filename, "r") as file:
reader = csv.reader(file, delimiter=' ')
for row in reader:
print("{:<15} {:<15} {:<15} {:<15} {:<15} {:<15}".format(*row))
```

6. Save and run the program. The contents of the "customer.txt" file will be displayed in column form with appropriate column headings.

That's it! You've now created a customer file named "customer.txt" with space-separated fields and displayed its contents in column form.

To create a customer file named "customer.txt" with the required data and space-separated fields, you can use a programming language like Python. Here's an example of how you can write the first program:

```python
# Open the file in write mode
file = open("customer.txt", "w")

# Define a list of customers' information
customers = [
[1, "John", "Doe", "New York", "12345", 1000.50],
[2, "Jane", "Smith", "Los Angeles", "67890", 2500.75],
# Add more customer data here
]

# Write each customer's information to the file with space-separated fields
for customer in customers:
file.write(" ".join(str(field) for field in customer) + "\n")

# Close the file
file.close()
```

This program creates the "customer.txt" file with the specified data in space-separated fields.

Next, to display the contents of the "customer.txt" file in column form with appropriate column headings, you can use another program. Here's an example using Python:

```python
# Open the file in read mode
file = open("customer.txt", "r")

# Define column headings
column_names = ["Customer ID", "First Name", "Last Name", "City", "Zip Code", "Account Balance"]

# Print the column headings
print("\t".join(column_names))

# Read each line of the file and display the data in column form
for line in file:
customer_data = line.strip().split(" ")
print("\t".join(customer_data))

# Close the file
file.close()
```

This program reads each line from the "customer.txt" file, splits the data by spaces, and then prints it in column form with appropriate column headings.