Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
- Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
- //print the roll number and average marks of 8 students in three subject(search out of 100). The marks are entered by user.
- package oopjava;
- import java.util.Scanner;
- public class task2oopweek1 {
- public static void main(String[] args) {
- for (int i = 1; i <=8; i++) {
- Scanner input = new Scanner(System.in);
- System.out.println("Put roll number for no."+i+" student:");
- int roll = input.nextInt();
- System.out.println("Your roll is: "+roll);
- System.out.println("Enter math marks: ");
- double math= input.nextDouble();
- System.out.println("Enter EEE marks: ");
- double EEE= input.nextDouble();
- System.out.println("Enter English marks: ");
- double English= input.nextDouble();
- double average = (math+ EEE + English)/3;
- System.out.println("The average of three subjects is: "+average);
- }
- }
- //id:192-15-2820
- }
- package classwork;
- import java.util.Scanner;
- public class MarkEntrySytem {
- public static void main(String[] args) {
- int r,m1,m2,m3;
- Scanner input=new Scanner(System.in);
- System.out.print("Enter Roll Number:");
- r=input.nextInt();
- System.out.print("Enter Marks of Subject1:");
- m1=input.nextInt();
- System.out.print("Enter Marks of Subject2:");
- m2=input.nextInt();
- System.out.print("Enter Marks of Subject3:");
- m3=input.nextInt();
- double a=(m1+m2+m3)/3;
- System.out.printf("Average Marks of Roll %d is: %.2f\n",r,a);
- }
- }
- zafrin all mustary
- 192-15-2834
- package oop;
- import java.util.Scanner;
- import java.text.DecimalFormat;
- public class student_marks {
- public static void main(String[] args) {
- Scanner input= new Scanner(System.in);
- DecimalFormat df2 = new DecimalFormat(".000");
- double math,bangla,english;
- double avg;
- for (int i = 0; i < 8; i++) {
- System.out.print("enter student id:");
- int id= input.nextInt();
- System.out.println("student id is:"+id);
- System.out.print("enter marks for math:");
- math= input.nextInt();
- System.out.print("enter mark of bangla:");
- bangla= input.nextInt();
- System.out.print("enter mark of english:");
- english= input.nextInt();
- avg= (math+bangla+english)/3;
- System.out.println("student id number:"+id+"got average number:"+df2.format(avg));
- }
- }
- }
- //Tawhid Ahmed Komol
- //Id: 192-15-2861
- //Program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
- package oop;
- import java.util.Scanner;
- import java.text.DecimalFormat;
- public class Result {
- public static void main(String[] args) {
- Scanner input=new Scanner(System.in);
- DecimalFormat df2 = new DecimalFormat(".00");
- double math, phy, eng;
- for (int i=0; i < 8; i++) {
- System.out.print("Enter student Id: ");
- int id=input.nextInt();
- System.out.println("Student Id is: "+id);
- System.out.print("Enter Marks for Math: ");
- math=input.nextInt();
- System.out.print("Enter Marks for Physics: ");
- phy=input.nextInt();
- System.out.print("Enter Marks for English: ");
- eng=input.nextInt();
- double avg=((math+phy+eng)/3);
- System.out.println("Student Id no "+id+" got Average: "+df2.format(avg)+" marks in 3 subject");
- }
- }
- }
- //Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
- package practice_problem;
- import java.util.Scanner;
- public class StudentMarks {
- public static void main(String[] args) {
- int roll,marks,sum=0;
- Scanner input = new Scanner(System.in);
- for (int i = 1; i <= 8; i++) {
- System.out.printf("Enter Roll Number = ");
- roll=input.nextInt();
- for (int j = 1; j <= 3; j++) {
- System.out.printf("Enter Marks of Subject[%d] : ",j);
- marks = input.nextInt();
- sum = sum + marks;
- }
- System.out.println("");
- double average = (double)sum/3;
- System.out.println ("The Roll Number of Student "+": "+roll);
- System.out.println("Average Marks : "+average);
- System.out.println("");
- }
- }
- }
- package exercise01;
- import java.util.Scanner;
- public class NewClass3 {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int roll, s1,s2,s3;
- System.out.print("enter roll 1number: ");
- roll= input.nextInt();
- System.out.print("number of subject one: ");
- s1=input.nextInt();
- System.out.print("number of subject two: ");
- s2=input.nextInt();
- System.out.print("number of subject three: ");
- s3=input.nextInt();
- double result= (s1+s2+s3)/3;
- System.out.printf("Avarage marks: %.2f/n",result);
- }
- }
- package ooptask;
- import java.util.Scanner;
- public class OopWeek1Task3 {
- public static void main(String[] args) {
- int i,j,roll_number,marks,sum=0;
- double average;
- Scanner s = new Scanner(System.in);
- for(i=1;i<=8;i++){
- System.out.println("Enter roll_number: ");
- roll_number = s.nextInt();
- for(j=1;j<=3;j++){
- System.out.printf("enter marks of subject:%d",j);
- marks = s.nextInt();
- sum = sum+marks;
- }
- System.out.println("");
- average =(double)sum/3;
- System.out.println("The roll_number of a student"+""+roll_number);
- System.out.println("Average Marks: "+average);
- System.out.println("");
- }
- }
- }
- package jhavagun;
- import java.util.Scanner;
- public class Result {
- public static void main(String[] args) {
- int i=1;
- while(i<9){
- Scanner input=new Scanner(System.in);
- System.out.println(" Student number "+i);
- System.out.print("Enter your Roll Number : ");
- String a=input.nextLine();
- double b;
- System.out.print("Enter Your Bangla Exam Number : ");
- b=input.nextDouble();
- double c;
- System.out.print("Enter Your English Exam Number : ");
- c=input.nextDouble();
- double d;
- System.out.print("Enter Your Math Exam Number : ");
- d=input.nextDouble();
- double e=(b+c+d)/3;
- System.out.println("Your id is : "+a);
- System.out.println("Your number avgerage : "+e);
- i++;
- }
- }
- }
- package oop;
- import java.util.Scanner;
- public class Student_Information {
- public static void main(String[] args) {
- int rollNumber,marks,result=0;
- double average;
- Scanner input = new Scanner(System.in);
- for (int i = 1; i < 9; i++) {
- System.out.println("Enter The Roll Number :");
- rollNumber = input.nextInt();
- for (int j = 1; j < 4; j++) {
- System.out.println("Enter The Marks Of Subjects :");
- marks = input.nextInt();
- result = result+marks;
- }
- average = result/3;
- System.out.println("The roll number :"+rollNumber);
- System.out.println("Average Marks (each out of 100):"+average);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement