0% found this document useful (0 votes)
22 views6 pages

Culturalmanagement

This document contains code for a cultural management program. The program allows the user to create master tables, register students, manage events, and view information about judges and prizes. It uses Java to create files and write data to them based on user input.

Uploaded by

HELAMI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views6 pages

Culturalmanagement

This document contains code for a cultural management program. The program allows the user to create master tables, register students, manage events, and view information about judges and prizes. It uses Java to create files and write data to them based on user input.

Uploaded by

HELAMI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Culturalmanagement

import java.util.*;

import java.io.*;

public class Culturalmanagement

public static void main(String[] args)throws IOException {

int i,vnum,fnum,etime;

int choice=0,option,cho,stuclass;

float amount,balance=0;

int shipno,customers,jnum;

String
name,class1,designation,collegename,elocation,etype,tname,subject,eventname,event9,event12,ev
ent3,event5,stuname,studesignation,stucollegename;

String jname,jtype,jdesignation;

boolean flag=true;

boolean quit = false;

int snum,stunum;

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.println("\n\t\t\tCultural Management");

while(flag)

System.out.println("1.Master Tables\n2.Register Students\n3.Manage events\n4.Information of


judges and prizes");

System.out.print("Enter your choice: ");

choice= Integer.parseInt(br.readLine());

switch(choice){

case 1:

// Create a file.

System.out.println("1.Volunteer list\n2.Event details\n3.List of faculty\n4.Inventory of prizes");

System.out.println("Enter your choice");


cho=Integer.parseInt(br.readLine());

switch(cho)

case 1:

FileWriter fout = new FileWriter("Students.txt");

//Read data from Keyboard

System.out.println("How many students? ");

vnum= Integer.parseInt(br.readLine());

for(i=0;i<vnum;i++)

System.out.println("enter Name:");

name = br.readLine();

System.out.println("Enter class");

class1=br.readLine();

System.out.println("Designation");

designation=br.readLine();

System.out.println("Enter college name");

collegename=br.readLine();

System.out.println("\n");//print blankline

// Write to file.

Formatter fmt1 = new Formatter();

fmt1.format("%10s\n%10d \n%10s\n%10s",name,class1,designation,collegename);

fout.write(fmt1+"\r\012");

fout.write("EOF");

fout.close();

System.out.println("File is created");

break;

case 2:

FileWriter fout1 = new FileWriter("EventDetails.txt");

//Read data from Keyboard


System.out.println("Event Location ");

elocation= br.readLine();

System.out.println("enter Type of event:");

etype = br.readLine();

System.out.println("Enter event Time");

etime=Integer.parseInt(br.readLine());

System.out.println("\n");//print blankline

// Write to file.

Formatter fmt2 = new Formatter();

fmt2.format("%10s\n%10s\n%10d",elocation,etype,etime);

fout1.write(fmt2+"\r\012");

fout1.write("EOF");

fout1.close();

System.out.println("File is created");

break;

case 3:

FileWriter fout2 = new FileWriter("faculty.txt");

//Read data from Keyboard

System.out.println("How many faculty members? ");

fnum= Integer.parseInt(br.readLine());

for(i=0;i<fnum;i++)

System.out.println("enter Name:");

tname = br.readLine();

System.out.println("Subject");

subject=br.readLine();

System.out.println("\n");//print blankline

// Write to file.

Formatter fmt3 = new Formatter();

fmt3.format("%10s\n%10s",tname,subject);

fout2.write(fmt3+"\r\012");
}

fout2.write("EOF");

fout2.close();

System.out.println("File is created");

break;

case 2:

snum=0;

System.out.print("enter Number of students");

FileWriter fout3 = new FileWriter("StudentsData.txt");

//Read data from Keyboard

System.out.println("How many students? ");

stunum= Integer.parseInt(br.readLine());

for(i=0;i<stunum;i++)

System.out.println("enter Name:");

stuname = br.readLine();

System.out.println("Enter class");

stuclass=Integer.parseInt(br.readLine());

System.out.println("Designation");

studesignation=br.readLine();

System.out.println("Enter college name");

stucollegename=br.readLine();

System.out.println("\n");//print blankline

// Write to file.

Formatter fmt4 = new Formatter();

fmt4.format("%10s\n%10d \n%10s\n%10s",stuname,stuclass,studesignation,stucollegename);

fout3.write(fmt4+"\r\012");

fout3.write("EOF");

fout3.close();
System.out.println("File is created");

break;

case 3:

FileWriter fout4 = new FileWriter("MasterSchedule.txt");

//Read data from Keyboard

System.out.println("Enter event name? ");

eventname= br.readLine();

System.out.println("At 9:00");

event9 = br.readLine();

System.out.println("At 12:00");

event12=br.readLine();

System.out.println("At 3:00");

event3=br.readLine();

System.out.println("At 5:00");

event5=br.readLine();

System.out.println("\n");//print blankline

// Write to file.

Formatter fmt5 = new Formatter();

fmt5.format("%10s\n%10d \n%10s\n%10s",eventname,event9,event12,event3,event5);

fout4.write(fmt5+"\r\012");

fout4.write("EOF");

fout4.close();

System.out.println("File is created");

break;

case 4:

System.out.print("enter Number of judges");

FileWriter fout5 = new FileWriter("Judges.txt");

//Read data from Keyboard

System.out.println("How many students? ");

jnum= Integer.parseInt(br.readLine());

for(i=0;i<jnum;i++)
{

System.out.println("enter Name:");

jname = br.readLine();

System.out.println("Designation");

jdesignation=br.readLine();

System.out.println("Enter judge for which celebration");

jtype=br.readLine();

System.out.println("\n");//print blankline

// Write to file.

Formatter fmt6 = new Formatter();

fmt6.format("%10s\n%10s \n%10s\n%10s",jname,jdesignation,jtype);

fout5.write(fmt6+"\r\012");

fout5.write("EOF");

fout5.close();

System.out.println("File is created");

break;

default:System.out.println("Wrong Choice!!");

You might also like