Question
#include #include #include #include using namespace std; int pilih; void pilihan(); void insert_jadwal(); void hapus_jadwal(); void tampilkan_jadwal(); struct node { int kode; char matkul [40];
#include
#include
#include
#include
using namespace std;
int pilih; void pilihan();
void insert_jadwal();
void hapus_jadwal();
void tampilkan_jadwal();
struct node
{
int kode;
char matkul [40];
int tanggal;
int jam;
int ruang;
node *prev, *next;
};
node *baru, *head=NULL, *tail=NULL,*help,*del;
main()
{
do
{
system("cls");
cout<<"JADWAL UJIAN"< cout<<"=========================="< cout<<"1. Tambah Jadwal"< cout<<"2. Hapus Jadwal"< cout<<"3. Tampilkan Jadwal"< cout<<"4. Keluar"< cout<<"Pilih menu (1 - 4) : "; cin>>pilih; cout< pilihan(); cout<<"==============================="< } while(pilih!=4); } void pilihan() { if(pilih==1) insert_jadwal(); else if(pilih==2) hapus_jadwal(); else if(pilih==3) tampilkan_jadwal(); else { cout<<"EXIT"; cout<<" Bye..."< } } void buat_baru() { baru = new(node); cout<<"Masukkan kode Matkul [5]: ";cin>>baru->kode; cout<<"Masukkan Matkul [8-40]: ";cin>>baru->matkul; cout<<"Masukkan tanggal [1-30]: ";cin>>baru->tanggal; cout<<"Masukkan jam [8-17]: ";cin>>baru->jam; cout<<"Masukkan ruang [3]: ";cin>>baru->ruang; cout<<" \tJadwal telah ditambahkan"; cout<<" PRESS ENTER TO CONTINUE..."; getch(); baru->prev=NULL; baru->next=NULL; } void insert_jadwal() { buat_baru(); if(head==NULL) { head=baru; tail=baru; } else { baru->next=head; head->prev=baru; head=baru; } cout< } void hapus_jadwal() { int hapus; int kode; if(head==NULL) { cout<<" Linked List kosong, Penghapusan tidak dapat dilakukan"< } else { hapus=head->kode; cout<<" Data yang dihapus adalah "; cin>>kode; del = head; head = head->next; delete del; } } void tampilkan_jadwal() { if (head==NULL) cout<<" Data tidak dapat ditemukan!"< else { cout<<"JADWAL UJIAN BULAN INI"< cout<<"-----------------------------------------------------------------------------"< cout<<"Kode matkul-----Matkul------------------Tanggal---------Jam-------------Ruang"< cout<<"-----------------------------------------------------------------------------"< help=head; while(help!=NULL) { cout< cout<<"\t\t"< cout<<"\t\t\t"< cout<<"\t\t"< cout<<"\t\t"< help=help->next; } } getch(); } i need to print void tampilkan_jadwal() with int tanggal; sorted ascending sorry bad english
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started