C How to Program (8th Edition)
C How to Program (8th Edition)
8th Edition
ISBN: 9780133976892
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
Question
Book Icon
Chapter 12, Problem 12.8E
Program Plan Intro

Program plan:

  1. Item, start variablesare used for input. There is structure listnode having data, nextPtr member variables which represents the linked list node.
  2. void insert(node **head, int value) function inserts the node in the a linked list.
  3. void calculate (node *flist) functioncalculate the sum of the contents of the linked list and then calculate the average value and display the result.
  4. void printList(node *head) function display the contents of the linked list.

Program description:

The main purpose of the program is to create linked list of 25 values which are generated randomly. Then sum and average of these values are calculated and displayed.

Blurred answer
Students have asked these similar questions
1. (Store numbers in a linked list) Write a program that lets the user enter numbers and displays numbers as described below. Use a linked list to store the numbers. Do not store duplicate numbers. Add the methods Sort, Shuffle, and Reverse to sort, shuffle, and reverse the list in the application class (driver class). Please submit the source code and bytecode.
- Question-2: Functions, Iterations and List • Write a function that takes a positive integer n as its parameter. • Return a list whose o values are numbers between n and 2n.
1. (Store numbers in a linked list) Write a program that lets the user enter numbers and displays numbers as described below. Use a linked list to store the numbers. Do not store duplicate numbers. Add the methods Sort, Shuffle, and Reverse to sort, shuffle, and reverse the list in the application class (driver class).
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education