Skip to content

hanisdhuzuki/sortingHP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Introduction

You are required to create a C++ program that interactively accepts and stores the information of used handphones for sale as shown in the table below.

Model		Make	Price	Condition
------		-----	---	--------
Samsung		S2	500	B
Apple		Iphone5	580	B
Apple		Iphone6	1200	A
Samsung		Note10	4000	A

Declare an array of 4 structures named Handphones in your program. Using the data type declared in your program:

  1. Write a function named storeInfo() that passes as an argument, an array of structure to capture the information of each car entered by the user.
  2. In the same program, create a function named sortInfo() to sort the info based on the price of the handphones. Your array of structure should be accessed using pointer variables.
  3. Write a function call displayInfo(), to display the information keyed in.

Example Code

The sample code is given in a file called handphone.cpp. There is a logical errors with the code, which makes the sorting work incorrectly, figure it out.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%