{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

PROJECT 4 - PROJECT(4(GRAPHS(AND(FILE(PROCESSING...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
PROJECT 4: GRAPHS AND FILE PROCESSING INTRODUCTION This project will focus on file processing. The idea behind file processing is simple: information that appear on screen and data that are given manually are volatile and prone to errors. Would you prefer having to key in 1,000 values when instead you can store them all in a file and read them from there? In this project, we will see a data structure that is very useful in a series of applications: internet, transportation, medical, social etc. A graph. A graph in mathematics is a series of vertices and edges, where each edge connects two vertices. A directed graph more specifically contains only edges that can start from a vertex (tail) and arrive to another vertex (head). Figure 1. An example of an undirected graph Figure 2. An example of a directed graph
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
FILE PROCESSING Obviously, inputting a number of edges inside by hand using the keyboard will be a messy procedure, since graphs tend to have more than 100 edges usually. Instead, we will be accepting the graph from within a file. The file will have the following format: #of edges in the graph tail1 head1 tail2 head2 OPTION 1: Accepting a filename from the user Option 1 deals with the errorKprone part of the user giving us input that is not valid. In this part you will have to ask the user to provide you with the location of the file containing the graph. Your program should take a precaution of asking again for the file name until one of the following two conditions are met: 1. the file opens successfully, 2. the user has given an invalid file name for 3 times. As per our previous assignments, since the rest of the options require a file to have been successfully opened, your program should not allow for any of the other options to be executed before this one.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern