djsami mukhtar

Greenhorn
+ Follow
since May 02, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by djsami mukhtar

but Ernest all data that i have read and output are binary e.g. date and temp..so i'm really confused why i have to use fileinput instead of datainput
13 years ago
hi dirk, you moved my topic"input and output file" to a deserted part of the forum ( i/o), usually when i place a topic in the Beginners page i have a response in no time. please re-activated again. i need some help and input very quickly.

cheers

sam
13 years ago
i tried to start it but after reading the i/o chapters and checking all examples from 3 different books..still can't figure it out..this is the only thing that i came up with:

import java.io.*;
import tempitem;
import java.util.StringTokenizer;
class temp

public static void main(string args[])

throws IOException {

DataInputStream datain;

DataInputStream dataout;
FileInputStream fin;
FileOutputStream fout;
int date;
finale float MAX = 350;
finle float MIN = 100;
float times, temperatures;


try {

dataout = new
DataOutputStream( new FileOutputStream ("summary.txt")



}

catch (IOException exc) {

System.out.println("Cannot open file.")
return;

}






}
13 years ago
can anyone help on this please

thanks
13 years ago
o.k..here is the example i'm trying from the bruce eckel book:
date time tempreture
09032004 22.43 298.30

have to be manuplated to be:
Line 1:The date on which the Summary file is generated in the format dd/mm/yyyy.
Line 2:The time at which the Summary file is generated in the format hh:mm and
using a 24 hour clock format for the hours.
Line 3:The date and time of the first data reading in the data file using the same
format as that given immediately above.
Line 4:The date and time of the last data reading in the data file using the same
format as that given immediately above.
Line 5:The number of valid data readings found in the data file � including the first and last
readings if they are valid.
Line 6:The number of invalid data readings found in the data file � including the first and last
readings if they are invalid.
Line 7:The minimum valid temperature value found in the data file.
Line 8:The maximum valid temperature value found in the data file.
Line 9:The average of all the valid temperature values found in the data file.

i know pretty much how started by identifying the input and output files,creating text files, setup a tokenizer and place a try and catch statement, but i really don't how to put it all together..anyone can help..this not h/w but i have been given an assignment like that in which i need to practice and do examples like those to work it out.
13 years ago
hi all..just want a simple example of how to read from text file manipulate format and place the info in another text file..i prefer intergers not strings..thanks

cheers

sam
13 years ago
hi
i'm getting these types of error: illegal start of expression, incompatible types, '}' expected, and finally cannot resolve symbol class Keyboard
the code is below..can any one help me eliminate these errors

import cs1.Keyboard;
public class GradeCount
{


public static void main (String[] args)

{

int grade, count = 0, sum = 0;





System.out.println ("Enter the first Grade");
grade = Keyboard.readInt();

if( grade = 90 && < 100)


count++;
sum += grade;
System.out.println (" Number of A's = "+ count);



if( grade = 80 && < 89)


count++;
sum += grade;
System.out.println (" Number of B's = "+ count);



if( grade = 70 && < 79)


count++;
sum += grade;
System.out.println (" Number of C's = "+ count);




if( grade = 60 && < 69)


count++;
sum += grade;
System.out.println (" Number of D's = "+ count);



if( grade = 0 && < 59)


count++;
sum += grade;
System.out.println (" Number of F's = "+ count);

}

}
13 years ago
thanks Marilyn
i have done something similar but its not working,i'm try tocount and then catgorize grades instead of cows would i be better off with arrays u think.. can you see where i went wrong?
public class GradeCount
{


public static void main (String[] args)


int grade, count = 0, sum = 0;





System.out.println ("Enter the first Grade");
grade = Keyboard.readInt();

while( grade = 90 && < 100)

{
count++;
sum += grade;
System.out.println (" Number of A's = "+ count);

}

while( grade = 80 && < 89)

{
count++;
sum += grade;
System.out.println (" Number of B's = "+ count);

}

while( grade = 70 && < 79)

{
count++;
sum += grade;
System.out.println (" Number of C's = "+ count);

}


while( grade = 60 && < 69)

{
count++;
sum += grade;
System.out.println (" Number of D's = "+ count);

}

while( grade = 0 && < 59)

{
count++;
sum += grade;
System.out.println (" Number of F's = "+ count);

}
13 years ago
hi
can someone give me a simple example of how to read different sets of inputs..counts the matching inputs and outputs the number they have reoccured..
o.k..lets hypethitically say..i wana input 3 different types of cows; black, brown and white..and wana count how many times they have been inputed and output them by saying black cows 3 brown cows 4..etc
13 years ago