Program to print out the values and their counts

Assignment Help C/C++ Programming
Reference no: EM13936730

We have a list of numbers and we need to know two things, what numbers we have and how many of each number do we have in the list.

So we read in each number and add the number to an ordered linked list. If we are adding a number to the list and we find that number, then we will just count it. If we do not find the number in the linked list, then we will add a new node to the linked list with the new number and set the count to one.

The linked list node will have three fields - the number, a counter for the number and a link field.

Write a C++ program to achieve what we want, and print out the values and their counts, say 5 per line.

Example:

5(22) 8(15) 13(5) 22(3) 25(18)
where 5 is the number and 22 is its count.

Please use the attached input file "LinkNbrs.dat" for testing the program.

Attachment:- LinkNbrs.zip

Reference no: EM13936730

Questions Cloud

Program that computes and prints the 1000th prime number : You will need some variables to keep track of which prime number you're on and keep track of where you are in your loop.
What is the difference between genotype and phenotype : What is the difference between genotype and phenotype? What is the difference between haploid and diploids? What is the difference between a null mutation and a conditional mutation?
Advise flower angels : Nobody at Flower Angels read the fax until the Friday afternoon after the roses had been delivered to the customer's address. The customer is now refusing to accept the roses or to pay for it. Advise Flower Angels.
Describe key elements that you would include in scorecard : Is Snyder's strategy one of product differentiation or cost leadership? Explain briefly. Describe briefly key elements that you would include in Snyder's balanced scorecard and your reasons for doing so.
Program to print out the values and their counts : So we read in each number and add the number to an ordered linked list. If we are adding a number to the list and we find that number, then we will just count it. If we do not find the number in the linked list, then we will add a new node to the ..
How the use of solar power could solve the problem : Write paragraph about how lack of oil after few years in Saudi Arabia could affect in the community and how the use of solar power could solve the problem
What is the purpose of miranda warnings : What is the purpose of Miranda warnings? Why are Miranda warnings especially important to law enforcement officers in domestic violence cases? Is the Miranda warning still needed today, or should it be eliminated
Chemical fragments in ligand-protein interactions : Examining Halogen containing chemical fragments in ligand-protein interactions. The goal of my paper is to find preferable fragments containing halogen, F, Cl, Br, and I that interact with protein side chains in the protein binding sites.
Advantages and disadvantages of using iso standards : Discussion Questions from the book "A Guide to Computer Forensics and Investigations" 3rd Edition

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Maturity amount after the period of deposit

Develop a program that accepts a deposit amount and period of deposit. Calculate the maturity amount after the period of deposit. The bank pays 4% interest per year for any deposits made in the bank.

  Write a menu-driven c program

Write a menu-driven C program with appropriate functions that allows the user to fill an array of 50 integers with random numbers on the range 1...999, inclusive, sort it, and then find search it to determine if a given random number was generated..

  Struct definition as the page table entry

Struct definition as the page table entry and the array that follows it as the page table. Implement the software simulation of least recently used algorithm in two C++ functions. Should RUN on UNIX.

  Design a menu driven program for a florist

Design a menu driven program for a florist. The first screen asks the user to choose indoor plants, outdoor plants, nonplants items, or quit. When the user chooses indoor or outdoor plants, list at least three appropriate plants of your choice.

  Prepare a program to print the permutation

write a program to print the permutation that lexicographically precedes the given input permutation. If the given permutation is the lexicographically least permutation, then print the input permutation itself.

  Programming with control structures

Develop a Python program which will calculate the sum of an integer series, as described below. The program wil repeatedly prompt he user to enter a command (a character string).

  Sum of all non-inherited data members

show on the console the sum of all non-inherited data members of every instance in the program by Display() function

  Write a program with three functions

Write a program with three functions: upper, lower, and reverse.

  Lab9 c lab 9 c i request this twice but no answer on this

lab 9 c ltbrgti request this twice but no answer on this please could you check this for

  Analyze an efficient function for removing all duplicates

Describe and analyze an efficient function for removing all duplicates from a collection A of n elements.

  Design class for textbook-data field for grade level of book

Design a class named TextBook that is child class of Book. Include new data field for grade level of book. Create a displayTextBookInfo () method so that you can accommodate new grade-level field.

  Write an accessor function to get the angle

Write a friend function to compare the area of a rectangle with sides 12 and 8 to the area of a parallelogram with sides 14 and 18 and an acute angle of 40 degrees. Test it in main, and check the answer by hand.

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