subject

Write a C program that reads sales data from a file called sales. txt. Each line of the file contains four data items; 1. A product number which is an integer 2. A product name which is a string no longer than 12 characters and which does not contain spaces 3. A unit price which is a double 4. A number of units sold which is an integer The program will output the two products which generated the highest total revenue (unit price * number sold). Your program must: 1. Read each line of the file storing the four items into the members of a dynamically allocated structure. 2. Store pointers to the structures in an array. 3. Sort the array of pointers by total revenue 4. Display the product name and total revenue of the top two products 5. The program must work for sales. txt files with anywhere from 2 to 100 products

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
On the loan worksheet in cell c9 enter pmt function to calculate the monthly payment for the altamonte springs 2018 facilities loan. ensure that the function returns a positive value and set the reference to cells b5 and b6 as absolute references.
Answers: 2
question
Computers and Technology, 22.06.2019 08:50
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Q13 what function does a security certificate perform? a. creates user accounts b. scrambles data c. identifies users d. creates password policies e. provides file access
Answers: 1
question
Computers and Technology, 23.06.2019 07:50
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
You know the right answer?
Write a C program that reads sales data from a file called sales. txt. Each line of the file contain...
Questions
question
Mathematics, 25.12.2019 05:31
question
Mathematics, 25.12.2019 05:31
question
English, 25.12.2019 05:31
question
Mathematics, 25.12.2019 05:31