JAVA Program
The grade of the student for the Advanced Java course consists of 4 results: home task 1 (max 10 marks), home task 2 (max 10 marks), midterm test (max 30 marks) and examination (max 50 marks).
Write a JAVA program which does the following operations:
1. Asks user to input the name of the student and create a file called StudentName_JavaResults.txt, ex: MaryJohnson_JavaResults.txt
2. Asks user to input the results for home task 1, home task 2, midterm test, and examination (one by one). Save all these results to the file created in the previous part. The information in file should be readable and understandable.
3. Add logic to check, that home task 1 result is max 10 marks, home task 2 result is max 10 marks, midterm test result is max 30 marks, and examination - max 50 marks. If it is not, ask it again.
4. Calculate the amount of marks gained during the course. Save this value to the file.
Code
import java.io.*;
import java.util.Scanner;
public class Main
{
public static void main(String[] args) throws IOException
{
Scanner input=new Scanner(System.in);
String fileName;
System.out.print("Enter name of student: ");
fileName=input.next();
fileName+="_JavaResults.txt";
FileWriter fileWriter = new FileWriter(fileName);
PrintWriter printWriter = new PrintWriter(fileWriter);
int homeTask1,homeTask2,midterm,examination;
while(true)
{
System.out.print("Enter the marks of the home task1 : ");
homeTask1=input.nextInt();
if(homeTask1>=1 && homeTask1<=10)
break;
else
System.out.println("Enter the marks between 1 and 10
inclusive.");
}
System.out.println();
while(true)
{
System.out.print("Enter the marks of the home task2 : ");
homeTask2=input.nextInt();
if(homeTask2>=1 && homeTask2<=10)
break;
else
System.out.println("Enter the marks between 1 and 10
inclusive.");
}
System.out.println();
while(true)
{
System.out.print("Enter the marks of the midterm : ");
midterm=input.nextInt();
if(midterm>=1 && midterm<=30)
break;
else
System.out.println("Enter the marks between 1 and 30
inclusive.");
}
System.out.println();
while(true)
{
System.out.print("Enter the marks of the Examination : ");
examination=input.nextInt();
if(examination>=1 && examination<=50)
break;
else
System.out.println("Enter the marks between 1 and 10
inclusive.");
}
System.out.println();
int sum=homeTask1+homeTask2+midterm+examination;
printWriter.printf("Home Task 1: %d%n",homeTask1);
printWriter.printf("Home Task 1: %d%n",homeTask2);
printWriter.printf("Midterm: %d%n",midterm);
printWriter.printf("Home Examination: %d%n",examination);
printWriter.printf("Total marks for Advanced Java course:
%d%n",sum);
printWriter.close();
}
}
output

text file
If you have any query regarding the code
please ask me in the comment i am here for help you. Please do not
direct thumbs down just ask if you have any query. And if you like
my work then please appreciates with up vote. Thank You.
JAVA Program The grade of the student for the Advanced Java course consists of 4 results:...
You will be designing and creating a Java GUI-based course application. Create a “Student” class. You need to have at least 3 instance variables (student characteristics like name,…), at least 2 constructors (1 should be a no-arg constructor), set and get methods. Create a “Course” class that consists of 2 instance variables: the course name and an array of Students (using your Student class). Design and create a JavaFX-based GUI interface that allows you to : INPUT information for Course...
Kindly solve this using C PROGRAMMING ONLY.
4. Write a program marks.c which consists of a main function and three other functions called. readmarks , changemarks (, and writemarks() The program begins by calling the function readmarks () to read the input file marksin. txt which consists of a series of lines containing a student ID number (an integer) and a numeric mark (a float). Once the ID numbers and marks have been read into arrays (by readmarks () the...
Java program
Program: Grade Stats In this program you will create a utility to calculate and display various statistics about the grades of a class. In particular, you will read a CSV file (comma separated value) that stores the grades for a class, and then print out various statistics, either for the whole class, individual assignments, or individual students Things you will learn Robustly parsing simple text files Defining your own objects and using them in a program Handling multiple...
package _solution;
/**
This program demonstrates how numeric types and operators behave in Java
Do Task #1 before adding Task#2 where indicated.
*/
public class NumericTypesOriginal {
public static void main (String [] args) {
//TASK #2 Create a Scanner object here
//identifier declarations
final int NUMBER = 2 ; // number of scores
int score1 = 100; // first test score
int score2 = 95; // second test score
final int BOILING_IN_F = 212; // boiling temperature
double fToC;...
In JAVA please! Write program for exercises You will write a Graphical User Interface(GUI) application to manage student information system. The application should allow: 1. Collect student information and store it in a binary data file. Each student is identified by an unique ID. The user should be able to view/edit an existing student. Do not allow student to edit ID. 2. Collect Course information and store it in a separate data file. Each course is identified by an unique...
2. In a file called passfail.py, write a Python program to solve the following problem: Given a file students.txt with the following information for a stu dent: student number, average quiz mark, average assignment mark, midterm exam mark, and final exam mark (where each mark is recorded out of 100), de termine if the student has passed or failed based on the following information A student will pass the course if they have a passing mark (50% or higher) for...
python question
2. In a file called passfail.py, write a Python program to solve the following problem: Given a file students.txt with the following information for a stu dent: student number, average quiz mark, average assignment mark, midterm exam mark, and final exam mark (where each mark is recorded out of 100), de termine if the student has passed or failed based on the following information: • A student will pass the course if they have a passing mark (50%...
PLEASE INCLUDE COMMENTS In java Create a Java Program Add the following comments at the beginning of the file: Your name. The name of the class(es) used in the program. The core concept (found below) for this lesson. The date the program was written. Include a recursive method separate from the main method that will add together all of the even numbers between and including 1 and the value the user supplies. For instance, if the user enters 10 then...
Please give me an idea on how to improve the JAVA program below
which is a student grading system for future works. The current
function is Users input their details and marks and the results
could be printed on the transcript text field and save to a
database which is in text file form. The delete button is for
deleting the table rows, reset button is to clear all text field.
average button is to calculate all result and send...
Write a program that will check a Java file for syntax errors. The program will ask for an input-file name and output-file name and will then copy all the code from the Java input file to the Java output file, but with the following changes: 1. Any syntax error found in the Java input file will be corrected: a. Missing semicolon b. Missing compound statements (curly braces) c. All comments have to start with // and end with a period....