Build an array of customer structures

Assignment Help Basic Computer Science
Reference no: EM132154057

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 input file has the following [email protected] 18 Jennifer [email protected] 38 Fajr Sanya 

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: EM132154057

Questions Cloud

Did the program change your view of social media : Your assignment is to watch the PBS documentary "Generation Like" and reflect on it. Please watch carefully because you will respond to w hat you see.
If the gradient of a loss function equals zero : If the gradient of a loss function equals zero, how would stochastic gradient behave? And what does this mean about the relationship between the data
Where does facebook find its power as online marketer : Where does Facebook find its power as an online marketer? Many analysts view Facebook as a major model for direct marketing in the digital age.
How you can establish common ground with another perspective : Now that you've completed a reasonable amount of research, it's time to analyze the opposition. To allow for a certain amount of flexibility concerning.
Build an array of customer structures : Build an array of customer structures. Assume that there are no more than 200 loyal customers.
Determine the small-signal voltage gain and current gain : For the transistor in figure, Determine the small-signal voltage gain and current gain. Determine the dc voltage at the base and emitter terminals
How artistic choice can affect viewer in the selected style : Description of what the movements of both styles communicate to you in terms of mood. Description of how artistic choice can affect the viewer in the selected.
Availability and speed of internet connections : The availability and speed of Internet connections play a major role in the success of a GIS.
What is PRs role in building customer satisfaction : Which are the difference between public relations and branding, and how they work together. What is PR's role in building customer satisfaction?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Class attribute of the entity class

In UML style E-R diagrams, which of the following would be considered a class attribute of the entity class CUSTOMER?

  Account at the end of the day on her 9th birthday

If the account pays 9.5% interest, compounded annually, how much is in the account at the end of the day on her 9th birthday?

  Explaining basic forensic procedures

Write a 1-page summary explaining basic forensic procedures and how they can be applied to your future IT career.

  What are the agents in your model

How would you simulate the different policy choices, namely, the allocation of funds to minimize commuter time? What measures would you collect to answer the council ' s question?

  Domain registration information and dns records

Research one of these domains: microsoft.com, cnn.com, icann.org, wikipedia.org, google.com. Your goal is to find out publicly available information about each domain including domain registration information and DNS records.

  Download free network monitoring tools

Hundreds of network monitoring tools exist. You can purchase or download free network monitoring tools developed by software companies.

  Explain why we assume that both countries

In the Hecksher-Ohlin (H-O) model, explain why we assume that both countries have the same technology and same consumption preferences (tastes).

  Jesus christ himself being the chief cornerstone

Ephesians 2:20-21 states "Jesus Christ himself being the chief cornerstone, in whom the whole building, being fitted together, grows into a holy temple.

  What would the total recruiting cost

The goal of this additional investment is to improve the quality of applicants. What would the total recruiting cost be for Chester next year?

  Steering committees brings to organizations

What do you think what value IT Steering Committees brings to organizations?

  Environmental factors relevant to organizations

Conduct an analysis of your chosen domain during your chosen time period. If you have selected leaders from different time periods, you will need to compare and contrast the domain analyses between or among the time periods. Your analysis should c..

  How many flush hands are possible

If there are 13 cards in each of four suits in a deck used in the game and there are 5 cards in a hand, how many flush hands are possible?

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