Download presentation
Presentation is loading. Please wait.
1
Operating Systems Project CPSC 250 Lab Aid
2
CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow students to view the results of running the completed source code for lab assignments. Allow instructors to view and run the source code for a completed lab exercise.
3
Class Organization
4
The GUI Programmed using Net Beans GUI builder. Will not run in other IDE’s.
5
The GUI Menu Functions Contains menu options for Login, Logout, Quit, and About. All menu functions have shortcut keys.
6
User Levels Student/General user does not require a login to use. Student/General does not allow access to the source code of any lab.
7
User Levels Cont. Instructor login must be used to view the source code. An error or success message is given after user input.
8
User Levels Cont. An error message is given when a user tries to view source code without logging in. A success message is given when a user logs out.
9
Code Integration All CPSC 250 labs are designed as Stand-Alone programs. Code had to be edited to run within the Lab Aid program. The original code had to be conserved to print in the output window.
10
A Formatting Nightmare!
11
A Formatting Nightmare Cont. Problem: How to make the JVM read java code as a series of Strings?
12
A Formatting Nightmare Cont. Solution: Write a short program in a different language to format the code for you. In our case, C++ was used. //a quick utility to read in the contents of a java file //and convert them into the code necessary toadd them into a // jTextArea, for use in the main project // writing to a file was quicker and easier in c++, so it was chosen for this process #include using namespace std; int main() {ifstream Input; ofstream Output; Input.open("SizePanel.java"); // file name is changed run by run Output.open("new SizePanel.java"); // is changed to reflect the change in the above line string x; while(!Input.eof()) { getline(Input, x); Output<<"jTextArea1.append(\"" + x + "\" + \"\n\" ); "<<endl; } Output.close(); Input.close(); return EXIT_SUCCESS; }
13
A Formatting Nightmare Cont. Some problems still existed when trying to format code containing strings. These were fixed manually by concatenation.
14
Exception Handling If errors exist is the source code of a lab, exceptions can occur that can potentially cause the program to crash. Try/Catch Statements were used to catch any exceptions thrown by faulty code within the labs.
15
Exception Handling Cont. An error message is given when an exception is thrown during the execution of a lab.
16
Finally… A Demo of the actual program
17
Credits This program was created by: Daniel Goodwin David Goodell Devin Saverline
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.