Java Your program must read a file called personin.txt.  Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor.  These entries will be sorted by the time the person arrived.   Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor.  You need to print the events in order of the time they happen.  In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office. In your output you need to print out a schedule.  In the schedule, new students go to the end of the line.  Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting.  Assume no two people arrive at the same time. You should solve this problem using a stack and a queue. You can only use the operations: push, pop and isEmpty for Stack, or enqueue, dequeue and isEmpty for Queue, or their equivalents

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter10: Classes And Objects
Section: Chapter Questions
Problem 8E
icon
Related questions
Question

Java

Your program must read a file called personin.txt.  Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor.  These entries will be sorted by the time the person arrived.  

Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor.  You need to print the events in order of the time they happen.  In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office.

In your output you need to print out a schedule.  In the schedule, new students go to the end of the line.  Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting.  Assume no two people arrive at the same time.

You should solve this problem using a stack and a queue. You can only use the operations: push, pop and isEmpty for Stack, or enqueue, dequeue and isEmpty for Queue, or their equivalents.

Example file:
ann 10 5
astro 12 2
barb 14 6
bill 20 6
carl 22 7
Transcribed Image Text:Example file: ann 10 5 astro 12 2 barb 14 6 bill 20 6 carl 22 7
ann arrives at 10 and requests a meeting of length 5
ann meets from 10 to 15
astro arrives at 12 and requests a meeting of length
2
barb arrives at 14 and requests a meeting of length
6
astro meets from 15 to 17
barb meets from 17 to 23
bill arrives at 20 and requests a meeting of length 6
carl arrives at 22 and requests a meeting of length 7
bill meets from 23 to 29
carl meets from 29 to 36
Transcribed Image Text:ann arrives at 10 and requests a meeting of length 5 ann meets from 10 to 15 astro arrives at 12 and requests a meeting of length 2 barb arrives at 14 and requests a meeting of length 6 astro meets from 15 to 17 barb meets from 17 to 23 bill arrives at 20 and requests a meeting of length 6 carl arrives at 22 and requests a meeting of length 7 bill meets from 23 to 29 carl meets from 29 to 36
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning