wap that asks you to input your name as well marks in any three subject and store them in different variable . Calculate the total marks and print total marks as well as your name
Answers
Answer:
import java.util.Scanner;
public class marksheet
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int sub1;
int sub2;
int sub3;
int subsum;
String name="";
String su1="";
String su2="";
String su3="";
System.out.print("Please enter your name: ");
name=in.next();
System.out.print("Please enter your first subject: ");
su1=in.next();
System.out.print("Please enter your marks: ");
sub1=in.nextInt();
System.out.print("Please enter your second subject: ");
su2=in.next();
System.out.print("Please enter your marks: ");
sub2=in.nextInt();
System.out.print("Please enter your third subject: ");
su3=in.next();
System.out.print("Please enter your marks: ");
sub3=in.nextInt();
System.out.println("");
System.out.println("Student/Candidate name:" +name);
System.out.println("");
subsum=sub1+sub2+sub3;
System.out.println("Subjects | Marks | Total");
System.out.println(su1+" |"+sub1+" |");
System.out.println(su2+" |"+sub2+" |");
System.out.println(su3+" |"+sub3+" |");
System.out.println(" |"+subsum);
}
}
Explanation:
Hey Friend, I have made the program according to your wish, please mark my answer as Brainliest and also follow for more, It really took me a lot of time so please support me
Answer:
vvvvvvbbb clk CV ftdzgjxjgxjgxx