package student;
import java.util.Scanner;
public class Main {

    public static void main(String[] args) {

    Scanner scan  = new Scanner(System.in);

StudentA stud1 = new StudentA();
    System.out.print("Please Enter Student Name:");
    stud1.Name = scan.next();
    System.out.print("Please Enter Student ID:");
    stud1.StudentID = scan.next();
    System.out.print("Please Enter Course:");
    stud1.Course = scan.next();
    System.out.print("Please Enter Student Section:");
    stud1.Section = scan.next();

    majorexams exam1 =  newmajorexams();
    System.out.print("Please Enter Prelim Exam:");
    exam1.prelim = scan.nextInt();
    System.out.print("Please Enter Midterm Exam:");
    exam1.midterm = scan.nextInt();
    System.out.println("Please Enter Final Exam:");
    exam1.finals = scan.nextInt();

    int totalExam = (exam1.prelim + exam1.midterm+exam1.finals)/3;
    System.out.println("Your total Examination is:" + totalExam);


    quizz qu1 = new quizz();
    System.out.print("Please Enter quiz1:");
    qu1.quiz1 = scan.nextInt();
    System.out.print("Please Enter quiz2:");
    qu1.quiz2 = scan.nextInt();
    System.out.print("Please Enter quiz3:");
    qu1.quiz3 = scan.nextInt();

    int totalquiz = (qu1.quiz1 + qu1.quiz2 + qu1.quiz3)/3;
    System.out.println("Your total quiz is:" + totalquiz);

    participation part1 = new participation();
    System.out.print("Please Enter Attendance:");
    part1.attendance = scan.nextInt();
    System.out.print("Please Enter performance:");
    part1.performance = scan.nextInt();
    System.out.print("Please Enter Recitation:");
    part1.recitation = scan.nextInt();

    int totalPart = (part1.attendance + part1.performance + part1.recitation)/3;
    System.out.println("Your total grade in performance is:" + totalPart);

    int totalGrade = (totalExam + totalquiz+ totalPart)/3;

    System.out.println("Student name:"+stud1.Name);
    System.out.print("Your final grade is:"+totalGrade);
    }

    private static majorexams newmajorexams() {
]
        return null;
    }
}

package student;

public class StudentA {
    String Name;
    String Course;
    String Section;
    String StudentID;
}
class majorexams{
    int prelim;
    int midterm;
    int finals;
}

class quizz{
    int quiz1;
    int quiz2;
    int quiz3;
}

class participation{
    int attendance;
    int recitation;
    int performance;
    }

Hi, can you help me with this one? I tried several steps with this but has the same results

javac: file not found: C:\Program Files\Java\Main.java
Usage: javac <options> <source files>
use -help for a list of possible options

Recommended Answers

It seems like it's looking for your java file in the wrong place.
It's looking in c:\Program Files\java, presumably because that's your working directory (?). That's a really bad place to put your own source code projects.

What directory is Main.java in?
What exectly is the command you are using?

Jump to Post

All 2 Replies

It seems like it's looking for your java file in the wrong place.
It's looking in c:\Program Files\java, presumably because that's your working directory (?). That's a really bad place to put your own source code projects.

What directory is Main.java in?
What exectly is the command you are using?
Is c:\Program Files\java in your system PATH variable?

You've given us everything except the javac command.

Change to the folder where you .java files are stored and try: javac -d . *.java

That should get you going.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.