हिंदी

An ICSE school displays a notice on the school notice board regarding admission in Class XI for choosing stream according to marks obtained in English, - Computer Applications

Advertisements
Advertisements

प्रश्न

An ICSE school displays a notice on the school notice board regarding admission in Class XI for choosing stream according to marks obtained in English, Maths and Science in Class 10 Council Examination.  

Marks obtained in different subjects Stream
Eng, Maths and Science >= 80% Pure Science
Eng and Science >= 80%, Maths >= 60% Bio. Science
Eng, Maths and Science >= 60% Commerce

Print the appropriate stream allotted to a candidate. Write a program to accept marks in English, Maths and Science from the console.

संक्षेप में उत्तर

उत्तर

import java.util.*;
public class Q6
{ public static void main(String args[])
{ int e, m, s; // eng, maths, sci marks
Scanner ob = new Scanner(System.in);
System.out.printin("Enter English Mark:");
e = ob.nextInt(); .
System.out.printin("Enter Math Mark:");
m = ob.nextInt();
System.out.println("Enter Science Mark:");
s = ob.nextInt();
System.out.print("Stream Allotted:");
if (e >= 80 && m >= 80 && s >= 80) System.out.print("Pure Science");
else if (e >= 80 && m >= 60 && s >= 80) System.out.print("Bio Science");
else if (e >= 60 && m >= 60 && s >= 60) System.out.print("Commerce");
}}
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.08: Conditional Statements in Java - EXERCISES [पृष्ठ १०१]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.08 Conditional Statements in Java
EXERCISES | Q VI. 6. | पृष्ठ १०१
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×