Read the data using fscanf function

Assignment Help Basic Computer Science
Reference no: EM132153077

****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: EM132153077

Questions Cloud

What packaging methods would you use? why : As an example, the text highlights Wilmington, Delaware as a major port of bananas and tropical fruits and their associated challenges.
How many are positive : let the user input 100 numbers and print how many are positive, negative, or 0. using loops
What are the concerns for regulating icos : Identify and discuss an industry that will be affected positively by the transition and one that will be affected negatively.
What are the three layers of tissue that form the heart : The smooth layer of cells that lines the inside of the heart & is continuous with the inside of blood vessels?
Read the data using fscanf function : 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.
Calculate the cash budget using the cash budget worksheet : Calculate the cash budget using the Cash Budget Worksheet, and use the Cash Budget Worksheet Answers to review your work.
Research a fortune 500 company stock : Research a Fortune 500 company stock using the popular online research tool Yahoo Finance.
Connections play a major role in the success of a gis : The availability and speed of Internet connections play a major role in the success of a GIS. Lists the 10 countries with the fastest Internet connections.
Design responsive web page : Create a visual prototype of the user interface to develop an overall presentation concept. The prototype should represent an aesthetically pleasing web page

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Specific role an information system

What is a specific role an information system can play in an organization? What are three components of this system? How do they work in the enterprise?

  Options the company could have taken

Discuss what malware is and find examples (at least 2) of how a business was adversely affected by malware.

  Contrast data flow diagram

Compare and contrast Data Flow diagram and Use Case diagram. Which one would you use to communicate with the business users

  Find the global stiffness matrix for the structure

Consider the structure composed of a spring and a linear bar as shown in Fig. 3.6. Given E = 200 GPa, A = 0.01 m2, k = 1000 kN/m, and P = 25 kN,

  Find the minimum spanning tree of the graph

Suppose we are given the minimum spanning tree T of a given graph G (with n vertices and m edges) and a new edge e = (u, v) of weight w that we will add to G. Give an efficient algorithm to find the minimum spanning tree of the graph G + e.

  What is my experience with nursing theory

What is my experience with nursing theory? Have I ever seen nursing theory in practice? How important do I think nursing theory is to nursing practice?

  Find out the exact ascii value

This project provides a variety of facility to the users and saves our valuable time and energy. It aims at developing the computers internal code to user readable code and find out the exact ASCII value.

  Testing for object-oriented systems and uncovering software

Explain your roles and responsibilities in designing and performing various testing for object-oriented systems and uncovering software bugs.

  Determine prompts for two positive integer inputs

Prompts for two positive Integer inputs (numerrator, denominator) from user, Displays Quotient and Remainder of above two inputs

  Construct an ie crow''s foot model showing relationships

Examine your list to determine whether any entities are synonyms. If so, consolidate your list.

  List and explain what occurs at each layer of the osi model

Why is it necessary to have a standard model with which to discuss networks or computers?

  The requirements for tal distributors have changed

The requirements for TAL distributors have changed. A number and a name now identify each storehouse. Units of each item may be stored in multiple storehouses, and it is important to know precisely how many items are stored in each storehouse. I addi..

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