Define a structure customer to store the email address

Assignment Help Business Management
Reference no: EM132151837

****C PROGRAMMING****

A local beauty store manager would like to host a VIP beauty event for their top 10 loyal customers. They have gathered some data about their loyal customers including email address, number of items purchased, and first name and last name. Need help in writing a program that read in data from a file, sort the customers by the number of items purchased, and write the top 10 (by the number of items) customers to the output file.

The list of top 10 customers should be written to the same file name as the input file name with "top10_" added at the beginning. For example, if the original file name is customers.txt, the output file name is then top10_customers.txt.

1. Read the data using fscanf function. To read the name (last item in a line), use "%[^n]n" as the conversion specifier for fscanf function.

2. Define a structure customer to store the email address (string), num_items (integer), and name (string). Assume the email address and name are no more than 100 characters.

3. Build an array of customer structures. Assume that there are no more than 200 loyal customers.

4. Modify the selection_sort function provided to sort an array of customers by the number of items purchased. The function's first parameter should be modified to struct customer list[].

5. The output file should include the list of top 10 customers in the same format as the input file but in sorted order by number of items purchased.

Reference no: EM132151837

Questions Cloud

Sign-and-magnitude representation of integers : A two-byte memory space is used for a sign-and-magnitude representation of integers with BCD, and the sign is stored in MSB.
How awareness of learning styles has influenced perceptions : Compare your current preferred learning strategies to the identified strategies for your preferred learning style. Examine how awareness of learning styles.
Explain key features of best practice in financial planning : EFN421 - Financial Planning and Strategies Assignment - Describe and explain what would be the key features of Best Practice in Financial Planning
Contrast signature based versus anomaly detection firewalls : Compare and contrast signature based versus anomaly detection firewalls.
Define a structure customer to store the email address : Define a structure customer to store the email address (string), num_items (integer), and name (string). Assume the email address and name are no more than 100
What is that information interesting and useful to you : In 2017, there had been catastrophic event that happened such as the 7.1 Earthquake in Mexico 2018 and multiple Category 5 Hurricanes by Florida and Puerto.
Major role in the success of a gis : Lists the 10 countries with the fastest Internet connections. Is the United Sates among the top 10?
Discuss the route of transmission of the selected disease : Discuss the route of transmission of the selected disease. Discuss how an outbreak of the selected disease would impact your community at a systems level.
Identifies two companies that use mobile analytics : Identifies two companies that use mobile analytics. How has mobile analytics helped these companies achieve their sales goals?

Reviews

Write a Review

Business Management Questions & Answers

  What are the implications of that decision

Whether they have or have not, what are the implications of that decision?

  Discuss martinettis approach to market the acquisition

You have been selected to meet with the Sand Coast Resort leadership team to discuss Martinetti's approach to market the acquisition in both countries.

  Envisioned dissertation topic

Given the two methods below, develop a hypothetical design plan for each method based on your envisioned dissertation topic:

  Develop a communication control and monitoring process

Can somone tell me how to develop a Communication Control and Monitoring Process for a project plan.

  Illustrate what is the difference among right to know

Illustrate what is the difference among "right to know" and "right to refuse"? Illustrate what is the main argument for denying workers the right to refuse hazardous work?

  Personal experience concerning an ethical dilemma

Post to the discussion forum from your personal experience concerning an ethical dilemma that a business professional may have faced.

  How should the given amount be allocated to dianne

At the end of the first year, net profits totaled $11,000 before any moneys had been distributed to partners. How should the $11,000 be allocated to Dianne, Greg, Knox, and Laura? Explain.

  What could danone have done to avoid the problems

What could Danone have done to avoid the problems it encountered in China and India? Why did each choose to participate in the JV?

  Five basic mechanisms for establishing exchange rates

What are the five basic mechanisms for establishing exchange rates?-  How does each work? - What costs and benefits are associated with each mechanism?

  Discuss the various problems of collaborative arrangements

Discuss the various problems of collaborative arrangements that might be occurring. Be sure to explain the impact of each problem that you use.

  Explain the strategy that led to the merger or acquisition

Explain the strategy that led to the merger or acquisition to determine whether or not this merger or acquisition was a wise choice. Justify your opinion.

  What is validate scope and why is it important to project

What is "validate scope" and why is it important to the project?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd