[SOLVED] C Programming Language #Project - 9

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Stack-jhnc5u.zip (248.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

In this project, you must create a music stack list which has The Turkish Five. The Turkish Five is a name used to identify five pioneers of western classical music in Turkey. The Turkish Five composers are listed below in the table.

 

Name (char [])

 

Surname (char []

 

Musical_Work(char [])

 

age (int)

 

Cemal Reşit

 

Rey

 

Lüküs Hayat

 

80

 

Ahmed Adnan

 

Saygun

 

Yunus Emre

 

83

 

Ulvi Cemal

 

Erkin

 

Keloğlan

 

66

 

Hasan Ferit

 

Alnar

 

Sarı Zeybek

 

72

 

Necil Kazım

 

Akses

 

İkinci Senfoni

 

90

 

 

Create a stack that is implemented with a linked list. You must define struct person like;

 

struct person{

 

name (char[]);

 

surname (char[]);

 

musical_Work(char[]);

 

age(int);

 

struct person *next;

 

} *top;

 

In your program, you have to create a menu which has the following operations.

 

  • Add a Person to the Stack

 

Take person’s information with scanf, create a node and add the node to the stack using the

function addNode(char name[], char surname [], char creation [], int age).

 

Page 1 of 5

  • Pop a Person from the Stack

 

Delete the last node of the stack. Create deleteNode(…) to pop a node.

 

  • Sort in Alphabetical Order

 

 Write a method Sort_Alphabetically(…) to order the names of the people in the stack alphabetically. Use the print_stack(…) method to show the sorted stack.

 

  • Sort Age in Increasing Order

 

Write a method Sort_Increasingly(…) that sorts ages of people in the stack in increasing order. Use the print_stack(…) method to show the sorted stack.

 

  • Exit menu

 

Quit menu.

 

 

Example Output; (User entered values are written in bold.)

 

****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack
  • Sort Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

*************

Select your Choise: 1

Name: Cemal Reşit Surname: Rey

Creation: Lukus Hayat

Age: 80

——————–

1)Cemal Reşit

Rey

Lukus Hayat

80

****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack
  • Sort in Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

*************

Select your Choise: 1

Name: Ahmed Adnan

Surname: Saygun

Creation: Yunus Emre

Age: 83

——————–

1) Ahmed

Adnan Saygun

Yunus Emre

83

2)Cemal Reşit

Rey

Lukus Hayat

80

****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack
  • Sort in Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

Select your Choise: 1

*************

Name: Ulvi Cemal

Surname: Erkin

Creation: Keloğlan

Age: 66

—————–

  • Ulvi Cemal Erkin

 Keloğlan

66

  • Ahmed

Adnan Saygun

Yunus

Emre 83

3)Cemal Reşit

Rey

Lukus

 Hayat 80

 ****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack 3- Sort in Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

 

*************

Select your Choise: 1

Name: Hasan Ferit

Surname: Alnar

Creation: Sarı Zeybek Age: 72

——

  • Hasan

 Ferit Alnar Sarı Zeybek

72

  • Ulvi Cemal Erkin

 Keloğlan

66

  • Ahmed

Adnan Saygun

Yunus

Emre 83

4)Cemal Reşit

Rey

Lukus Hayat

80

****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack
  • Sort in Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

 

*************

 

Select your Choise: 2

  • Ulvi Cemal Erkin

 Keloğlan

66

  • Ahmed

Adnan Saygun

Yunus

Emre 83

3)Cemal Reşit

Rey

Lukus

 Hayat 80

 ****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack 3- Sort in Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

 

*************

Select your Choise: 3

Ahmed Adnan

Saygun

Yunus Emre 83

Cemal Reşit

Rey

Lukus Hayat

80

Ulvi Cemal

Erkin Keloğlan

66

****MENU****

  • Add a Person to the Stack
  • Pop a Person from the Stack
  • Sort in Alphabetical Order
  • Sort Age in Increasing Order
  • Exit menu

 

*************

Select your Choise: 4

Ulvi Cemal

Erkin

Keloğlan

66

 

Cemal Reşit

Rey

Lukus Hayat

80

Ahmed Adnan

Saygun

Yunus Emre

83

 

 

 

Page 5 of 5

  • Stack-jhnc5u.zip