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

  Checking account at the first national bank

Susan Williams opened a checking account at the First National Bank. She made an initial deposit of $1,800, signed a signature card that indicated

  Swot analysis for nike company

Create a SWOT analysis for the company (NIKE) you chose to research. Your analysis should be between one to two pages and identify the company's strengths, weaknesses, opportunities, and threats.

  Create a prototype using pop by marvel

Using the sketches created in our in-class activity, create a prototype using POP by Marvel (iOS).

  Choosing alpha

Write a description of a situation where you might want lower p-values for significance and explain why. Then explain how p-values that are 0.05, 0.049, and 0.051.

  Is there a stated policy with definite principles

Is there a stated policy with definite principles for writing off obsolete or slow-moving goods

  Organizational decision making

What are the primary communication tools that accountants use in an organization to communicate with their counterparts in other parts of the organization and assess whether they are the most efficient?

  Explain the flow of information in company

Explain the flow of information in your company. In your journal, explain the following:Functions of Y hierarchy of managerial communications. Does it apply to organization's communication hierarchy?

  Write a paper on walmart

Start assembling your Paper. Your paper should follow this format - . Cover Page and Introduction

  Create a tabular recommendation with textual explanation

Critically evaluate theories and concepts of strategic management. Analyse and apply appropriate problem solving techniques plus knowledge learned to solving

  What are typical u.s. business communication protocols

What are some typical U.S. business communication protocols and How would these protocols create challenges, for example, in communicating with someone

  What are the benefits of being a member of the wto

Dispute settlement is the focus of the World Trade Organization (WTO) and the way that the organization keeps the global economy stable. What is the WTO, and what is its history? What are the benefits of being a member of the WTO?

  Think of an externality in your community

?Think of an externality in your community. Explain what type of externality it is. How can it be resolved (through the market and/or through government policie

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