Skip to content

Software-Development-Methodologies/Input-Output

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

University of West Attica

UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS

University of West Attica · Department of Computer Engineering and Informatics


Software Development Methodologies

Java I/O

Vasileios Evangelos Athanasiou
Student ID: 19390005

GitHub · LinkedIn


Supervision

Supervisor: Georgios Prezerakos, Professor

UNIWA Profile · LinkedIn

Co-supervisor: Angelos Georgoulas, Assistant Professor

Scholar · LinkedIn


Athens, April 2023



README

Java I/O

The purpose of this exercise set is to practice core Java Input/Output (I/O) operations, file handling, and basic programming structures.
It covers reading from standard input, file manipulation (reading/writing), and exception handling.


Table of Contents

Section Folder/File Description
1 INSTALL.md Installation and execution instructions
2 README.md Project overview and usage guide
3 assign/ Assignment description documents
3.1 assign/SDM Exercise 2 (Input & Output).pdf Assignment description (English)
3.2 assign/ΜΑΕ Ασκήση 2 (Input & Output).pdf Assignment description (Greek)
4 src/ Java source code projects demonstrating input/output operations
4.1 src/CopyFiles/ Java project for copying the contents of files
4.1.1 src/CopyFiles/build/ Compiled build output
4.1.2 src/CopyFiles/build.xml Apache Ant build configuration
4.1.3 src/CopyFiles/manifest.mf Application manifest file
4.1.4 src/CopyFiles/myfile.txt Example input file
4.1.5 src/CopyFiles/myfile2.txt Example output/second file
4.1.6 src/CopyFiles/nbproject/ NetBeans project configuration files
4.1.7 src/CopyFiles/src/copyfiles/ Java source code package
4.2 src/CountStatistics/ Java project that calculates statistics from file data
4.2.1 src/CountStatistics/build/ Compiled build output
4.2.2 src/CountStatistics/build.xml Apache Ant build configuration
4.2.3 src/CountStatistics/manifest.mf Application manifest file
4.2.4 src/CountStatistics/myfile.txt Example input file
4.2.5 src/CountStatistics/nbproject/ NetBeans project configuration files
4.2.6 src/CountStatistics/src/countstatistics/ Java source code package
4.3 src/Fibonacci/ Java project that generates Fibonacci numbers and writes them to a file
4.3.1 src/Fibonacci/build/ Compiled build output
4.3.2 src/Fibonacci/build.xml Apache Ant build configuration
4.3.3 src/Fibonacci/manifest.mf Application manifest file
4.3.4 src/Fibonacci/fib50.txt Example file containing Fibonacci numbers
4.3.5 src/Fibonacci/nbproject/ NetBeans project configuration files
4.3.6 src/Fibonacci/src/fibonacci/ Java source code package
4.4 src/ScannerExercise/ Java project demonstrating the use of the Scanner class
4.4.1 src/ScannerExercise/build/ Compiled build output
4.4.2 src/ScannerExercise/build.xml Apache Ant build configuration
4.4.3 src/ScannerExercise/manifest.mf Application manifest file
4.4.4 src/ScannerExercise/nbproject/ NetBeans project configuration files
4.4.5 src/ScannerExercise/src/scannerexercise/ Java source code package

1. Key Subjects Covered

  • Data Reading: Handling bytes and characters from standard input.
  • File Streams: Utilizing FileStreams for read/write operations.
  • Exception Handling: Managing runtime errors using try-catch blocks.
  • Logic Structures: Implementing if-else and while loops.
  • String & Scanner: String manipulation and using the Scanner class.

2. Exercises Description

2.1: Student Grade Processor

Create a console program that calculates the average grade for students based on standard input.

2.1.1 Input Format

  • Student registration number followed by pairs of:
    [Course Name] [Grade]

2.1.2 Termination Rules

  • Enter end to finish entering grades for a specific student.
  • Enter 000000 as a registration number to exit the program.

2.1.3 Output

  • Prints the student registration number and their calculated average grade.

2.2: File Copy Utility

Develop a program that copies the contents of one text file to another.

2.2.1 Process

  • The user provides:
    • The full path of the source file
    • The destination (copy) file path

2.2.2 Implementation Note

  • Use FileWriter and FileReader wrapped in Buffered Streams for better efficiency.

2.2.3 Error Handling

  • Use try-catch blocks to handle:
    • Invalid file paths
    • Missing files
    • Read/write errors

2.3: Text Statistics Analyzer

A program that reads a text file, displays its content, and calculates specific character statistics.

2.3.1 Statistics Tracked

  • Greek characters:

    • Alpha (Α, α)
    • Gamma (Γ, γ)
    • Omega (Ω, ω)
  • Odd digits:

    • 1, 3, 5, 7, 9

2.3.2 Implementation Tip

Use the read() method to process the file character by character.

2.4: Fibonacci Sequence to File

This program calculates the first 50 terms of the Fibonacci sequence and saves them to a text file.

2.4.1 File Format

Each term should appear on a new line:

F(0) = 0
F(1) = 1
F(2) = 1
...

2.4.2 Phase 2

Include an additional method that:

  1. Reads the generated Fibonacci file.
  2. Prints only the numerical values to the console.

About

Java exercises demonstrating file handling, input/output streams, and exception handling through practical programming examples (Software Devlopment Methodologies, UNIWA).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages