Thread: Help with old exam project

  1. #1
    Registered User
    Join Date
    Jan 2021
    Posts
    1

    Exclamation Help with old exam project

    Hi guys, i really need help with some of the last topic (sorry for my bad english, i'm italian).
    The topic is this:
    1)Acquisition, from a file made by the student, of a record of medical prescription structured in this way:
    #prescriptioncode#surname#exemption#issuehour#issu edate
    And i've made this part with modularitazion, the problem is with the other 2 part of the exam
    2)Verify that there aren't more than 3 prescription made by the same doctor in the same day: if there are, this need to be moved to another day, the postponed prescription will be memorized in another file
    3)Sort of the medical prescription from the order relation <issuedate, issuehour, surname>. the increasing or decreasing parameter should be taken from input, the sorted prescriptions should be saved in another file. Sort using the recursive bubble sort.

    Please, please, i really need help :(

  2. #2
    Registered User
    Join Date
    May 2012
    Posts
    505
    Quote Originally Posted by Turtleman210 View Post
    Hi guys, i really need help with some of the last topic (sorry for my bad english, i'm italian).
    The topic is this:
    1)Acquisition, from a file made by the student, of a record of medical prescription structured in this way:
    #prescriptioncode#surname#exemption#issuehour#issu edate
    And i've made this part with modularitazion, the problem is with the other 2 part of the exam
    2)Verify that there aren't more than 3 prescription made by the same doctor in the same day: if there are, this need to be moved to another day, the postponed prescription will be memorized in another file
    3)Sort of the medical prescription from the order relation <issuedate, issuehour, surname>. the increasing or decreasing parameter should be taken from input, the sorted prescriptions should be saved in another file. Sort using the recursive bubble sort.

    Please, please, i really need help
    You need an array of structures from part one. These have fields including doctor and date (is that surname? It's not clear to me from the format where the doctor is stored).

    You also need to write a recursive bubblesort which takes a qsort-style function pointer, so you can sort using any ordering.

    Now sort your array by doctor, and break ties with date.

    Now step through it, and check if you have four or more same doctor / same date entries consecutively. If you do, you've detected a violation of the maximum three prescriptions a day rule.


    Part 3 should be easy once you've done part two. Just sort again, with a different comparison function.

    Writing out data is much easier than reading it in, so this last step should also be easy.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    https://github.com/MalcolmMcLean


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 08-02-2013, 06:45 PM
  2. C# Exam
    By Progenitor in forum C# Programming
    Replies: 0
    Last Post: 05-19-2009, 06:11 AM
  3. Lab exam
    By hawkins786 in forum C Programming
    Replies: 11
    Last Post: 05-24-2005, 11:24 AM
  4. What do you think of my exam?
    By axon in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 12-03-2004, 08:30 PM
  5. The AP Exam.....
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 02-10-2003, 09:46 PM

Tags for this Thread