Please solve this Java question
Using Java
write a program to enter name, roll number and apppropriate values as marks for primary, middle and high school children. Using overloaded functions calculate and print the average and percentage scored by the student.
Answers
Answered by
1
am looking for code review, best practices and better approaches.
Student class:
package student; import java.util.Date; import java.util.Scanner; class Student { public String name, course; public int marks[] = new int[5]; public int roll; public String adm_date; public static int student_count = 0;; public static void student_number() { System.out.println("Number of students admitted : " + student_count); } public int ret_roll() { return roll; } public void admission() { Scanner sc = new Scanner(System.in); Date date = new Date(); System.out.println("STUDENT DETAILS\n"); System.out.println("\nEnter name: "); name = sc.nextLine(); System.out.println("\nEnter course name: "); course = sc.nextLine(); adm_date = date.toString(); System.out.println("Admission Date:" + adm_date); student_count++; roll = student_count; System.out.println("Roll: "+ roll); } void get_marks() { Scanner sc = new Scanner(System.in); boolean flag; for (int i = 0; i < 5;) { flag = true; do{ if(!flag){ System.out.println("Wrong input."); } System.out.println("Enter marks in subject " + (i + 1) + ":"); marks[i] = sc.nextInt(); flag = false; }while((marks[i] > 100) || (marks[i] < 0) ); i++; } } void marksheet() { int j; System.out.println("STUDENT DETAILS"); System.out.println("NAME : " + name); System.out.println("ROLL NUMBER : " + roll); System.out.println("COURSE : " + course); System.out.println("ADMISSION DATE : " + adm_date); for (j = 0; j < 5; j++){ System.out .println("MARKS IN SUBJECT " + (j + 1) + " : " + marks[j]); } } String get_name() { return name; } String get_admission_date() { return adm_date; } }
Student class:
package student; import java.util.Date; import java.util.Scanner; class Student { public String name, course; public int marks[] = new int[5]; public int roll; public String adm_date; public static int student_count = 0;; public static void student_number() { System.out.println("Number of students admitted : " + student_count); } public int ret_roll() { return roll; } public void admission() { Scanner sc = new Scanner(System.in); Date date = new Date(); System.out.println("STUDENT DETAILS\n"); System.out.println("\nEnter name: "); name = sc.nextLine(); System.out.println("\nEnter course name: "); course = sc.nextLine(); adm_date = date.toString(); System.out.println("Admission Date:" + adm_date); student_count++; roll = student_count; System.out.println("Roll: "+ roll); } void get_marks() { Scanner sc = new Scanner(System.in); boolean flag; for (int i = 0; i < 5;) { flag = true; do{ if(!flag){ System.out.println("Wrong input."); } System.out.println("Enter marks in subject " + (i + 1) + ":"); marks[i] = sc.nextInt(); flag = false; }while((marks[i] > 100) || (marks[i] < 0) ); i++; } } void marksheet() { int j; System.out.println("STUDENT DETAILS"); System.out.println("NAME : " + name); System.out.println("ROLL NUMBER : " + roll); System.out.println("COURSE : " + course); System.out.println("ADMISSION DATE : " + adm_date); for (j = 0; j < 5; j++){ System.out .println("MARKS IN SUBJECT " + (j + 1) + " : " + marks[j]); } } String get_name() { return name; } String get_admission_date() { return adm_date; } }
Answered by
1
Answer:
Indian English literature (IEL), also referred to as Indian Writing in English (IWE), is the body of work by writers in India who write in the English language and whose native or co-native language could be one of the numerous languages of India. Its early history began with the works of Henry Louis Vivian Derozio and Michael Madhusudan Dutt followed by Rabindranath Tagore and Sri Aurobindo.[citation needed] R. K. Narayan, Mulk Raj Anand and Raja Rao contributed to the growth and popularity of Indian English fiction in the 1930s.[1] It is also associated, in some cases, with the works of members of the Indian diaspora who subsequently compose works in English.
Explanation:
Area = 550cm^2
Similar questions