Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Name : Abdullah mohammed ogdi ID : 201702696 ((( Please write it, my name and ID, in the same solution before you, and send it

image text in transcribed
Name : Abdullah mohammed ogdi
ID : 201702696
(((Please write it, my name and ID, in the same solution before you, and send it again )))
image text in transcribed I want an answer like this. What is required = delete John's name and write my name ( (Abdullah mohammed ogdi )) and delete 123 and write his number ((201702696 ))
image text in transcribed I want an answer like this. What is required = delete John's name and write my name ( (Abdullah mohammed ogdi )) and delete 123 and write his number ((201702696 ))
5. Write a Program to Create a Serial Access File with the following Specifications. a) Please take input from a text file. The name of the text file must be a combination your name and last 3 digits of student-ID.ext b) The text file should contain marks from 3 courses. c) The Program must use Buffered Reader and FileReader Class ) Please calculate the Total marks and average marks. e) The output should be displayed as follows: course-l marks are xx course-2 marks are xx course-3 marks are xx Total marks of 3 courses are xxx Average marks are xx.x Note: Please write the program and attach the Input File Screenshot and Output Servenshot ...PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY CHANGES THEN LET ME KNOW, I WILL DO IT FOR YOU ANSWER: Here is the code in Java. Comments have been added for explanation Please note: Enter the first name and the last 3 digits of student ID in case-sensitive form. A file named by joining first name, last 3 digits of student ID and Det should be present with the course marks for the three courses on separate lines. If the file name does not match, then you will get a FileNotFoundException. In the case given below, first name is John, last three digits of student ID are 123, hence the file name is John123.txt import java.io.*; import java.util.Scanner: publie class Createlle public static void main(Stringi args) throws 10Exception 1/ Create scanner object to read user input Scanner input - new Scanner(System.in); 1/ Enter first name System.out.print("Enter first name: "); String nane input.nextLine(); 11 Enter last three digits of student ID System.out.print("Enter last three digits of student ID: String last three input.nextLine(); // close the Scanner object. input.close(); // create tile name by joining first name, last 3 digits of student ID and .txt String filename - nase.concat(last Three).concat(.txt); // Read the contents of the file using BufferedReader and PileReader File file = new File(filename): BufferedReader br - new Duffered Reader(new FileReader file)); 1 Store the course marks in three variables int coursel_marks - Integer.parseInt(br.readLine()); Int course2 marks - Integer.parseInt(br.reads.net: int course) marka Integer.parseInt(br.readLine()); 11 calculate total marks double totalMarke - coursel_marke + course2_marks + course) marks: Il calculate average marks double avgMarks - totalMarks / 37 1 display the result System.out.println("Course-1 marks are + course marks) System.out.println("Cours-2 marks are + course mark) System.out.println("course marks are + course) marks) System.out.format("Total marks of courses are s.it. totalMarks) System.out.format(" Average marks are 1.11, agitaris) > Here is the output Here are the contents of John123.txt file: Enter first name 70 Enter last three digits of student ID: 19 course-1 marks are 88 course-2 marks are 72 course-3 marks are 16 Total marks of 3 courses are 238.2 Average marks are 79.3 (PLEASE VOTE FOR THIS ANSWER) I THINK IT WILL BE USEFULL TO YOU... PLZZZ COMMENT IF YOU HAVE ANY PROBLEM I WILL TRY TO SOLVE IT. THANK YOU...... **PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY ANGES THEN LET ME KNOW, I WILL DO IT FOR YOU ESSERE ANSWE re is the code in Java. Comments have been added for explanation. ase note: Enter the first name and the last 3 digits of student ID in case-sensitive m. A file named by joining first name, last 3 digits of student ID and.txt should be sent with the course marks for the three courses on separate lines. If the file name es not match, then you will get a FileNotFoundException. the case given below, first name is John, last three digits of student ID are 123, hen file name is John123.txt ort java.io. ort java.util.Scanner: lic class Createlite public static void main(Stringt i argu) throw aception { // Create scanner object to read user input Scanner input = new Scanner(System.in); // Enter First name System.out.print("Enter first name: String nane input.nextLine(): // Enter last three digits of student ID System.out.print("Enter last three digits of student 10) String last three - input.nextLine(); 11 close the Scanner object. input.close(): // create file name by joining first sane last ) digits of student ID and. String filename name.concat(last Three).concat(.txt) // Read the contents of the file using sufferedheader and PileReader File file - new File(filename) BufferedReader br - new BufferedReader(new FileReader(file)); // Store the course marks in three variables int coursel_marks - Integer.parseIntbr.readine) int coursel_marks - Integer.parseIntbr.readine()); int course3_marks - Integer.parseIntibe.readtiset) double totalMarke - coursel_marks course marks + course) marks 11 calculate average marke double avgharks - totalMarks/ 3; Il display the result System.out.println("course-1 marks are coursel_marks) System.out.printini"course-2 marks are course2 marks: System.out.printin"course) marks are Corse) marks): System.out.format(Total marks of courses are 8.1t", totalMarks) System.out.format(" Average maris are 8.11. avgarks) Here is the output: re are the contents of John123.txt file: ter first nonet ter last three digits of student ID: aurse-1 marks are te orse-2 marks are 72 urse-3 arks are 86 tal marks of 3 courses are 238.6 erage sarks are 79.3 Here LEASE VOTE FOR THIS ANSWER) I THINK IT WILL BE USEFULL TO YOU.. ZZZ COMMENT IF YOU HAVE ANY PROBLEM I WILL TRY TO SOLVE IT....... ANK YOU

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions