17
Operating Systems Project CPSC 250 Lab Aid

Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

Operating Systems Project

CPSC 250 Lab Aid

Page 2: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

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.

Page 3: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

Class Organization

Lab2Classes for Lab2

Lab3Classes for Lab3

Lab4Classes for Lab4

MainFrame2000+ lines of code

GUI and Events

Page 4: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

The GUI

Programmed using Net Beans GUI builder.

Will not run in other IDE’s.

Page 5: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

The GUI Menu Functions

Contains menu options for Login, Logout, Quit, and About.

All menu functions have shortcut keys.

Page 6: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

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.

Page 7: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

User Levels Cont.

Instructor login must be used to view the source code.

An error or success message is given after user input.

Page 8: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

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.

Page 9: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

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.

Page 10: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

A Formatting Nightmare!

Page 11: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

A Formatting Nightmare Cont.Problem: How to make the JVM read java code as a series of Strings?

Page 12: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

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 <iostream>

#include <fstream>

#include <string>

#include <cstdlib>

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;

}

Page 13: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

A Formatting Nightmare Cont.

Some problems still existed when trying to format code containing strings.

These were fixed manually by concatenation.

Page 14: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

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.

Page 15: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

Exception Handling Cont.

An error message is given when an exception is thrown during the execution of a lab.

Page 16: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

Finally…

A Demo of the actual program

Page 17: Operating Systems Project CPSC 250 Lab Aid. CPSC 250 Lab Aid Overview Create a program to help Students and professors in Computer Science 250. Allow

Credits

This program was created by:

Daniel Goodwin

David Goodell

Devin Saverline