fazril-25Java / sortingHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Make		Model	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


Languages

Language:C++ 100.0%