Computer Science, asked by Aashir096, 6 months ago

Write a program by using class 'Result' with some data members and having functions as per the
specifications given below:
class name : Result
:
void getdata() : to display name, Roll no., and class of a student
void setdata()
to display marks of any three subjects and find out the percentage.
Write a main() method to create an object of the class 'Result' and call the functions getdata() and
setdata() to enable the task.


tell according to class 9 icse​

Answers

Answered by mayabk
0

Answer:

It code is

print("*"*50)

name=input("Enter the name:-")

clas=input("Enter the class:-")

roll=input("Enter the Roll No.-")

print("*"*50)

print("\t\tMarks out of 100")

sub1=float(input("Enter the marks of Subject1:"))

sub2=float(input("Enter the marks of Subject2:"))

sub3=float(input("Enter the marks of Subject3:"))

print("*"*50)

print("\t\tREPORT CARD")

print("*"*50)

print("NAME:",name)

print("CLASS:",clas)

print("ROLL NO:",roll)

print("Marks of Subject 1:",sub1)

print("Marks of Subject 2:",sub2)

print("Marks of Subject 3:",sub3)

print("*"*50)

t=sub1+sub2+sub3

per=t/300*(100)

print("Your percentage is",per)

print("*"*50)

Explanation:

Similar questions