Computer Science, asked by amrita94, 9 months ago


Write a program in Java, using the Scanner methods, to read and display the following details.
Name - as a String data type

Roll Number - as an integer data type

Marks in 5 subjects - as a float data type

Compute and display the percentage of marks.​

Answers

Answered by kunducargo
9

Answer:

import java.util.*;

class Marks

{

public static void main()

{

string name=sc.readline();

System.out.println("Enter the name");

int role= sc.next.lnt();

System.out.println("Enter the total marks in of all 5subjects");

float t = sc.nextFloat();

int p=( t / 500)*100;

System.out.println( "Name is" + name+ "Roll no. is" + role + " Percentage is" +p);

}

Answered by gagneesh555
0

Explanation:

Write a program in Java, using the Scanner methods, to read and display the following details.

Name - as a String data type

Roll Number - as an integer data type

Marks in 5 subjects - as a float data type

Compute and display the percentage of marks.

Similar questions